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

Reason for cancel submitted

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

    Reason for cancel submitted

    Hi,

    A set of orders got canceled and I can't tell the reason why. The log is as follows:

    2020-08-26 08:29:52:696|1|32|Order='6d190da7f526407bb57cf6737 6238ab2/Sim101' Name='Long1' New state='Accepted' Instrument='CL 10-20' Action='Buy' Limit price=43.34 Stop price=0 Quantity=2 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-26 08:29:52:696|1|32|Order='6d190da7f526407bb57cf6737 6238ab2/Sim101' Name='Long1' New state='Cancel submitted' Instrument='CL 10-20' Action='Buy' Limit price=43.34 Stop price=0 Quantity=2 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-26 08:29:52:698|1|32|Order='6d190da7f526407bb57cf6737 6238ab2/Sim101' Name='Long1' New state='Working' Instrument='CL 10-20' Action='Buy' Limit price=43.34 Stop price=0 Quantity=2 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-26 08:29:52:732|1|32|Order='dcd8816844a44df4a9bea3c55 9bc6c3a/Sim101' Name='Long2' New state='Accepted' Instrument='CL 10-20' Action='Buy' Limit price=43.34 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-26 08:29:52:732|1|32|Order='dcd8816844a44df4a9bea3c55 9bc6c3a/Sim101' Name='Long2' New state='Cancel submitted' Instrument='CL 10-20' Action='Buy' Limit price=43.34 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-26 08:29:52:732|1|32|Order='dcd8816844a44df4a9bea3c55 9bc6c3a/Sim101' Name='Long2' New state='Working' Instrument='CL 10-20' Action='Buy' Limit price=43.34 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-26 08:29:52:767|1|32|Order='e837562f35a14ac9a1402c54b 212d8fe/Sim101' Name='Long3' New state='Accepted' Instrument='CL 10-20' Action='Buy' Limit price=43.34 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-26 08:29:52:767|1|32|Order='e837562f35a14ac9a1402c54b 212d8fe/Sim101' Name='Long3' New state='Cancel submitted' Instrument='CL 10-20' Action='Buy' Limit price=43.34 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-26 08:29:52:768|1|32|Order='e837562f35a14ac9a1402c54b 212d8fe/Sim101' Name='Long3' New state='Working' Instrument='CL 10-20' Action='Buy' Limit price=43.34 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-26 08:29:52:826|1|32|Order='6d190da7f526407bb57cf6737 6238ab2/Sim101' Name='Long1' New state='Cancelled' Instrument='CL 10-20' Action='Buy' Limit price=43.34 Stop price=0 Quantity=2 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-26 08:29:52:856|1|32|Order='dcd8816844a44df4a9bea3c55 9bc6c3a/Sim101' Name='Long2' New state='Cancelled' Instrument='CL 10-20' Action='Buy' Limit price=43.34 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
    2020-08-26 08:29:52:893|1|32|Order='e837562f35a14ac9a1402c54b 212d8fe/Sim101' Name='Long3' New state='Cancelled' Instrument='CL 10-20' Action='Buy' Limit price=43.34 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''

    What might cause this? It shows no particular error. These are unmanaged orders.

    Thanks.

    #2
    Hello silverm3170, thanks for your post.

    Please turn on TraceOrders in the strategy. That should print out the reason for the cancelation to the NinjaScript output window. Also, consider adding a Print before the order submission to ensure the price is correct.

    I look forward to assisting.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Three LONG entry LIMIT orders were submitted, either manually or automated.
      Named, LONG1, LONG2, and LONG3.
      Each order was entered at same price 43.34 on CL, in Sim101 acct.

      The orders were all entered at the same time.
      They were all immediately canceled after they were submitted.
      I would suspect they were canceled the same way they were submitted.
      So your answer is: either manually or automated.

      If you have active entry orders, pressing the 'Close' button in Chart Trader
      cancels the entry orders, even if they were submitted via strategy.


      Comment


        #4
        TraceOrders is already true. Does it output more info to the output window than what's in the log file?

        Comment


          #5
          Hello silverm3170, thanks for your reply.

          Yes, it will. TraceOrders should give you a more detailed reason for the order cancelation.
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by silverm3170 View Post
            These are unmanaged orders.
            I presume this is happening in a strategy that you coded.
            Your strategy is cancelling each order soon after submission.
            I suspect you don't want this, so there must be a bug in your code.

            Have you tried sprinkling a few Prints around key places in your code?

            Those Prints, combined with TradeOrders=True, make the output window
            an invaluable resource for you ... the interspersing of the output makes it
            even better than the log file.

            Last edited by bltdavid; 08-26-2020, 10:39 AM. Reason: fix typo

            Comment


              #7
              Hi bltdavid,

              Yes they were automated. I didn't interfere with the strategy or take any explicit action to cancel the order.

              Thanks.

              Comment


                #8
                Do you call CancelOrder inside your strategy code?

                Comment


                  #9
                  Yes I do call CancelOrder. The strategy places orders successfully most of the time and this sort of error is rare. I forgot I was calling this; I'll put Print statements to see if these are responsible. Thanks.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by TradeForge, Today, 02:09 AM
                  0 responses
                  0 views
                  0 likes
                  Last Post TradeForge  
                  Started by Waxavi, Today, 02:00 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post Waxavi
                  by Waxavi
                   
                  Started by elirion, Today, 01:36 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post elirion
                  by elirion
                   
                  Started by gentlebenthebear, Today, 01:30 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post gentlebenthebear  
                  Started by samish18, Yesterday, 08:31 AM
                  2 responses
                  9 views
                  0 likes
                  Last Post elirion
                  by elirion
                   
                  Working...
                  X