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 NullPointStrategies, Today, 05:17 AM
            0 responses
            44 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            124 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            65 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            42 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            46 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X