[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] An indicator tricky to code !!! (for AFL gurus)



PureBytes Links

Trading Reference Links

Khamsina,
 
Rather than give us the code from another language, can you just explain what it is supposed to do?  It's not obvious from the code.
 
Regards,
 
Dan.
 
-------------- Original message --------------

Hi,

I have been sweating on this indicator for 3 days (below, it's written
in EasyLanguage) and I just can't translate it into AFL :-( .
Unfortunately, it far more difficult for me (loop, array).

Many thanks in advance for your valuable help,
Regards,

Khamsina


Inputs: Len(Numeric);
Vars: Mean(0), j(0), k(1.253314), SumSqr(0), Scale(0), MaxY(0), 
MinY(0), Rng(0);
Arrays: X[100](0), Y[100](0);

Mean = Average((h+c+l)/3, Len);
SumSqr = 0;
for j = 0 to Len - 1 begin
  X[j] = C[j] - Mean;
  SumSqr = SumSqr + X[j] * X[j];
end;
Scale = SquareRoot(SumSqr / Len);
Y[0] = X[0];
MaxY = X[0];
MinY = X[0];
for j = 1 to Len - 1 begin
  Y[j] = Y[j - 1] + X[j];
  if Y[j] > MaxY then MaxY = Y[j];
  if Y[j] < MinY then MinY = Y[j];
end;
Rng = MaxY - MinY;
Estmtr = Log(Rng/(k * Scale)) / Log(Len);

     

     
           
___________________________________________________________________________
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur http://fr.messenger.yahoo.com


Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





Yahoo! Groups Links