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

PendingSubmit

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

    PendingSubmit

    I'm getting the "PendingSubmit" status for stop orders on strategies that are trading live through TDA. And, while the EnterLong(), EnterShort() orders are going through without issue, the

    SetStopLoss(
    "", CalculationMode.Percent, StopLoss, false);

    orders are in fact not being submitted.

    The same strategy running on the same instrument at the same time on simulation shows the stop order as "Accepted".

    What's the problem?

    #2
    Please check your Control Center logs for any messages.

    In your strategy please add TraceOrders = true into Initialize() and look for any messages as well.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh,

      This is an example of the log messages:

      7/27/2009 10:18:01 AM|1|32|Order='NT-2/XXXXXXXXX' Name='Buy' New State=PendingSubmit Instrument='KBE' Action=Buy Limit price=0 Stop price=0 Quantity=10 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
      7/27/2009 10:18:02 AM|1|32|Order='5337280798/XXXXXXXXXName='Buy' New State=Accepted Instrument='KBE' Action=Buy Limit price=0 Stop price=0 Quantity=10 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
      7/27/2009 10:18:02 AM|1|32|Order='5337280798/XXXXXXXXXName='Buy' New State=Working Instrument='KBE' Action=Buy Limit price=0 Stop price=0 Quantity=10 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
      7/27/2009 10:18:05 AM|1|32|Order='5337280798/XXXXXXXXXName='Buy' New State=Filled Instrument='KBE' Action=Buy Limit price=0 Stop price=0 Quantity=10 Type=Market Filled=10 Fill price=18.7394 Error=NoError Native error=''
      7/27/2009 10:18:05 AM|1|16|Execution='5337281161' Instrument='KBE' Account=XXXXXXXXXExchange=Default Price=18.7394 Quantity=10 Market position=Long Operation=Insert Order='5337280798' Time='7/27/2009 10:18:05 AM'
      7/27/2009 10:18:05 AM|1|32|Order='dc7db86c09404fbbbc24521f4fd7e605/XXXXXXXXXName='Stop loss' New State=PendingSubmit Instrument='KBE' Action=Sell Limit price=0 Stop price=17.99 Quantity=10 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
      7/27/2009 10:18:05 AM|1|64|Instrument='KBE' Account=XXXXXXXXXAvg price=18.7394 Quantity=10 Market position=Long Operation=Insert Currency=UsDollar

      Thanks

      Comment


        #4
        And what does TraceOrders say about it? Are you only submitting the stop loss alone? I believe TDA does require you to submit a stop and a target together.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh,

          It will take me some time to get results from live trading the strategy with the TradeOrders command. In the meantime, can you be more specific in your question about whether I'm submitting the stop loss order alone? When you say "target" do you mean SetProfitTarget()?

          TDA certainly allows you to buy stock and place a stop market order without any additional orders.

          Thanks.

          Comment


            #6
            Yes with SetProfitTarget(). I believe it may need you to send both to achieve OCO on them as pairs.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Josh,

              Your suggestion to send a profit target along with the stop order did not work. When the strategy executed its exit order, the order was rejected with the error message [FONT='Calibri','sans-serif']'Your order(s) can't be placed. The total quantity of outstanding open sell order(s) exceeds the quantity you hold' [/FONT]and the strategy stopped.

              I believe what is happening is that when the strategy places the limit order it waits for the order to execute before sending the stop order, but it doesn't follow through leaving the the order status at "PendingSubmit".

              Here is the output from the latest attempt:

              7/31/2009 9:33:00 AM|1|32|Order='NT-1/'XXXXXXXXX' Name='Buy' New State=PendingSubmit Instrument='FAZ' Action=Buy Limit price=35.22 Stop price=0 Quantity=250 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
              7/31/2009 9:33:01 AM|1|32|Order='5357616677/'XXXXXXXXX' Name='Buy' New State=Accepted Instrument='FAZ' Action=Buy Limit price=35.22 Stop price=0 Quantity=250 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
              7/31/2009 9:33:01 AM|1|32|Order='5357616677/'XXXXXXXXX' Name='Buy' New State=Working Instrument='FAZ' Action=Buy Limit price=35.22 Stop price=0 Quantity=250 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
              7/31/2009 9:33:12 AM|1|32|Order='5357616677/'XXXXXXXXX' Name='Buy' New State=Filled Instrument='FAZ' Action=Buy Limit price=35.22 Stop price=0 Quantity=250 Type=Limit Filled=250 Fill price=35.22 Error=NoError Native error=''
              7/31/2009 9:33:12 AM|1|16|Execution='5357617971' Instrument='FAZ' Account='XXXXXXXXX' Exchange=Default Price=35.22 Quantity=50 Market position=Long Operation=Insert Order='5357616677' Time='7/31/2009 9:33:12 AM'
              7/31/2009 9:33:12 AM|1|16|Execution='5357617962' Instrument='FAZ' Account='XXXXXXXXX' Exchange=Default Price=35.22 Quantity=200 Market position=Long Operation=Insert Order='5357616677' Time='7/31/2009 9:33:12 AM'
              7/31/2009 9:33:12 AM|1|32|Order='315428ae6715422c8c216ea90ebfe8f5/'XXXXXXXXX' Name='Stop loss' New State=PendingSubmit Instrument='FAZ' Action=Sell Limit price=0 Stop price=32.4 Quantity=50 Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
              7/31/2009 9:33:12 AM|1|64|Instrument='FAZ' Account='XXXXXXXXX' Avg price=35.22 Quantity=250 Market position=Long Operation=Insert Currency=UsDollar

              Comment


                #8
                You need to submit them at the same time to achieve OCO pairing. Please use TraceOrders = true to see what your orders are doing.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Josh,

                  I am using "TraceOrders = true" per your first reply. What you never specified is what exactly happens when this command is inserted in the strategy. It may help things along if you would just assume we're all idiots and be more clear and specific than you might otherwise think necessary.

                  I assumed that that this command would place additional information in the log and / or trace files. I've sent an email to NT support to your attention in the subject line with the trace file output. It was too long to fit the 1000 character limit of the forum. If it's some other file's output that you need to diagnose this please let me know.

                  Thanks.

                  Comment


                    #10
                    TraceOrders output goes into the Output Window. Tools->Output Window
                    Josh P.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by lorem, 04-25-2024, 09:18 AM
                    18 responses
                    75 views
                    0 likes
                    Last Post lorem
                    by lorem
                     
                    Started by joselube001, 05-10-2024, 12:17 PM
                    4 responses
                    20 views
                    0 likes
                    Last Post NinjaTrader_Erick  
                    Started by DawnTreader, 05-08-2024, 05:58 PM
                    21 responses
                    81 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by doihaveto13, Today, 12:46 PM
                    2 responses
                    4 views
                    0 likes
                    Last Post doihaveto13  
                    Started by Vitamite, Today, 12:48 PM
                    1 response
                    9 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Working...
                    X