I want to start at bar 1 and go through to the last bar using a variable of MA=10 then I want to increment MA ie MA=MA+1 and then loop through again.
I have tried
Code: Select all
Vars:MA(0);
Once MA = 10;
// Some code in here
FileAppend("C:\Temp\Test_"+NumtoStr(MA,0)+".TXT",NumtoStr(MA,0)+" " + FormatDate("dd/MM/yy",ELDateToDateTime(date)) +" "+NumtoStr(NetProfit,2)+NewLine);
If Date>=EndDate then
begin
FileAppend("C:\Temp\test"+NumtoStr(MA,0)+".txt",DatetoString(Date)+"End");
MA = MA + 1 ;
print("Loop =",MA);
recalculate;
end;
It would appear that recalculate forces MA back to 10.
Not using "Once" but using Vars:MA(10) doesn't work either.
Ideas?
Neil.