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