Firstly my appreciation for this Prorealtime software. I am not a programmer, but I was able to learn and code so easily. Amazing stuff. I wrote a code. The idea is to attach to 1 minute candle, so it execute at every minute. But the code is not getting executed at every minute, but at different interval. Sometimes I could not understand the logic when it gets triggered. What am I doing wrong. This is the simplest martingale code checking the previous candle . There are infact 3 issues. Please help me. Kindest regards. The Code doesn’t get executed at every minute as expected I donot know why After 1,2 the ordersize goes to 8 The Code checking the CurrentMinute doesn’t work. I thought I will buy at 1 minute and sell at 59th minute. ONCE OrderSize = 1 //IF CurrentMinute = 59 THEN //ENDIF //IF CurrentMinute = 1 THEN isBullish = 0 isBearish = 0 IF Close[0] >= Open[0] THEN isBullish = 1 ENDIF IF Close[0] < Open[0] THEN isBearish = 1 ENDIF IF isBullish = 1 THEN IF PositionPerf(0) < 0 THEN OrderSize = OrderSize*2 ELSIF PositionPerf(0) >= 0 THEN OrderSize = 1 ENDIF IF LongOnMarket THEN SELL OrderSize LOTS AT MARKET ENDIF IF ShortOnMarket THEN BUY OrderSize LOTS AT MARKET ENDIF BUY OrderSize CONTRACTS AT MARKET ENDIF IF isBearish = 1 THEN IF PositionPerf(0) < 0 THEN OrderSize = OrderSize*2 ELSIF PositionPerf(0) >= 0 THEN OrderSize = 1 ENDIF IF LongOnMarket THEN SELL OrderSize LOTS AT MARKET ENDIF IF ShortOnMarket THEN BUY OrderSize LOTS AT MARKET ENDIF SELLSHORT OrderSize CONTRACTS AT MARKET ENDIF