Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 “Working” LMT Orders NOT Accessible when carried into New Session

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

    NT8 “Working” LMT Orders NOT Accessible when carried into New Session

    Hello Support

    I’m converting a strategy from NT7 to NT8.

    The strategy being converted does not “Exit on session close” and it uses NT Managed approach with LMT orders to trade. It also calculates “OnBarClose”, Period=240 minutes, “Break at EOD = true”

    I found that if a LMT order is in “working” state when the days trading session ends, that same order is still in “working” state at the opening of the next session, BUT it can’t be “Cancelled” or amended.

    So, I’ve created and uploaded a simple prototype modeled after SampleMACrossOver that reproduces the error for you to see.

    I’ve uploaded a screen scrape “System Analyzer with Prototype” showing how to run the prototype using System Analyzer and a text file of NT8 order TRACE

    The prototype simply cancels any previous LMT order and submits a new LMT on every bar.

    If you run the script with “Exit on Session Close” = true, the script runs without trade errors.

    If you run the script with “Exit on Session Close” = false, the script produces errors like:

    “3/3/2017 10:00:00 AM Strategy 'MyCustomStrategy99/-1': Ignored SubmitOrderManaged() method at …. Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'”

    It should not produce this error since there is only 1 order per bar, any previous order is first cancelled before another order is submitted, and the order being cancelled is in “working” state.

    The reason it gets this error is NT8 ignored “CancelOrder(pendingEntryOrder);” for bar “3/3/2017 10:00:00 AM”. The trace should show something like

    “'MyCustomStrategy99/-1': Cancelled custom managed order:….”

    like it does for all previous bars. The strategy then goes on the try an cancel the order again and again for the remaining bars of the chart, producing the same error over and over on the TRACE.

    My experience has been that “CancelOrder(Order order)” is ignored by NT8 if the “order” given to the command does not exist. That makes sense.

    BUT, this is not the case within the script. The order object within the script is assigned with the OnOrderUpdate event for any state but “FILLED” and set to null if it is filled.

    Can you please have a look and let me know why LMT orders can’t be canceled or amended when trading “Exit on session close” = False.

    Thank you
    Attached Files

    #2
    Hello rayko,

    May I confirm you script has been written to prevent new orders after the exit on close time has occurred?

    Below I am providing a link to a forum post where I have demonstrated the Exit on close to be working correctly with logic that prevents new orders after the Exit on close and one without logic that prevents new orders after the exit on close.
    https://ninjatrader.com/support/foru...058#post516058

    If you test the script I have created following the steps in the video, are you experiencing different behavior?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea

      I'll explain below.

      When you run the script with “Exit On Session Close” set to OFF or FALSE. The script produces trading errors because NT8 ignored “CancelOrder(pendingEntryOrder);” for bar “3/3/2017 10:00:00 AM”.

      Look into the Trace Log I uploaded and you’ll see

      This entry shows LMT order to Sell @ 52.98

      3/3/2017 6:00:00 AM: NEW BAR with MarketPostion=Flat
      3/3/2017 6:00:00 AM Strategy 'MyCustomStrategy99/-1': Entered internal SubmitOrderManaged() method at 3/3/2017 6:00:00 AM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=52.98 StopPrice=0 SignalName='Short' FromEntrySignal=''


      But on the next bar you'll see NT8 ignored the CancelOrder() method, and therefore produced trading errors for the rest of the script.

      3/3/2017 10:00:00 AM: NEW BAR with MarketPostion=Flat
      3/3/2017 10:00:00 AM Strategy 'MyCustomStrategy99/-1': Entered internal SubmitOrderManaged() method at 3/3/2017 10:00:00 AM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=53.14 StopPrice=0 SignalName='Short' FromEntrySignal=''
      3/3/2017 10:00:00 AM Strategy 'MyCustomStrategy99/-1': Ignored SubmitOrderManaged() method at 3/3/2017 10:00:00 AM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=53.14 StopPrice=0 SignalName='Short' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'

      The order object provided to CancelOrder() is correct but NT8 incorrectly ignored the CancelOrder() and left the order in the system. This caused all the trading errors to occur after that.

      The trading strategy I’m converting, trades with “Exit on Session Close” to be false. It gets these errors in NT8 and not nt7.

      I created this script for NT support to investigate the issue and provide me with an explanation as to why LMT orders can’t be canceled or amended when trading “Exit on session close” = False in this script example.

      Please let me know

      Thank you

      Comment


        #4
        Hello rayko,

        To confirm, you are certain the order is not being resubmitted after the exit on close because you have written explicit instructions in your script not to do so, is this correct?

        (Otherwise this behavior would be expected)

        Do you have a print in your script to show that the CancelOrder() method is being called in the script? (meaning a print is appearing that is placed below the CancelOrder() line?)

        Do you have prints in OnOrderUpdate to show the Cancellation is pending but never becomes cancelled?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello Chelsea

          I've upload 2 GIFs of the Trace Log I've uploaded previously. The GIFs highlight the submit of LMT orders BLUE and CancelOrder() in BROWN. Note, use the line# on the left side of the GIFs for chronological sequencing.

          To confirm, you are certain the order is not being resubmitted after the exit on close because you have written explicit instructions in your script not to do so, is this correct?
          Yes. Looking at the log I’ve uploaded previously and these Highlited GIFS, the trace shows 1 working LMT order is cancelled and a new one is submitted for each bar.

          Do you have a print in your script to show that the CancelOrder() method is being called in the script? (meaning a print is appearing that is placed below the CancelOrder() line?)
          Yes. See attached GIFS. LMT order BLUE and CancelOrder() in BROWN

          Do you have prints in OnOrderUpdate to show the Cancellation is pending but never becomes cancelled?
          Yes. See attached GIFS, you see at:

          3/3/2017 02:00:00 PM (BROWN) working Sell LMT @53.51 order is Cancelled
          3/2/2017 02:00:00 PM (BLUE) Sell LMT @53.30 order is Submitted

          3/2/2017 05:00:00 PM (BROWN) working Sell LMT @53.30 order is Cancelled
          3/2/2017 05:00:00 PM (BLUE) Sell LMT @52.77 order is Submitted

          3/2/2017 10:00:00 PM ... CancelOrder() ignored ... (Order provided NT8 is valid and should not of been ignored)
          3/2/2017 10:00:00 PM (BLUE) Sell LMT @52.85 order is Submitted

          3/3/2017 02:00:00 AM (BROWN) working Sell LMT @52.85 order is Cancelled
          3/3/2017 02:00:00 AM (BLUE) Sell LMT order @52.83 is Submitted

          3/3/2017 06:00:00 AM ... CancelOrder() ignored ...
          3/3/2017 06:00:00 AM (BLUE) SELL LMT @52.98 order is Submitted

          3/3/2017 10:00:00 AM Order Error (YELLOW) … Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties


          3/3/2017 02:00:00 PM Order Error… Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties

          Please let me know.

          Thank you
          Attached Files

          Comment


            #6
            Hello Support,

            Is there anyone else in Support that can help pls. Chelsea has be absent and I've been waiting for a reply for 2 days.

            Thank you

            Comment


              #7
              Hello rayko,

              Thank you for your patience.

              I do see what you are detailing and can reproduce on my end. I will follow up with you when I have further details.

              Comment


                #8
                Hello rayko,

                Thank you for your patience.

                I was able to correct the over submission of the orders by ensuring the order object for entries is actually null with the following code wrapped around your entry order logic:
                Code:
                            // Submit Order
                			if (pendingEntryOrder == null)
                			{
                	            double price = 0;
                	            if (TradeDirection == "S")
                	            {
                	                price = High[0] + 5 * TickSize;
                	                EnterShortLimit(BarsInProgress, true, DefaultQuantity, price, "Short");
                	            }
                	            else
                	            {
                	                price = Low[0] - 5 * TickSize;
                	                EnterLongLimit(BarsInProgress, true, DefaultQuantity, price, "Long");
                	            }
                			}
                Please let me know if you have any questions.

                Comment


                  #9
                  Hello Support,

                  I made the change you indicated and it still gets the same Error.

                  I’ve re-uploaded the changed script.

                  I have to disagree. The original script was not over submitting.

                  This is why the Trace output for both the original script and the one I just uploaded with the changes are producing the same NT8 Trace output.

                  You can see in the Trace output the last order submitted was at 6:00am and that same order could not be cancelled at 10:00am thus causing Error “Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'”


                  3/3/2017 6:00:00 AM: NEW BAR with MarketPostion=Flat
                  3/3/2017 6:00:00 AM Strategy 'MyCustomStrategy99/-1': Entered internal SubmitOrderManaged() method at 3/3/2017 6:00:00 AM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=52.98 StopPrice=0 SignalName='Short' FromEntrySignal=''

                  3/3/2017 10:00:00 AM: NEW BAR with MarketPostion=Flat
                  3/3/2017 10:00:00 AM Strategy 'MyCustomStrategy99/-1': Entered internal SubmitOrderManaged() method at 3/3/2017 10:00:00 AM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=53.14 StopPrice=0 SignalName='Short' FromEntrySignal=''
                  3/3/2017 10:00:00 AM Strategy 'MyCustomStrategy99/-1': Ignored SubmitOrderManaged() method at 3/3/2017 10:00:00 AM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=53.14 StopPrice=0 SignalName='Short' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'

                  Can you please look again and you’ll see the error persists because CancelOrder() was ignored at 10:00 am.

                  Thank you
                  Attached Files

                  Comment


                    #10
                    Hello Support,

                    I've inserted a few more print statements to make the NT8 Trace a bit clearer to read.

                    I've uploaded a new screen scrape of Strategy Analyzer, NT8 Trace output and a new version of the example script exported from NT8.

                    You can see from the log at 3/6/2017 2:00pm a pending order is submitted and Trace shows the order accepted and eventually becoming a "Working" order. And then at 3/6/2017 5:00pm CancelOrder() ignored cancelling it.

                    3/6/2017 2:00:00 PM: Client NEW BAR with MarketPostion=Flat
                    3/6/2017 2:00:00 PM: Client Submitted Pending Short Order=53.61
                    3/6/2017 2:00:00 PM Strategy 'MyCustomStrategy99/-1': Entered internal SubmitOrderManaged() method at 3/6/2017 2:00:00 PM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=53.61 StopPrice=0 SignalName='Short' FromEntrySignal=''
                    3/6/2017 2:00:00 PM: Client Pending pendingEntryOrder Set To Order, OnOrderUpdate orderState=Working

                    3/6/2017 5:00:00 PM: Client NEW BAR with MarketPostion=Flat
                    3/6/2017 5:00:00 PM: Client Trying to CancelOrder()

                    3/6/2017 10:00:00 PM: Client NEW BAR with MarketPostion=Flat
                    3/6/2017 10:00:00 PM: Client Trying to CancelOrder()


                    The trace does not give a reason why CancelOrder() could not cancel the pending order. It looks like a bug with NT8.

                    Can you please take a look, and let me know why the CancelOrder() failed to cancel the pending order ?

                    Thank you
                    Attached Files

                    Comment


                      #11
                      Hello Patrick,

                      Can you pls tell me when you will look into this ?

                      Thank you

                      Comment


                        #12
                        Hello rayko,

                        Thank you for your post.

                        I am currently looking into this. Please excuse the delay as we assist multiple users throughout the day.

                        Comment


                          #13
                          Hello Patrick,

                          Thanks for getting back to me. Sorry I'll try not to be a nag..

                          Anyway, I took the opportunity to write the test script into NT7 so that I can compare behavior with NT8

                          The good news is it looks like the script worked as expected in NT7.

                          I've uploaded screen scrapes of the same tests done in NT7 and NT8.

                          Also uploaded the NT Traces files and source code for both NT7 & NT8

                          The source code for both platforms include Print statements to enhance the readability of the Order Trace files.

                          On the surface it looks like a problem with NT8. Somehow the order object internal with NT8 is not equal to the order object returned by OnOrderUpdate.

                          I can't confirm since I don't have a way of seeing the internal order object at runtime AND CancelOrder() provides no feedback or return code to a strategy AND it leaves no reason or message on the Order Trace log if it can't delete an order.

                          Please let me know what you find.

                          Thank you
                          Attached Files

                          Comment


                            #14
                            Hello rayko,

                            Thank you for your response.

                            So we are now looking into the following message concerning the exit order?
                            3/2/2017 10:00:00 PM Strategy 'MyCustomStrategy95/-1': Ignored SubmitOrderManaged() method at 3/2/2017 10:00:00 PM: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=52.57 StopPrice=0 SignalName='ShortProfitTarget' FromEntrySignal='Short' Reason='This was an exit order but no position exists to exit'
                            I believed we were concerned about orders objects not being correctly updated over session changes.

                            The message here is due to the fact we are submitted exit orders no matter what execution.Order has filled. From your code you have the following in OnExecutionUpdate() before the exit orders are submitted:
                            Code:
                            if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled)
                            This is submitting when exit orders fill as well and thus the message.

                            Please let me know if I am looking at the wrong messages here.

                            Comment


                              #15
                              Hello Patrick

                              It maybe that order objects are not accessible over session changes. I can’t see into the internal order object to tell.

                              The problem I see is order objects in NT8 are not always cancelling using CancelOrder().

                              When you compare the trace output of NT7 and NT8, the last trade that both platforms made together was at 3/6/2017 10:00:00 am. SellShort @53.5 then Exit @53.40.

                              But after that NT8 CancelOrder() began NOT cancelling orders. Here are the NT8 trace log entries that show the problem

                              3/6/2017 2:00:00 PM: Client NEW BAR with MarketPostion=Flat
                              3/6/2017 2:00:00 PM: Client Submitted Pending Short Price=53.61
                              3/6/2017 2:00:00 PM Strategy 'MyCustomStrategy95/-1': Entered internal SubmitOrderManaged() method at 3/6/2017 2:00:00 PM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=53.61 StopPrice=0 SignalName='Short' FromEntrySignal=''
                              3/6/2017 2:00:00 PM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Submitted
                              3/6/2017 2:00:00 PM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Accepted
                              3/6/2017 2:00:00 PM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Working

                              3/6/2017 5:00:00 PM: Client NEW BAR with MarketPostion=Flat
                              3/6/2017 5:00:00 PM: Client Trying to CancelOrder()
                              3/6/2017 5:00:00 PM: LATEST ORDER=orderId='NT-00027-31' account='Backtest' name='Short' orderState=Working instrument='CL ##-##' orderAction=SellShort orderType='Limit' limitPrice=53.61 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2017-03-06 14:00:00' gtd='2099-12-01' statementDate='2017-10-19'

                              3/6/2017 10:00:00 PM: Client NEW BAR with MarketPostion=Flat
                              3/6/2017 10:00:00 PM: Client Trying to CancelOrder()
                              3/6/2017 10:00:00 PM: LATEST ORDER=orderId='NT-00027-31' account='Backtest' name='Short' orderState=Working instrument='CL ##-##' orderAction=SellShort orderType='Limit' limitPrice=53.61 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2017-03-06 14:00:00' gtd='2099-12-01' statementDate='2017-10-19'

                              3/7/2017 2:00:00 AM: Client NEW BAR with MarketPostion=Flat
                              3/7/2017 2:00:00 AM: Client Trying to CancelOrder()
                              3/7/2017 2:00:00 AM: LATEST ORDER=orderId='NT-00027-31' account='Backtest' name='Short' orderState=Working instrument='CL ##-##' orderAction=SellShort orderType='Limit' limitPrice=53.61 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2017-03-06 14:00:00' gtd='2099-12-01' statementDate='2017-10-19'

                              3/7/2017 6:00:00 AM: Client NEW BAR with MarketPostion=Flat
                              3/7/2017 6:00:00 AM: Client Trying to CancelOrder()
                              3/7/2017 6:00:00 AM: LATEST ORDER=orderId='NT-00027-31' account='Backtest' name='Short' orderState=Working instrument='CL ##-##' orderAction=SellShort orderType='Limit' limitPrice=53.61 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2017-03-06 14:00:00' gtd='2099-12-01' statementDate='2017-10-19'
                              After 3/6/2017 10:00:00 am in NT8, CancelOrder() stop cancelling orders and stopped placing entries in the trace log. The script tries to cancel SellShort @53.61 but CancelOrder() ignores it, bar over bar (see above quote).

                              You can see from the NT7 log what should happen using the same script, where orders are canceled and resubmitted bar over bar.

                              3/6/2017 2:00:00 PM: NEW BAR with MarketPostion=Flat
                              3/6/2017 2:00:00 PM: Client Submitted Pending Short Price=53.61
                              3/6/2017 2:00:00 PM Entered internal PlaceOrder() method at 3/6/2017 2:00:00 PM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=53.61 StopPrice=0 SignalName='Short' FromEntrySignal=''
                              3/6/2017 2:00:00 PM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=PendingSubmit
                              3/6/2017 2:00:00 PM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Accepted
                              3/6/2017 2:00:00 PM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Working

                              3/6/2017 5:00:00 PM: NEW BAR with MarketPostion=Flat
                              3/6/2017 5:00:00 PM: Client Trying to CancelOrder()
                              3/6/2017 5:00:00 PM: LATEST ORDER=Order='NT-00020/Backtest' Name='Short' State=Working Instrument='CL ##-##' Action=SellShort Limit price=53.61 Stop price=0 Quantity=1 Strategy='MyCustomStrategy99' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='450ec1521a044d10b50b06142db45b12' Gtd='12/1/2099 12:00:00 AM'
                              Cancelled custom managed order at 3/6/2017 5:00:00 PM: Order='NT-00020/Backtest' Name='Short' State=Working Instrument='CL ##-##' Action=SellShort Limit price=53.61 Stop price=0 Quantity=1 Strategy='MyCustomStrategy99' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='450ec1521a044d10b50b06142db45b12' Gtd='12/1/2099 12:00:00 AM'
                              3/6/2017 5:00:00 PM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=PendingCancel
                              3/6/2017 5:00:00 PM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Cancelled
                              3/6/2017 5:00:00 PM: Client OnOrderUpdate pendingEntryOrder Set To Null, OnOrderUpdate orderState=Cancelled

                              3/6/2017 10:00:00 PM: NEW BAR with MarketPostion=Flat
                              3/6/2017 10:00:00 PM: Client Submitted Pending Short Price=53.28
                              3/6/2017 10:00:00 PM Entered internal PlaceOrder() method at 3/6/2017 10:00:00 PM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=53.28 StopPrice=0 SignalName='Short' FromEntrySignal=''
                              3/6/2017 10:00:00 PM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=PendingSubmit
                              3/6/2017 10:00:00 PM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Accepted
                              3/6/2017 10:00:00 PM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Working

                              3/7/2017 2:00:00 AM: NEW BAR with MarketPostion=Flat
                              3/7/2017 2:00:00 AM: Client Trying to CancelOrder()
                              3/7/2017 2:00:00 AM: LATEST ORDER=Order='NT-00021/Backtest' Name='Short' State=Working Instrument='CL ##-##' Action=SellShort Limit price=53.28 Stop price=0 Quantity=1 Strategy='MyCustomStrategy99' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='5604f3ba1c0e463cb8a26138cebec3aa' Gtd='12/1/2099 12:00:00 AM'
                              Cancelled custom managed order at 3/7/2017 2:00:00 AM: Order='NT-00021/Backtest' Name='Short' State=Working Instrument='CL ##-##' Action=SellShort Limit price=53.28 Stop price=0 Quantity=1 Strategy='MyCustomStrategy99' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='5604f3ba1c0e463cb8a26138cebec3aa' Gtd='12/1/2099 12:00:00 AM'
                              3/7/2017 2:00:00 AM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=PendingCancel
                              3/7/2017 2:00:00 AM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Cancelled
                              3/7/2017 2:00:00 AM: Client OnOrderUpdate pendingEntryOrder Set To Null, OnOrderUpdate orderState=Cancelled

                              3/7/2017 6:00:00 AM: NEW BAR with MarketPostion=Flat
                              3/7/2017 6:00:00 AM: Client Submitted Pending Short Price=53.46
                              3/7/2017 6:00:00 AM Entered internal PlaceOrder() method at 3/7/2017 6:00:00 AM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=53.46 StopPrice=0 SignalName='Short' FromEntrySignal=''
                              3/7/2017 6:00:00 AM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=PendingSubmit
                              3/7/2017 6:00:00 AM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Accepted
                              3/7/2017 6:00:00 AM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Working
                              3/7/2017 6:00:00 AM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Filled
                              3/7/2017 6:00:00 AM: Client OnOrderUpdate pendingEntryOrder Set To Null, OnOrderUpdate orderState=Filled
                              3/7/2017 6:00:00 AM: Client OnExecutionUpdate FILLED Short AverageFillPrice =53.46
                              3/7/2017 6:00:00 AM: Client OnExecutionUpdate Submit ExitShortLimit ProfitTarget Order OnExecutionUpdate PT=53.36
                              3/7/2017 6:00:00 AM Entered internal PlaceOrder() method at 3/7/2017 6:00:00 AM: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=53.36 StopPrice=0 SignalName='ShortProfitTarget' FromEntrySignal='Short'
                              3/7/2017 6:00:00 AM: Client OnExecutionUpdate Submit ExitShortStopMarket StopLoss Order OnExecutionUpdate SL=53.51
                              3/7/2017 6:00:00 AM Entered internal PlaceOrder() method at 3/7/2017 6:00:00 AM: BarsInProgress=0 Action=BuyToCover OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=53.51 SignalName='ShortStopLoss' FromEntrySignal='Short'
                              3/7/2017 6:00:00 AM Cancelled pending exit order, since associated position is closed: Order='NT-00024/Backtest' Name='ShortStopLoss' State=Working Instrument='CL ##-##' Action=BuyToCover Limit price=0 Stop price=53.51 Quantity=1 Strategy='MyCustomStrategy99' Type=Stop Tif=Gtc Oco='' Filled=0 Fill price=0 Token='6d8cd096ed3b4ff6b3c3f91710730010' Gtd='12/1/2099 12:00:00 AM'
                              3/7/2017 6:00:00 AM: Client OnExecutionUpdate FILLED ShortProfitTarget AverageFillPrice =53.36
                              3/7/2017 6:00:00 AM: Client OnExecutionUpdate Submit ExitShortLimit ProfitTarget Order OnExecutionUpdate PT=53.26
                              The bottom line problem is NT8 CancelOrder() begins ignoring orders for unknown reasons.

                              My question is why is CancelOrder() ignoring orders in NT8 and how can it be fixed? NT8 behavior should match that of NT7 for these scripts.

                              I’m seeing this same behavior in another trading script I’m trying to convert from NT7 to NT8. Once I know what is going wrong in NT8 using these test scripts, I can once again continue the conversion of my trading script.

                              Please let me know.
                              Thank you

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Franck Z, Today, 09:49 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post Franck Z  
                              Started by pvtrader, Today, 08:02 AM
                              2 responses
                              7 views
                              0 likes
                              Last Post pvtrader  
                              Started by Natoc, Today, 03:04 AM
                              1 response
                              17 views
                              0 likes
                              Last Post NinjaTrader_Jason  
                              Started by Rudy2323, Today, 02:56 AM
                              2 responses
                              28 views
                              0 likes
                              Last Post Rudy2323  
                              Started by tonynt, Yesterday, 02:07 PM
                              1 response
                              38 views
                              0 likes
                              Last Post NinjaTrader_Jason  
                              Working...
                              X