Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Identify if an order has an associated stop loss

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

    Identify if an order has an associated stop loss

    Hello,

    Is it possible in Ninjascript to identify if a position has an associated stop loss order? I use a stop loss in some instances and not in some. If I knew whether a particular position has an associated stop loss, I can do things differently. For example, maybe I would like to set a stop limit order at a point when I feel I could get the best price for the position. If the position has an associated stop order, the exit<>stoplimit orders are rejected. Due to the asynchronous nature of the feedback (of rejection of the order), it is too late for me to do anything about it. I tried keeping track of this in global variables, etc., but that is poor programming and source of bugs. Instead, if there was a way to ask the position object itself whether there is an associated stop loss and the stop loss price, one can determine next steps much more easily.

    Thanks.

    PR

    #2
    Hello,

    Yes, this is possible by using the IOrder class.

    Please see our Reference Sample on Monitoring Stop-Loss and Profit Target orders:

    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    650 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    577 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X