• 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 gbulle, Today, 06:03 PM
    1 response
    14 views
    0 likes
    Last Post gbulle
    by gbulle
     
    Started by kronie, Today, 03:52 PM
    0 responses
    12 views
    0 likes
    Last Post kronie
    by kronie
     
    Started by bouncetherubble, Yesterday, 07:12 PM
    2 responses
    19 views
    0 likes
    Last Post bouncetherubble  
    Started by Zenersev, 10-19-2019, 02:11 PM
    7 responses
    53 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Started by Lancer, Today, 10:39 AM
    4 responses
    26 views
    0 likes
    Last Post Lancer
    by Lancer
     
    Working...
    X