Announcement

Collapse
No announcement yet.

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:
    https://ninjatrader.com/support/help...etstoploss.htm
    https://ninjatrader.com/support/help...ofittarget.htm
    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 Cross161, Yesterday, 10:33 PM
    0 responses
    6 views
    0 likes
    Last Post Cross161  
    Started by neilzep, Yesterday, 08:55 PM
    0 responses
    7 views
    0 likes
    Last Post neilzep
    by neilzep
     
    Started by javier.filgueira, Yesterday, 03:29 PM
    3 responses
    10 views
    0 likes
    Last Post javier.filgueira  
    Started by Da vinci, Yesterday, 03:15 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by Da vinci, Yesterday, 02:51 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Working...
    X