• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is OrderState a global variable?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Is OrderState a global variable?

    In the following example, is this OrderState.Filled status visible to other event calls, such as onMarketData()? Or I have to define my own global flag to track this status? Thanks.


    protected override void OnExecution(IExecution execution) { if (execution.Order.OrderState == OrderState.Filled) { Print("Part filled amount is "+execution.Quantity); }

    #2
    Hello appleseed,

    If you have an IOrder handle for an order you can check the order state with that.

    For example:

    in variables region:
    private IOrder myorder = null;

    in OnBarUpdate:
    myOrder = EnterLong();

    in OnMarketData:
    if (myOrder != null)
    Print(myOrder.OrderState.ToString());

    Below is a link to the help guide on IOrder.
    http://www.ninjatrader.com/support/h...nt7/iorder.htm
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CopyPasteGhost, Today, 11:22 AM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Sulfred, Today, 12:34 AM
    2 responses
    14 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by 1001111, Today, 10:23 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_PaulG  
    Started by NinjaCustomer, Today, 11:07 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Melissa  
    Started by NtFan, Today, 10:47 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X