Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Chris L.NinjaTrader Customer Service

    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.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by zstheorist, Today, 07:52 PM
        0 responses
        3 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        149 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Working...
        X