When using the NinjaTrader 8 Editor or Visual Studio, if I create an instance of the Order object, intellisense shows me two bool values IsLong and IsShort. They seem fairly obvious what they mean, but I wanted to be thorough and make sure I understood the detailed purpose of these bools for some smaller cases that aren't so obvious. I'll explain some scenarios below, but the reason why I'm creating this ticket is that after checking the NinjaTrader 8 Help Guide, specifically here: https://ninjatrader.com/support/help...nt8/?order.htm I do not see any mention of these two bool Properties in the Order object. I even searched for IsLong and IsShort in the Guide and found 0 matches.
The cases that seem obvious for these values are when I have a reference to an Order object that I set from OnOrderUpdate for an order that I placed. If I had placed Buy order with an EnterLong method call and have a reference to a class variable for that order, it would seem that once it is filled, IsLong should be true and IsShort should be false. However, there are several cases that are not so obvious to me. Please see the following examples:
What about when I call EnterLongLimit and the order is in the Working state, just waiting for price to come down and reach it? Would this Order object have IsLong and IsShort both set to false, or would IsLong be True knowing we could check the OrderState to know if it is filled or not?
What would these values be for a Stop order or Profit Target order? Would these orders for a long position have IsShort == true because they are set to Sell in order to exit?
Before using these variables in my code, I just wanted to make sure I fully understood the intention of them. Mostly I wonder if they are intended only for an Entry Order object that is Filled and not Stop or Target orders (or Entry Orders that are limit or stop orders not yet filled) If it's possible to update the Guide with these Properties and descriptions clarifying these things I would hope it could help others with this question as well.
Thank you!
Paul
Comment