• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 rwilliam, Today, 03:14 PM
    0 responses
    3 views
    0 likes
    Last Post rwilliam  
    Started by rwilliam, Today, 03:10 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by rontronimous, Today, 03:04 PM
    2 responses
    5 views
    0 likes
    Last Post rontronimous  
    Started by zacharydw00, Today, 03:14 PM
    0 responses
    3 views
    0 likes
    Last Post zacharydw00  
    Started by junkone, 09-12-2019, 07:10 PM
    11 responses
    81 views
    0 likes
    Last Post cnecorp
    by cnecorp
     
    Working...
    X