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 update the stopOrder1.StopPrice

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

    How to update the stopOrder1.StopPrice

    I am using the following lines in my strategy to change the stopOrder1.StopPrice. How can I read the changed stopprice once it has been submitted to the exchange.? I am using the OnExecutionUpdate method, but struggle to understand how to "read" the confirmation that the stoporder price has been changed. I obviously need to change the "new" stopprice to prevent the changeorder from being submitted again

    if (stopOrder1 != null && (Close[0] + 2 * StopStepChange) < stopOrder1.StopPrice)
    {
    GetOrderState("At Short Change HTF");
    ChangeOrder(stopOrder1, stopOrder1.Quantity, 0, Close[0] + StopStepChange);

    }

    Thanks for your help

    RH

    #2
    Hello RH,

    The change would be confirmed when the order updates in OnOrderUpdate() with the new stop price.
    https://ninjatrader.com/support/help...rderupdate.htm

    Below is a link to an example script that modifies the price of exit orders.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by geddyisodin, Yesterday, 05:20 AM
    7 responses
    45 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by gbourque, Today, 06:39 AM
    2 responses
    5 views
    0 likes
    Last Post gbourque  
    Started by cre8able, Yesterday, 07:24 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by cocoescala, 10-12-2018, 11:02 PM
    6 responses
    939 views
    0 likes
    Last Post Jquiroz1975  
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X