PureBytes Links
Trading Reference Links
|
Howdy all
Am i on drugs ...or does this function look broken/wrong.
The function is called RSMemPred.
The last line says "RSMemPred=Predict;"
Then wouldnt it always be '0' considering thats the variable value it was
given at the beggining? No other "predict=" statements exist.... unless it
has something to do with the second last line
" GetVecQQ (2, LkAhead-1, &Predict);"
If so what does the '&' signify ?
Looks 'bizaro world' code to me .... but then again i have missed the
obvious before.
I hope someone can shine some light on this for me :O)
Cheers
Cameron
Inputs:
Series(NumericSeries),WinSize(Numeric),Poles(Numeric),LkAhead(Numeric);
DefineDLLFunc:"TSNNL.DLL",INT,"SetVecQQ",INT,INT,FLOAT;
DefineDLLFunc:"TSNNL.DLL",INT,"GetVecQQ",INT,INT,LPFLOAT;
DefineDLLFunc:"TSNNL.DLL",INT,"DoMesaCalc",INT,INT,INT,INT;
DefineDLLFunc:"TSNNL.DLL",INT,"DoMesaExtrap",INT,INT,INT,INT,INT,INT;
DefineDLLFunc:"TSNNL.DLL",INT,"GetMesaPower",INT,INT,INT,FLOAT,LPFLOAT;
{
We also need to declare some variables to use in our Easy Language
calculations:
an index variable (k), the number of data points minus one (na), and the
number of poles to use in the model (np). }
vars: Counter(0),DeTrVal(0);
Vars: Predict(0),RetVal(0);
DeTrVal=DeTrend(Series,6,20);
for counter = 0 to WinSize begin { WinSize+1 data
points }
SetVecQQ ( 0, WinSize-counter,DeTrVal[counter]); { place
in vector
register }
end;
DoMesaCalc (0, 1, WinSize+1, Poles);
DoMesaExtrap (0, 1, 2, WinSize+1, Poles, LkAhead);
GetVecQQ (2, LkAhead-1, &Predict);
RSMemPred=Predict;
---
|