I want to be able to set a stoploss and profit target with OCO for any entry order that is triggered so I am looking at the SetStopLoss() and SetProfitTarget() methods. I then want to move that stoploss up to breakeven after a certain profit. I will be trading stocks through IB so it is imperative that the stoploss is placed immediately on a partial fill and updated as more partial fills occur. I believe IB forces you to use StopTargetHandling of ByPositionStrategy.
My questions
1. If I use SetStopLoss() method and StopTargetHandling ByStrategyPosition, will each partial fill result in a single stoploss order immediately that proportionately protects the partial position and is updated as additional fills occur? or does it wait until the whole position is filled to place the stoploss? If it does handle partial fills is the stop moved to cater for increasing quantity and the change in average price as more partial fills occur? I want to ensure that the strategy protects positions like the example at the bottom of the OnExecutionUpdate() page (https://ninjatrader.com/support/help...tionupdate.htm) which monitors and manages partial fills using and the ExitLongStopMarket() method. But I want to use SetStopLoss for it's OCO capabilities. If I have to use ExitLongStopMarket() instead please advise.
2. How do i access the StopLoss associated with the Order object for the execution to check the stoploss has been placed at the correct level (Av Price - some quantity of ticks). I want just to use Print() to output it so I can check it's placed correctly.
3. The SetStopLoss() method doesn't seem to return its own order object like ExitLongStopMarket(), How do I update the StopLoss associated with the execution order so I can move it to breakeven at some point in the future?
I am not an experienced programmer, could you please address each question individually for me.
Thankyou
Comment