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 Vietanhnguyen2hotmailcom, Yesterday, 10:29 AM
        4 responses
        23 views
        0 likes
        Last Post Vietanhnguyen2hotmailcom  
        Started by PhillT, 04-19-2024, 02:16 PM
        4 responses
        35 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Started by ageeholdings, 05-01-2024, 05:22 AM
        5 responses
        37 views
        0 likes
        Last Post ageeholdings  
        Started by reynoldsn, Today, 02:34 PM
        0 responses
        14 views
        0 likes
        Last Post reynoldsn  
        Started by nightstalker, Today, 02:05 PM
        0 responses
        23 views
        0 likes
        Last Post nightstalker  
        Working...
        X