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

Loop Statements



PureBytes Links

Trading Reference Links


Hello,

I am trying to create a loop statement to count how many up days and how 
many down days for a specified look back period. For example, I wish to 
create a counter called "count" that will add and/or subtract 1 each time 
the market closes above/below previous close. I have tried the following but 
need some help;

Variables: count(0);

For 1 = 10 Begin
If C > C[1] Then Count = Count + 1;
If C < C[1] Then Count = Count – 1 ;
End;

This doesn’t work, as I don’t have much of an idea how these statements 
work. Can somebody please help me understand the fundamentals of these 
statements? Thanks.

Jodie.