Forums › ProRealTime English forum › ProOrder support › Same Code but different results on different computers › Reply To: Same Code but different results on different computers
05/25/2018 at 9:35 AM
#71340
The problem is fixed by modifying the end of the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
// EURO DOLLAR MINI 15 min DEFPARAM CumulateOrders = false DEFPARAM FlatBefore = 000000 DEFPARAM FlatAfter = 234500 if longonmarket and (close <low[1]) then sell at market endif if OpenDayOfWeek = 1 then Pivot = (DHigh(2) + DLow(2) + DClose(2)) / 3 S2 = Pivot - (DHigh(2) - DLow(2)) endif if OpenDayOfWeek = 2 or OpenDayOfWeek = 3 or OpenDayOfWeek = 4 or OpenDayOfWeek = 5 then Pivot = (DHigh(1) + DLow(1) + DClose(1)) / 3 S2 = Pivot - (DHigh(1) - DLow(1)) endif dojisizes2d = 10 dojis2d = Range >= ABS(Open[1] - Close[1]) * dojisizes2d abst2d = 8*pipsize abstl2d = 2*pipsize size = 4 bullishs2d = (dojis2d and low[1] <= s2+abstl2d and low[1] >= s2-abst2d and close>high[1] and low>low[1]) if bullishs2d then ldbs2d = low[1]-2 Buy size Contract at Market sell at ldbs2d stop endif if longonmarket and (close <low[1]) then sell at market endif if longonmarket then sell at ldbs2d stop endif |
Set the exit condition before adding the SELL STOP order solved it. I think that the “ldbs2d” is not at a correct level (above the current level?) and made the code crash somehow..