Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

open order

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

    open order

    Is there a function that will tell me if there is an open order (ie, like if I placed a Limit Order that has not been executed yet)?

    I use limit orders and I need my strategy to take an action once a trade opens, and for my purposes, once the order is placed, it is the same as if the trade was opened.

    Thanks,

    Safetrading

    #2
    You can track the state of the order using an IOrder object. This will allow you to see if the limit order is OrderState.Working or OrderState.Filled, and then take action from there.

    MatthewNinjaTrader Product Management

    Comment


      #3
      Safetrading,

      There is also another way of checking for an open order:

      for (inti=0; i<Account.Orders.Count; i++)
      {
      if(Account.Orders[i].Instrument.Id==Instrument.Id&&// checking orders just for your instrument
      Account.Orders[i].OrderState==OrderState.Accepted) // get order in the desired status
      {
      // your logic here
      }
      }

      Hope this helps

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Waxavi, Today, 02:10 AM
      0 responses
      6 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by TradeForge, Today, 02:09 AM
      0 responses
      11 views
      0 likes
      Last Post TradeForge  
      Started by Waxavi, Today, 02:00 AM
      0 responses
      2 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by elirion, Today, 01:36 AM
      0 responses
      4 views
      0 likes
      Last Post elirion
      by elirion
       
      Started by gentlebenthebear, Today, 01:30 AM
      0 responses
      5 views
      0 likes
      Last Post gentlebenthebear  
      Working...
      X