I have been trying to get my the exits of my strategy to work exactly as I want them to which has led me to trying to use the OnOrderUpdate and OnExecutionUpdate.
As I am reading and trying to get a grip on the overview of how to use these methods and apply them to what I want them to do for my strategy, I am getting hung up on the following part from the Ninjatrader Advacned Order Handling guide, specifically the text I colored red.
protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice, int quantity , int filled, double averageFillPrice, OrderState orderState, DateTime time, ErrorCode error, string nativeError)
{
// Assign entryOrder in OnOrderUpdate() to ensure the assignment occurs when expected.
// This is more reliable than assigning Order objects in OnBarUpdate, as the assignment is not gauranteed to be complete if it is referenced immediately after submitting
if (order.Name == "AAPL Order" && orderState != OrderState.Filled)
entryOrder = order;
}
What is the order that entryOrder is being set to? I sort of have an idea of what is being done. But in my strategy I could have up to 3 different entries, 1 entry using the 15 minute chart, 1 entry using the 30 minute chart and 1 entry using the 60 minute chart. This is where I am getting confused.
I am thinking I would create 3 different Order Variables maybe FifteenEntryOrder, ThiryEntryOrder, etc. But how would I assign the variables?
Let me know if this question even makes sense. I am still learning how to update orders using these methods.
Thank you,
Nick

Comment