I am trying to code a simple system (non rotational) which can have multiple open positions per symbol and at the same time using stopTypeLoss. I tried with SetBacktestMode (backtestRegularRawMulti); but I go an error " Error 43. Variable stops are not supported in Rotational Trading mode".
I need help how can I code multiple open positions and stopTypeLoss at the same time?
First, you didn't post the code. Posting code is essential. Otherwise we can't point you to the exact line you have wrong in your code.
And one of ApplyStop lines in your code is wrong.
So POST THE CODE when asking any question about AFL.
Secondly, the error message WAS a little bit misleading. The restriction applies to any backtest mode other than backtestRegular.
And actually wording of the error message in recent versions (such as 6.40) is different. It says:
Error 43. Variable stops are not supported in Rotational and Raw backtest modes
So you must be using old version, if you get old message.
Only in backtestRegular you are allowed to have variable stops (i.e. stops where the "amount" varies bar by bar).
In all other modes you can only have stops where the "amount" argument to ApplyStop is scalar value (not array).
I want the above code to produce multiple open positions per symbols and at the same time to use Stop Loss as function of ATR (as in the code). So, how can I do it?