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 CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        224 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        142 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        157 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        237 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        196 views
        0 likes
        Last Post CarlTrading  
        Working...
        X