OK, I got it to work correctly when I tested the test script. But when I try to trade the test script with a lookback of 60 or higher I get:

Lots 10, Stop 0.0001, PIPCost 0.1000, Risk 3.05.
(EUR/USD::L) 16:41 Can't open 10@1.3601

So with a lookback >60 it doesn't open trades.

But more importantly, in the original strategy, as I said, I have a lookback period of 500, so how is that the issue then?