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

Concurrent Stop Orders?

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

    Concurrent Stop Orders?

    I have found a response for NT6, but have found found an answer for NT7:

    How do I have concurrent stop orders without NT ignoring the second order? For example, I have to invoke a long stop order and a short stop order. Eventually only one will be filled:

    if (BooleanFlag)
    {
    EnterLongStop(price + offset);
    EnterShortStop(price - offset);
    }|

    When I run something similar in NT7, the second stop order is ignored. In this case, the strategy only generates long stop orders. How do I do both?

    #2
    Hello Serac,
    Thanks for your post and I am happy to assist you.

    You can place a buystop and a sell stop at the same time using the Unmanaged approach http://www.ninjatrader.com/support/h...d_approach.htm

    You can also mark the orders as oco, so that if one gets filled the other will get cancelled. A basic code would look like

    Code:
    SubmitOrder(0,OrderAction.Buy,OrderType.Stop, 1, 0, Close[0] + 10 * TickSize, "EntryStopOCO", "BuyStopEntry" );
    
    SubmitOrder(0, OrderAction.Sell, OrderType.Stop, 1, 0, Close[0] - 10 * TickSize, "EntryStopOCO", "SellStopEntry");
    But please do ensure your broker too accepts buystop and sell stop order at the same time.

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      I know this is an old thread, but shouldn't the 2nd call to SubmitOrder() be using OrderAction.SellShort?

      Comment


        #4
        Hello,

        That is correct. SellShort would be appropriate for an entry, and Sell would be appropriate for an exit.
        Dave I.NinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Shansen, 08-30-2019, 10:18 PM
        24 responses
        939 views
        0 likes
        Last Post spwizard  
        Started by Max238, Today, 01:28 AM
        0 responses
        7 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by rocketman7, Today, 01:00 AM
        0 responses
        4 views
        0 likes
        Last Post rocketman7  
        Started by wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        28 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 02-22-2024, 01:11 AM
        5 responses
        33 views
        0 likes
        Last Post wzgy0920  
        Working...
        X