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

Sending limit order with Stop and Profit levels

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

    Sending limit order with Stop and Profit levels

    Hi

    I am trying to migrate a strategy to Ninjatrader. Can I ask how can i send a limit order with profit and stop prices together?
    Also say i have sent an order with title "EnterLong", when i send second order with the same title, is it going to be modified? Because i want to keep single pending order at the same time.

    Thank you

    #2
    Hello Atilla,

    Thanks for your post.

    Typically this would be done by using the methods of SetProfitTarget() and SetStopLoss(). These methods provide an automatic profit / stop for each entry made by the strategy and are OCO linked. If you create these in the InItialize() method then they will be used with the same values on every entry (recommend using CalculationMode.ticks). If you intend to dynamically change them, then they will be use in OnBarUpdate(0 and a critical concept is to set their values before placing the entry to ensure that when the entry fills the stop/target values are as expected, this is needed because the methods will retain and use the last value they were set to.
    Please see:


    I also recommend an overview found here: https://ninjatrader.com/support/help...d_approach.htm

    If you resubmit an order, before the first is filled, yes, it will modify the original order. If you intend to have a 2nd order then it will need a unique name. Please review the link above on the managed approach as it discusses the use of signal names which you may also want to use on the set methods if you intend for multiple order with different stops/profits at the same time.
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,404 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by Shai Samuel, 07-02-2022, 02:46 PM
    4 responses
    95 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    8 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    159 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    8 views
    0 likes
    Last Post Belfortbucks  
    Working...
    X