Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sequential Orders One Strategy -- 2nd Order not getting placed

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

    Sequential Orders One Strategy -- 2nd Order not getting placed

    I have a single strategy which fist places a Buy Limit order using submit order then a few lines later place a Sell Limit Order ...

    I Print(object.OrderStatus) and both are of the PendingSubmission Status...

    The first Buy Limit Order gets placed correctly and goes to the Working Status...

    The second Sell Limit Order never gets placed nor does it appear in the log that the attempt to place the order was made...

    Is there a delay or something between these orders I should to so that they both get place!?

    I'm lost on this once because the value of OrderStatus on both orders goes to Pending Submission...

    Thanks!!
    Chris

    #2
    Hi Chris,

    What is the TraceOrders output for the second order?


    If you're placing buy limit and sell limit orders at the same time with a managed order system, one of these orders will be ignored.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ryan! Thanks!

      The First order reads:
      2/28/2011 2:49:00 PM Entered internal SubmitOrder() method at 2/28/2011 2:49:00 PM: Action=Buy OrderType=Limit Quantity=1 LimitPrice=1321.50 StopPrice=0 OcoId='' Name='Buy Limit LowHigh8p'
      Order Placed g_BuyLimitLowHigh8ptOrder: Order='NT-00000/Replay101' Name='Buy Limit LowHigh8p' State=PendingSubmit Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Strategy='FurturesModel8PT' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='9c67b37474304ffc8e75fc5a85a4b40b' Gtd='12/1/2099 12:00:00 AM'


      The Second order reads:
      2/28/2011 2:49:00 PM Entered internal SubmitOrder() method at 2/28/2011 2:49:00 PM: Action=Sell OrderType=Limit Quantity=1 LimitPrice=1324.00 StopPrice=0 OcoId='' Name='Sell Limit HighLow8p'
      Order='NT-00001/Replay101' Name='Sell Limit HighLow8p' State=PendingSubmit Instrument='ES 03-11' Action=Sell Limit price=1324 Stop price=0 Quantity=1 Strategy='FurturesModel8PT' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='975e764363ae40508ce4c4e321be93b1' Gtd='12/1/2099 12:00:00 AM'

      This is from my OutputWindow

      Comment


        #4
        Is your market replay connection currently playing ? (not paused) Does the order state advance beyond that at all or give you any other output?
        Last edited by NinjaTrader_RyanM1; 02-28-2011, 04:58 PM.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          I don't see the second order in the tracelog file; I extracted the last section and pasted below:
          2011-02-28 17:40:42:049 (Market Replay Connection) Cbi.Connection.ProcessEventArgs.OrderStatusEventAr gs: Order='NT-00000/Replay101' Name='Buy Limit LowHigh8p' New state=Initialized Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
          2011-02-28 17:40:42:049 (Market Replay Connection) Cbi.Order.Update1: oldid='NT-00000' Order='NT-00000/Replay101' Name='Buy Limit LowHigh8p' New state=Initialized Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
          2011-02-28 17:40:42:049 (Market Replay Connection) Cbi.OrderStatusEventArgs.Process: Order='NT-00000/Replay101' Name='Buy Limit LowHigh8p' New state=Initialized Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
          2011-02-28 17:40:42:050 (Market Replay Connection) Cbi.Order.Submit: Order='NT-00000/Replay101' Name='Buy Limit LowHigh8p' State=Initialized Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Strategy='FurturesModel8PT' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='9c67b37474304ffc8e75fc5a85a4b40b' Gtd='12/1/2099 12:00:00 AM'
          2011-02-28 17:40:42:050 (Market Replay Connection) Cbi.Simulator.Submit: Order='NT-00000/Replay101' Name='Buy Limit LowHigh8p' State=Initialized Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Strategy='FurturesModel8PT' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='9c67b37474304ffc8e75fc5a85a4b40b' Gtd='12/1/2099 12:00:00 AM'
          2011-02-28 17:40:42:050 (Market Replay Connection) Cbi.Connection.ProcessEventArgs.OrderStatusEventAr gs: Order='9c67b37474304ffc8e75fc5a85a4b40b/Replay101' Name='Buy Limit LowHigh8p' New state=PendingSubmit Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
          2011-02-28 17:40:42:050 (Market Replay Connection) Cbi.Order.Update1: oldid='NT-00000' Order='9c67b37474304ffc8e75fc5a85a4b40b/Replay101' Name='Buy Limit LowHigh8p' New state=PendingSubmit Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
          2011-02-28 17:40:42:051 (Market Replay Connection) Cbi.OrderStatusEventArgs.Process: Order='9c67b37474304ffc8e75fc5a85a4b40b/Replay101' Name='Buy Limit LowHigh8p' New state=PendingSubmit Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
          2011-02-28 17:40:42:052 (Market Replay Connection) Cbi.Connection.ProcessEventArgs.OrderStatusEventAr gs: Order='9c67b37474304ffc8e75fc5a85a4b40b/Replay101' Name='Buy Limit LowHigh8p' New state=Accepted Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
          2011-02-28 17:40:42:052 (Market Replay Connection) Cbi.Order.Update1: oldid='9c67b37474304ffc8e75fc5a85a4b40b' Order='9c67b37474304ffc8e75fc5a85a4b40b/Replay101' Name='Buy Limit LowHigh8p' New state=Accepted Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
          2011-02-28 17:40:42:053 (Market Replay Connection) Cbi.OrderStatusEventArgs.Process: Order='9c67b37474304ffc8e75fc5a85a4b40b/Replay101' Name='Buy Limit LowHigh8p' New state=Accepted Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
          2011-02-28 17:40:42:054 (Market Replay Connection) Cbi.Connection.ProcessEventArgs.OrderStatusEventAr gs: Order='9c67b37474304ffc8e75fc5a85a4b40b/Replay101' Name='Buy Limit LowHigh8p' New state=Working Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
          2011-02-28 17:40:42:054 (Market Replay Connection) Cbi.Order.Update1: oldid='9c67b37474304ffc8e75fc5a85a4b40b' Order='9c67b37474304ffc8e75fc5a85a4b40b/Replay101' Name='Buy Limit LowHigh8p' New state=Working Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
          2011-02-28 17:40:42:054 (Market Replay Connection) Cbi.OrderStatusEventArgs.Process: Order='9c67b37474304ffc8e75fc5a85a4b40b/Replay101' Name='Buy Limit LowHigh8p' New state=Working Instrument='ES 03-11' Action=Buy Limit price=1321.5 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''

          Comment


            #6
            I'm not sure why it wouldn't submit the order. Do you have a simple code snippet I can use to see the issue here?
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Ryan,

              I simplified the code below:

              Code:
                          if(boolPlaceBuyLimit == true)
                          {
                              Print("LowHIgh Order Number to Place: " + g_OrderLowHigh8ptNumb.ToString());
                              drawRetracement(g_LowHighOrders, "LowHigh8p", g_OrderLowHigh8ptNumb);
                              placeBuyLimit(g_LowHighOrders[g_OrderLowHigh8ptNumb], "LowHigh8p", 0 );
                              g_OrderLowHigh8ptNumb++;
                          }
              
                 
                          if(boolPlaceSellLimit == true)
                          {
                              Print("HighLow Order Number to Place: " + g_OrderHighLow8ptNumb.ToString());
                              drawRetracement(g_HighLowOrders, "HighLow8p", g_OrderHighLow8ptNumb);
                              placeSellLimit(g_HighLowOrders[g_OrderHighLow8ptNumb], "HighLow8p", 0);
                              g_OrderHighLow8ptNumb++;
                          }
              The actual call to submit the order:
              Code:
               g_BuyLimitHighLow8ptOrder = SubmitOrder(0,OrderAction.Buy, OrderType.Limit, g_NumOfContracts, orderToBuyLimit, 0, "", "Buy Limit HighLow8p");
              I tried to simplify the code above; please let me know what you think...

              Comment


                #8
                Do you have a second SubmitOrder() statement? You need one also for the sell side.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Sorry forgot to include it in my last post

                  g_SellLimitHighLow8ptOrder = SubmitOrder(0, OrderAction.Sell, OrderType.Limit, g_NumOfContracts, orderToSellLimit, 0, "", "Sell Limit HighLow8p");

                  Comment


                    #10
                    I was not able to track down why this isn't submitting the second order. I'm missing the link between your bool flags and the actual SubmitOrder().

                    You should further simplify your strategy to track down what is happening. Attached is a simple strategy that submits two opposing limit orders. This is the level of simplicity you should aim for and only add layers of complexity once it works as you expect.
                    Attached Files
                    Ryan M.NinjaTrader Customer Service

                    Comment


                      #11
                      Ryan,
                      It's pretty obvious that it's not the if statement because the following is in the trace file.. The NT trace reads "Entered internal SubmitOrder() method at 3/1/2011 10:50:00 AM:" is proof the my strategy did call the SumbitOrder()...

                      3/1/2011 10:50:00 AM Entered internal SubmitOrder() method at 3/1/2011 10:50:00 AM: Action=Sell OrderType=Limit Quantity=1 LimitPrice=1322.25 StopPrice=0 OcoId='' Name='Sell Limit HighLow8p'
                      Any thoughts?

                      Comment


                        #12
                        I understand but need a complete and simplified script I can use to reproduce what you're seeing. If this is not available, then start from the simple script I provided and add complexity, verifying behavior at each step. Let us know if you reach a point where that script also shows the same issue.
                        Ryan M.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by funk10101, Today, 09:43 PM
                        0 responses
                        3 views
                        0 likes
                        Last Post funk10101  
                        Started by pkefal, 04-11-2024, 07:39 AM
                        11 responses
                        36 views
                        0 likes
                        Last Post jeronymite  
                        Started by bill2023, Yesterday, 08:51 AM
                        8 responses
                        44 views
                        0 likes
                        Last Post bill2023  
                        Started by yertle, Today, 08:38 AM
                        6 responses
                        26 views
                        0 likes
                        Last Post ryjoga
                        by ryjoga
                         
                        Started by algospoke, Yesterday, 06:40 PM
                        2 responses
                        24 views
                        0 likes
                        Last Post algospoke  
                        Working...
                        X