Re[4]: Перевод С в Pascal
От: SergKr  
Дата: 06.01.08 19:29
Оценка:
Здравствуйте, OdesitVadim, Вы писали:

OV>а что это???


OV>В целом, нужно собраться и аккуратно перевести код, подумав предварительно, что он делает


Это вот чего такое (только на английском)
//This indicator is very simple too except that an entire
// time series (all bars) is passed back and forth at once
// instead of a bar at a time.

// The function of the DLL is to return the number of days ago
// that the highest value in a window of the time series occurred.
// The window size is variable and if the highest value was today,
// then zero is returned.

//Note that the Trader N/A value is returned until a complete
// window occurs.

// The parameter “series” is the input array
// The parameter “days” is the output array
// The parameter “window” is the size of the lookback window
// The parameter “size” is the number of bars in the arrays

_declspec(dllexport) void Highdays (double *series, double *days, long int window, long int size)

{ double *in, *out;
long int i,j;
long int highest;

in=series; // the very first bar input
out= days; // the first bar to output

for (i=0; i<size; i++) // go thru all bars
{if (i < window-1) // see if we have a whole window yet
*out=3.4e38; // the N/A value that shows nothing on the chart
else
{ highest= 0;
for (j=1; j< window; j++) // search for highest value
{ if (*(in-j) > *(in-highest)) highest=j; }
*out=highest; // number of days ago the highest was
}
in++; out++; // go to next bar
}

}
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.