Problem is that the strategy works live or if i use playback. It is not possible to do backtest.
Example:
Code: Select all
Vars: BuySignal(false), Counter1(0), Counter2(0);
Array: arrnumber1[64](0), arrnumber2[20](0),
// I have some numbers in arrays
For Counter1 = 0 to 63
begin
For counter2 = 0 to 19
begin
If low = open + arrnumber1[Counter1] / arrnumber2[counter2] then BuySignal = true else BuySignal = false;
end;
end;
If BuySignal and marketposition = 0 then
begin
buy next bar at market;
BuySignal = false;
End;
setstoploss(1000);
setprofittarget(1000);
Thank You.