Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

State of an IOrder Object when TP or SL

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

    State of an IOrder Object when TP or SL

    Hello,

    what happens with an IOrder Object, if this Order runs into SL oder TP?
    Get this dynamic variable automatically on null?

    The Backround is I want so realize 2 things:

    1. The Strategy should cancel a submitted Order after one more Bar

    2. The Strategy should realize, if an Open Order goes into TP or SL, and set the IOrder Object to null, because I want to Block the Order entering while an Open Order is in the Market

    I tried it with the OnOrderUpdate methode, but I can't finde an Order state that saing "Order runed into SL/TP"

    #2
    Hi Ludwig,
    Thanks for the post and welcome to the forums! For checking order properties on profit target / stop losses (submitted with Set), you have to look for the name of the order. A complete sample showing how to do this is here:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thank you,

      but does this run with multiple statagies? does Position.Quantity only use the specific postion from the strategy? What if there are positions in the market by other strategies?

      Is it right that in the sample code the OnOrderUpdate condition if (order.OrderState == OrderState.PendingSubmit) checks for all orders not only for orders by the strategie?

      Comment


        #4
        Yes, that's correct. Any position or order state information is only for the strategy instance from where you access it.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sjsj2732, Yesterday, 04:31 AM
        0 responses
        33 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        286 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        286 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        133 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        91 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X