Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get stop loss/profit target for orders in script?

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

    How to get stop loss/profit target for orders in script?

    Hi,

    How can I get stop/profit values for brackets or orders with some target from the `OnExecutionUpdate` method?

    Basically, I want to be able to get a trade's stop/profit for each executed execution - whether the stop or profit is hit or not.


    Is this possible? Can someone point me in the right direction, please?

    Thank you!


    #2
    Hello, thanks for writing in. We have two examples that can help with this. One is showing how to monitor stops submitted with Set methods:

    https://ninjatrader.com/support/help..._and_profi.htm

    The other is submitting the stops using Exit orders and is a bit more flexible since you can choose the signal name for the orders:



    Kind regards,
    -ChrisL​
    Last edited by NinjaTrader_ChrisL; 03-28-2023, 08:29 AM.

    Comment


      #3
      Hi,

      Thank you.

      Your second link is broken.

      Also, I'm not seeing a way where we can get the stop in the `OnExecutionUpdate` method? I only see the stop as a value in the `OnOrderUpdate` method.

      Comment


        #4
        Hello, thanks for the follow up.

        I fixed the link above. The first example that monitors stops made with the Set methods does not use OnExecuitionUpdate, but it could. The Execution object given to OnExecutionUpdate has an Order object within it where the Signal Name can be read.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        548 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        549 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X