Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

why was this order getting ignored

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

    why was this order getting ignored

    i had a trailing stop order that i cancelled. i am now reissuing the cancel order but it keeps getting ignored. why?

    2009-05-11 10:07:57 AM Ignored PlaceOrder() method: Action=Sell OrderType=Stop Quantity=2 LimitPrice=0 StopPrice=8419 SignalName=TRAIL_STOP' FromEntrySignal='' Reason='There already is a matching, terminal exit order in place'

    World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


    as you can see from teh screenshot of the control center, this orginal order got cancelled.
    Code:
     
    [SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// look for 1 ATR profit
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ((take1ATRProfits) && (currentProfitVariable >= ATRValue))
    {
    CancelOrder(exitOrder);
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]switch[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]Position[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].MarketPosition)
    {
     
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]MarketPosition[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].Long:
    ExitOrderPosition1 = ExitLong(0,position1Quantity, [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"1_ATR_PROFIT_TARGETS"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], entryOrder.FromEntrySignal);
    
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]break[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]MarketPosition[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].Short:
    
    ExitOrderPosition1 = ExitShort(0,position1Quantity, [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"1_ATR_PROFIT_TARGETS"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], entryOrder.FromEntrySignal);
    
     
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]break[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
    }
     
     
    
    take1ATRProfits = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
    
    }
    [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// set 1 ATR trailing stop.
     
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] currentStop;
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] trailstopVolume = (ExitOrderPosition1 == [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ? entryOrder.Filled : entryOrder.Filled - ExitOrderPosition1.Quantity);
    Print([/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"trailstopVolume"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + trailstopVolume + [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]" ExitOrderPosition1 "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + ExitOrderPosition1 + [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]" Position.Quantity "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]Position[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].Quantity);
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (trailstopVolume > 0)
    {
    spread = [/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]Math[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].Abs(GetCurrentAsk() - GetCurrentBid()) ;
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]switch[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (tradedirection)
    {
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]Direction[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].Long:
    currentStop = highestHigh - ATRValue - spread ;
    Print([/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]" highestHigh "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + highestHigh + [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]" ATRValue "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + ATRValue + [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]" spread "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + spread);
    
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]((exitOrder == [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])){
    exitOrder = ExitLongStop(0,[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],trailstopVolume, currentStop, [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"TRAIL_STOP"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],entryOrder.FromEntrySignal);
    }
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]else
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]{ 
    
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ((exitOrder.OrderState == [/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]OrderState[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].Cancelled) || (currentStop != exitOrder.StopPrice) )
    {
    [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// create the exit stop for first time
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]exitOrder = ExitLongStop(0,[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],trailstopVolume, currentStop, [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"TRAIL_STOP"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],entryOrder.FromEntrySignal);
    [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// exitOrder = ExitLongStop(entryOrder.Filled, currentStop, SIGNALZLREXIT_TRAIL + trailStopPercent + "%", entryOrder.FromEntrySignal);
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]}
    }
    
    [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//else if (currentStop != exitOrder.StopPrice)
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//{
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// // fire it as it changes.
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// exitOrder = ExitLongStop(trailstopVolume, currentStop, "TRAIL_STOP", entryOrder.FromEntrySignal);
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//}
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]break[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]Direction[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].Short:
    Print([/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]" lowestLow"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + lowestLow + [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]" ATRValue "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + ATRValue + [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]" spread "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + spread);
    currentStop = lowestLow + ATRValue + spread ;
    [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// if ((exitOrder == null) || (currentStop != exitOrder.StopPrice))
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ((exitOrder == [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) )
    {
    [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// create the exit stop for first time
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]exitOrder = ExitShortStop(0, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], trailstopVolume, currentStop, [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"TRAIL_STOP"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],entryOrder.FromEntrySignal);
    }
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]else
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]{
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]((exitOrder.OrderState == [/SIZE][SIZE=2][COLOR=#008080][SIZE=2][COLOR=#008080]OrderState[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].Cancelled) ||(currentStop != exitOrder.StopPrice) ){
    exitOrder = ExitShortStop(0, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], trailstopVolume, currentStop, [/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"TRAIL_STOP"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],entryOrder.FromEntrySignal);
    }
    
    
    }
    
    [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//else if (currentStop != exitOrder.StopPrice)
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//{
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// // fire it as it changes.
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]// exitOrder = ExitShortStop(entryOrder.Filled, lowestLow + MFEProfit * trailStopPercent / 100, SIGNALZLREXIT_TRAIL, entryOrder.FromEntrySignal);
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//}
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]break[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];
     
    }
     
    }
     
     
    }
    [/SIZE]

    #2
    Known bug. Once you cancel you cannot resubmit at a later point in time.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      so what is my work around?
      Why dont you keep a list of bugs somewhere that i can refer to. why do i have to keep wasting my time debugging your known bugs.

      Comment


        #4
        Workaround is to not do it. If you know you want to resubmit at a later point in time just keep the order active. Modify it to a price that won't fill and only cancel when you are 100% sure you want the stop gone permanently.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          what happens if i cancel order and then set exitorder=null and reuse the object to send the cancel again.

          Comment


            #6
            Unfortunately won't work.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              what is your priority on fixing this bug.

              Comment


                #8
                junkone,

                As you may imagine this is a very sensitive area of code. We are looking to address it as soon as possible.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  is the cancel prob due to the Iorder signal name that is used. i could easily create a new signalname if needed.

                  Comment


                    #10
                    No, it has nothing to do with IOrders. There is nothing on your end you can do to address this except to not cancel an order you may wish to resubmit at a later point in time.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      does it affect orders that get auto cancelled at the end of the bar because i use liveUntilCancelled=false

                      Comment


                        #12
                        Hello,

                        I will have Josh respond to this on Monday.
                        DenNinjaTrader Customer Service

                        Comment


                          #13
                          Yes, if the order expires from non-resubmission to keep it alive, you will experience the same behavior. The issue is with internal handling of the order and will be addressed in a later version.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            this is a very serious bug then. i would have expected you to get a resolution in terms of hours and not days and weeks.
                            i had originally allowed my subscription to expire so that i can fully automate my strategy and start using NT. Now this is causing me to take a double take on whether i should use NT at all.
                            Makes me wonder that with a serous bug like that, if anyone is using NT for real trading at all.
                            the workaround that you propose is a nasty and unacceptable one. setting price to something out of reach.

                            finally, i am asking this question again.why dont you list all the known bugs so that i know what works in NT and what does not.

                            Comment


                              #15
                              junkone,

                              There are many implications in trying to fix anything related to order management and this requires full testing to the highest degree. I have already provided you a workaround that has no adverse implications so I am closing this case now.

                              There is no concentrated external bug list.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              648 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              369 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              108 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              573 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              575 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X