Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Two Limit orders at the same time

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

    Two Limit orders at the same time

    I'm sending two limit orders at the same time:

    mySellLimitOrder =EnterShortLimit(0, true,1, Strategy().qqSell[1], "SellLimit");
    myBuyLimitOrder =EnterLongLimit(0, true,1, Strategy().qqBuy[1], "BuyLimit");

    But only the first one will be executed and visible as "working" order. In this case the SellLimit. If I change the order only the EnterLongLimit order will be send out.

    In the trace window both orders appear. In the Log file only the first order appears.
    No error message.

    Thanks Frank
    Last edited by starcd; 09-07-2011, 05:02 AM.

    #2
    Frank, this is in the managed order submission mode, correct?

    In this case you would run into the internal order handling rules with submitting / attempting to submit both of those orders - it would become visible once you run your strategy with TraceOrders enabled :



    For the order handling rules of the managed approach please review the last section here :

    Comment


      #3
      Hello Bertrand,

      both order appear in the trace, but only the first one appear in the order log.

      07.09.2011 12:14:39 Entered internal PlaceOrder() method at 07.09.2011 12:14:39: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=1175,25 StopPrice=0 SignalName='SellLimit' FromEntrySignal=''

      07.09.2011 12:14:39 Entered internal PlaceOrder() method at 07.09.2011 12:14:39: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=1172,75 StopPrice=0 SignalName='BuyLimit' FromEntrySignal=''

      Comment


        #4
        What entry handling are you using here to submit those orders?



        With unique they should both be attempted to be placed.

        Comment


          #5
          Hello Bertrand,

          I tried with the entry handling in code and strategy parameters.

          It still places only the first order.

          I'm trying this code with the ES mini.


          // This namespace holds all strategies and is required. Do not change it.
          namespace NinjaTrader.Strategy
          {
          /// <summary>
          /// Enter the description of your strategy here
          /// </summary>
          [Description("Enter the description of your strategy here")]
          public class Test : Strategy
          {
          #region Variables
          // Wizard generated variables
          private int myInput0 = 1; // Default setting for MyInput0
          // User defined variables (add any user defined variables below)
          #endregion

          /// <summary>
          /// This method is used to configure the strategy and is called once before any strategy method is called.
          /// </summary>
          protected override void Initialize()
          {
          CalculateOnBarClose = false;
          EntriesPerDirection = 10000;
          EntryHandling = EntryHandling.AllEntries;
          }

          /// <summary>
          /// Called on each bar update event (incoming tick)
          /// </summary>
          protected override void OnBarUpdate()
          {


          EnterShortLimit(0, true,1, 1220, "SellLimit");
          EnterLongLimit(0, true,1, 1191, "BuyLimit");

          }

          #region Properties
          [Description("")]
          [GridCategory("Parameters")]
          public int MyInput0
          {
          get { return myInput0; }
          set { myInput0 = Math.Max(1, value); }
          }
          #endregion
          }
          }

          Comment


            #6
            Correct, this would be unfortunately expected since you run into the order handling rules of the managed approach here, with TraceOrders added you see such a statement in your output window :

            **NT** An Enter() method to submit an entry order at '8/28/2011 11:15:00 PM' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.

            For submitting this entry bracket please work in the unmanaged mode NT7 offers :

            Comment


              #7
              Bertrand,

              that did the trick!

              Thanks

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              633 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              364 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              105 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              567 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              568 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X