Announcement

Collapse
No announcement yet.

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 Mindset, 04-21-2026, 06:46 AM
            0 responses
            90 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            137 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            68 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            120 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            72 views
            0 likes
            Last Post PaulMohn  
            Working...
            X