I have some questions on protective orders with Interactive Brokers:
1. Should I place protective orders from OnOrderUpdate or from OnExecutionUpdate?
I am a bit confused if I should make my protective Orders from OnOrderUpdate or from OnExecutionUpdate with IB. In the Help Guide it says: "When using a NinjaScript strategy it is best practice to only work with passed by value data from OnExecution." So the HelpGuide recommends using OnExecutionUpdate if I understand it correctly. However, in the forum it is recommended to place protective Orders in OnOrderUpdate: When is OnPositionUpdate called? - NinjaTrader Support Forum - see Jim's Post 4
2. From my research in the forum I understood that the Position object (Position.Quantity or Position.MarketPosition) called within OnBarUpdate doesn't have these problems. So using the Position object only within OnBarUpdate should work correctly also with IB, is that correct? To me this seems not logical because it shouldn't matter where I call the Position object since its a matter in which order the code is being executed.
3. Do I understand it correctly that I also have to make a custom calculation for the Average Fill Price while in OnExecutionUpdate or OnOrderUpdate because the Position may be wrong here?
4. How can I get the accurate Account Position from IB directly via code?
5. Are there any other things I should consider because of IB?
Thanks in advance!

Comment