Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

"Unable to match order state to execution"

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

    #16
    I realized I just totally over-looked a consequence of this issue. Glad you warned me about OnOrderUpdate(). I place a ExitOrder for the full quantity as soon as the buyorder fills... and of course, the ExitOrder would be rejected for not having the right quantity.

    I didn't think of the possibility because my buy's so far today have been (fortunately) all single fills. Time to get going on that revised code immediately.

    By the way, any prospect of patching the adapter to TDA? The API guys at TDAmeritrade = Jerry @ Quotetracker, and very responsive with support. I think I know how to get around it, but it would obviously be cleaner if the adapter was fixed.

    Originally posted by NinjaTrader_Ray View Post
    Depending on what the Alert message shows, if its an rejected order, the strategy will terminate immediately, if its some warning then there is the possibility that you can get an unwanted number of message boxes although I don't ever recall a situation where anyone has raised an issue due to an offensive number of message boxes. At this time, these boxes can't be surpressed.
    I have RealTimeErrorHandling set to take no action. It definitely didn't terminate this morning when the error happened... which is good for me.

    Comment


      #17
      Unfortunately there is nothing we can do at this time. We will make a note of it for future considerations.
      Josh P.NinjaTrader Customer Service

      Comment


        #18
        Same issue with IB

        Hi Josh.

        I just went Live and have the same issue with IB. Error occurs on partial fills only and not if completely filled. You mentioned this was fixed for IB, do I need to download a specific version - Currently using the latest NT and TWS 887 downloaded from your site. There doesn't seem to be any hiccup yet in actual position sizes, i.e. correct entry size and correct exit size. I do get a skipped OnExecution usually on the last partial fill as my O/P window doesn't update.

        Please advise...
        Last edited by moneybags; 03-06-2009, 10:25 PM.

        Comment


          #19
          This is my orderupdate:
          Code:
          [FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] OnOrderUpdate(IOrder order) [/SIZE][/FONT]
          [SIZE=2][FONT=Courier New]{ [/FONT][/SIZE]
          [FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] (EntryOrder != [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] && EntryOrder.Token == order.Token) [/SIZE][/FONT]
          [SIZE=2][FONT=Courier New]{ [/FONT][/SIZE]
          [FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] (order.OrderState == OrderState.Cancelled) [/SIZE][/FONT]
          [SIZE=2][FONT=Courier New]{ [/FONT][/SIZE]
          [FONT=Courier New][SIZE=2][COLOR=#008000]// Do something here [/COLOR][/SIZE][/FONT]
          [FONT=Courier New][SIZE=2]EntryOrder = [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]; [/SIZE][/FONT]
          [SIZE=2][FONT=Courier New]} [/FONT][/SIZE]
          [SIZE=2][FONT=Courier New]} [/FONT][/SIZE]
          [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]

          And this is my OnExecution:
          Code:
          [FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] OnExecution(IExecution execution)[/SIZE][/FONT]
          [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
          [FONT=Courier New][SIZE=2][COLOR=#008000]/* We advise monitoring OnExecution to trigger submission of stop/target orders instead of OnOrderUpdate() since OnExecution() is called after OnOrderUpdate()[/COLOR][/SIZE][/FONT]
          [SIZE=2][FONT=Courier New][COLOR=#008000]which ensures your strategy has received the execution which is used for internal signal tracking. */[/COLOR][/FONT][/SIZE]
          [FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] (EntryOrder != [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] && EntryOrder.Token == execution.Order.Token)[/SIZE][/FONT]
          [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
          [FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] (execution.Order.OrderState == OrderState.Filled)[/SIZE][/FONT]
          [SIZE=2][FONT=Courier New]{ [/FONT][/SIZE]
          [FONT=Courier New][SIZE=2][COLOR=#008000]// Resets the entryOrder object to null after the order has been fully filled[/COLOR][/SIZE][/FONT]
          [FONT=Courier New][SIZE=2]EntryOrder = [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
          [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
          [FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] ( (execution.Order.OrderState == OrderState.Filled) ||[/SIZE][/FONT]
          [SIZE=2][FONT=Courier New](execution.Order.OrderState == OrderState.PartFilled) )[/FONT][/SIZE]
          [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
          [SIZE=2][FONT=Courier New]Print(Instrument.FullName + [/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800000]": "[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] + execution.Order.OrderState.ToString() + [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]": Entry QTY: "[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] + Position.Quantity + [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]" of "[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] + execution.Order.Quantity); [/SIZE][/FONT]
          [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
           
          [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
          [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]

          As you can see, fairly simple. My stops are called in the main routine. I need OnOrderUpdate to nullify EntryOrder

          Comment


            #20
            moneybags,

            We are unaware of a fix from IB yet.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by andrewtrades, Today, 04:57 PM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            3 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            6 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            19 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X