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 GussJ, 03-04-2020, 03:11 PM
    11 responses
    3,227 views
    0 likes
    Last Post xiinteractive  
    Started by andrewtrades, Today, 04:57 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    7 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    440 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    12 views
    0 likes
    Last Post FAQtrader  
    Working...
    X