Forums ProRealTime English forum ProOrder support Volatility Scalper S1 V01 Reply To: Volatility Scalper S1 V01

#124758

Try to add a a defparam preloadbards = 1000 at the top of the code.

You should also calculate your position size only before entering a new order, because now the “n” variable is calculating on each bar, even if you don’t meet the requirement to open a new position at market. So move the martingale code before line 79 and 91.