Forums ProRealTime English forum ProOrder support Division by Zero Error: Trading system was stopped Reply To: Division by Zero Error: Trading system was stopped

#136632

Thank you for your feedback so far!

I have a few instances where I have   /(open[1]-close[1])  or /(close[1]-(open[1])  in my code, and if a bar opened and closed with no price movement whatsoever then, I suppose,  this would cause a divide by zero error. So I will try your suggestion with the  max formula and see if that changes anything on Monday.

I started running this system since the beginning of this week and I had around 20 times the division by zero error across all three timeframes and the 7 FX pairs. Basically it happened everyday this week. However, somehow I cannot imagine that there are so many bars with zero movement (open=close), and when I checked the charts after the error messages appeared (I didn’t do it every time), I couldn’t see any zero movement bar. Anyway, I’ll try your suggestion and see how it goes.