Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

onposition - check orders

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

    onposition - check orders

    Hello,

    I have issues in onexecution with counting variables (in fast moving markets).

    So I try to check the orders in onposition but I get an error message because of "execution" with

    if(exitOrder1c != null && exitOrder1c == execution.Order&& execution.Order.OrderState == OrderState.Filled)

    and an error message because of "order" with

    if (exitOrder1c != null && exitOrder1c == order&& order.OrderState == OrderState.Filled)

    How can one do in onPosition to check if an order is filled.

    Thank you.
    Tony

    #2
    Hi Tonynt,

    Thank you for your post.

    OnPositionUpdate() will use the IPosition for the method.
    http://www.ninjatrader.com/support/h...?iposition.htm

    You can try checking when you get long or short or when a certain number of contracts are either long or short to help determine when the order was filled.
    Cal H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    84 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    46 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    66 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    69 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    58 views
    0 likes
    Last Post CarlTrading  
    Working...
    X