I have created a strategy that sometimes the entry and exit runs on the same candle. In this case, when backtesting, the signal happens multiple times and the inputs and outputs are also executed multiple times, when it should be a single input per signal.
To fix it, I have used the condition (BarsSinceEntryExecution (1, "Largos1", 0) == -1)
Multiple inputs per signal no longer occur. But the problem now is that input is only executed by the first long signal and the first short signal. For the other signals, the strategy draws them on the chart, but does not make the buy and sell inputs.
I have tried, without success, to add in the conditions of entry
BarsSinceExitExecution (the strategy stops operating)
O well
Position.MarketPosition == MarketPosition.Flat (only the first signal continues to run)
But the problem is not solved.
Thanks in advance and greetings.
Comment