in backtesting, my algo opens several positions within1 Candle (DAX – Timeframe 1mn)
I want to avoid “defparam cumulate orders = false”, because I want open another position if there is an entry conditions later a day, but not within the same candle.
Maybe, it is only a backtesting problem, I am not sure. Attached, I have simple code to demonstrate my problem.
As I can read in your code, it’s impossible that more than 1 short trade is entered on the same candle on the 1-minute bar if you are using a 1-minute timeframe, because once the entry conditions are met they won’t be evaluated again until next bar.
It only may occur if you are using a lower timeframe.
Please post the code you are using and info about the default timeframe.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue