• 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

OrderState of a StopLimit order

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

    OrderState of a StopLimit order

    Hi all,

    I would like to know if, when the stop price specified in a StopLimit order has been reached, the orderState change.

    If not, is there a way to understand if the stop price has been reached and the order is waiting for the limit price achievement?

    Thanks.

    #2
    Hello mbk2787, and thank you for your question.

    I believe you may be interested in the OnOrderUpdate() method. This will get triggered every time one of your order states changes. I can include an excerpt from the Help Guide.

    http://ninjatrader.com/support/helpG...rderupdate.htm

    Code:
    private IOrder entryOrder = null;
      
     protected override void OnBarUpdate()
    {
         if (entryOrder == null && Close[0] > Open[0])
              entryOrder = EnterLong();
    }
      
     protected override void OnOrderUpdate(IOrder order)
    {
         if (entryOrder != null && entryOrder == order)
         {
              Print(order.ToString());
              if (order.OrderState == OrderState.Cancelled)
              {
                   // Do something here
                   entryOrder = null;
              }
         }
    }
    Please let us know if there is any other way we can help.
    Jessica P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by mestril, Yesterday, 10:22 AM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by hir04068, Yesterday, 09:29 PM
    5 responses
    18 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by bubblegum, Today, 03:51 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by johnnybegoode, 05-24-2019, 10:16 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by manugarc, Today, 01:15 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X