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

Re: understanding easylanguage code



PureBytes Links

Trading Reference Links

CurrentBar = 1 on the first bar of the calculation.

if CurrentBar = 1 then begin
   <initialization code here>
end else 
   <code for subsequent bars>
end;

Bob Fulks



At 12:15 PM 2/21/2006, Mikael Göransson wrote:


>If Length + 1 <> 0 Then Begin
>        If CurrentBar <= 1 Then Begin
>                Factor = 2 / (Length + 1);
>                XAverage = Price;
>        End
>        Else
>                XAverage = Factor * Price + (1 - Factor) * XAverage[1];
>End;
>
>i don't quite know what CurrentBar is, does it start with today, so  
>when CurrentBar = 1 it's today, and if Length is 35, the last  
>CurrentBar would be 35?