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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        63 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        87 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        47 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        104 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        63 views
        0 likes
        Last Post PaulMohn  
        Working...
        X