The problem arises when I scale out of a position (ex. long two contracts and then I cover one contract) and the associated stop loss order. I was under the assumption that if you place a stop loss order with the same entry signal (fromEntrySignal) then when a position is adjusted the stop order is automatically adjusted but it doesn't seem to be working that way.
Here's an example:
1) I go long 2 contracts: EnterLong(2, _lastSignal);
2) Immediately following the "EnterLong" line of code, I place a stop loss: SetStopLoss(_lastSignal, CalculationMode.Ticks, 4, true);
3) After x ticks in profit, I cover 1 contract: ExitLong(1, "Trim" + CurrentBar, _lastSignal);
The problem I'm having is that the original stop loss order still reflects 2 contracts, so when it gets hit, I then get placed into a short position because the stop loss order was not adjusted to 1 contract.
Is there a way to cancel a pending stop loss order? Or a way to adjust it?
Any help would be greatly appreciated.
Comment