This thread is about the For keyword in EasyLanguage.
For
Used in combination with To or DownTo to form a loop statement
that will execute a set of instructions repeatedly until the loop count reaches the specified final value.
The loop statement specifies a numerical variable that holds the loop count,
as well as initial and final counter values.
To specifies that the value of the counter variable is to be increased by one on the completion of each loop,
while DownTo specifies that the value of the counter variable is to be decreased by one on the completion of each loop.
The use of Begin and End statements is required to group the instructions for execution within the loop;
a Begin must always be followed by an End.
Begin should not be followed by a semicolon (,
code lines within an instruction group should end with a semicolon (,
and End should be followed by a semicolon (.
Usage
For Counter = IValue To FValue
Begin
Instruction1;
Instruction2;
End;
or:
For Counter = IValue DownTo FValue
Begin
Instruction1;
Instruction2;
End;
Where:
Counter - a numerical variable used store the loop count
IValue - a numerical expression specifying the initial counter value
FValue - a numerical expression specifying the final counter value
Example
Add the high prices of the last 10 bars to the HighPriceSum variable:
For BarBackNo = 0 To 9
Begin
HighPriceSum = HighPriceSum + High[barBackNo];
End;
Add the high prices of the last 10 bars to the HighPriceSum variable:
For BarBackNo = 9 DownTo 0
Begin
HighPriceSum = HighPriceSum + High[barBackNo];
End;
source: EasyLanguage manual