I have a strategy that exit the market with a limit order which value is updated on each bar.
.
I would like to add a protective stoploss that i want to be created only if BarsSinceEntryExecution >= 1. The stoploss is a hard price (the high or low of the last bar) depending if the position is short or long respectively.
I read that i have to create the stoplosses in OnExecutionUpdate() which i did. Attaching the code. However when i enable the strategy i have the following error:
Can anybody helps here?
Comment