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

How to find the reason of Working order cancelling?

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

    How to find the reason of Working order cancelling?

    Once in a while, i have logs:

    Bar CloseTime: 01:00:00.000 22-Jan-2020 [ BarN: 1559; O:37.45 H:37.62 L:37.45 C:37.61 ]
    ----------------------------
    orderId='x' account='Sim101' name='buy1' orderState=Submitted instrument='abc' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=100 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-01-22 01:00:00' gtd='2099-12-01' statementDate='2020-07-25'
    orderId='x' account='Sim101' name='buy1' orderState=Accepted instrument='abc' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=100 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-01-22 01:00:00' gtd='2099-12-01' statementDate='2020-07-25'
    orderId='x' account='Sim101' name='buy1' orderState=Working instrument='abc' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=100 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-01-22 01:00:00' gtd='2099-12-01' statementDate='2020-07-25'
    orderId='x' account='Sim101' name='buy1' orderState=CancelPending instrument='abc' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=100 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-01-22 01:00:00' gtd='2099-12-01' statementDate='2020-07-25'
    orderId='x' account='Sim101' name='buy1' orderState=CancelSubmitted instrument='abc' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=100 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-01-22 01:00:00' gtd='2099-12-01' statementDate='2020-07-25'
    orderId='x' account='Sim101' name='buy1' orderState=Cancelled instrument='abc' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=100 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-01-22 01:00:00' gtd='2099-12-01' statementDate='2020-07-25'
    __

    so, after state WORKING it suddenly goes into CancelPending.

    how/where we can find the reason (or any details) about that ?

    #2
    Hello ttodua,

    An order is cancelled if CancelOrder() is called, if isLiveUntilCancelled is not used or is false and the submission bar closes, or if the order is being cancelled due managed approach order handling such as the position entered by the entry being closed.

    Enable TraceOrders to see if the order is being automatically cancelled.

    Below is a link to a forum post that demonstrates using prints and TraceOrders to understand behavior.


    Are you seeing the order submission information from TraceOrders?
    Do you see any messages from TraceOrders when the order is cancelled?

    Are you submitting the order with isLiveUntilCancelled as true?

    Is CancelOrder() called anywhere in the script?


    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks, TraceOrders showed the reasons !
      However, as another question ,opened a separate question - https://ninjatrader.com/support/foru...ch-such-events

      Comment


        #4
        Hello ttodua,

        I'll assist Chris with any questions he is unable to answer in your other thread.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          ChelseaB, what Chris answered is not solution for me, even though he can't do more. If you can help, help might be if you have a bit more programming knowledge how to achieve what i ask there. So, maybe you know some "unsupported" code that might do what i ask there?

          thanks.

          Comment


            #6
            Hello ttodua,

            Let Chris know his solution is not suitable and why. I'll work with him to clarify the issue and offer any resources we are able.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by TradeForge, 04-19-2024, 02:09 AM
            2 responses
            28 views
            0 likes
            Last Post TradeForge  
            Started by aprilfool, 12-03-2022, 03:01 PM
            3 responses
            327 views
            0 likes
            Last Post NinjaTrader_Adrian  
            Started by giulyko00, Today, 12:03 PM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by f.saeidi, Today, 12:14 PM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by AnnBarnes, Today, 12:17 PM
            1 response
            2 views
            0 likes
            Last Post NinjaTrader_Zachary  
            Working...
            X