1. I am painfully working on a system that uses unmanaged orders. With a every a position, a stop must be placed. Originally I used the OnPositionUpdate event to make sure my stop and limit order was placed on every new position. It did strange things like cancelling the orders rather than placing them. Finally I tried handling fills in the OnExecution (and got rid of the OnPositionUpdate event handler completely) event handler and checked that a new position resulted from the execution and now it works. I am curious as why this might be as my flawed intuition says to use the OnPositionUpdate event handler would make the most sense.
2. If an order object's order state is filled and a CancelOrder function is being called, what happens internally? What happens when the SubmitOrder function is called on an order object whose order state is filled?
3. Is there a way to ensure a stop is placed on every position outside of the program in Ninja Trader itself such as a setting?
Knowing this might help me to debug some minor issues that are still occurring in real time.
Thank you,
Cowpux
Comment