Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

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

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

    #16
    Hello rayko,

    Thank you for confirming.

    We are looking into the correct matter then our end. I will follow up with you on this item when I have further details.

    Comment


      #17
      Hello rayko,

      Thank you for your patience.

      Below is what I see in my Output:
      3/2/2017 8:00:00 AM: Client NEW BAR with MarketPostion=Flat
      3/2/2017 8:00:00 AM: Client Trying to CancelOrder()
      3/2/2017 8:00:00 AM: LATEST ORDER=orderId='NT-00000-123' account='Backtest' name='Short' orderState=Working instrument='CL 12-17' orderAction=SellShort orderType='Limit' limitPrice=56.5 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2017-03-02 04:00:00' gtd='2099-12-01' statementDate='2017-10-20'
      3/2/2017 8:00:00 AM Strategy 'MyCustomStrategy95/-1': Cancelled custom managed order: orderId='NT-00000-123' account='Backtest' name='Short' orderState=Working instrument='CL 12-17' orderAction=SellShort orderType='Limit' limitPrice=56.5 stopPrice=0 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2017-03-02 04:00:00' gtd='2099-12-01' statementDate='2017-10-20'
      3/2/2017 8:00:00 AM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=CancelPending
      3/2/2017 8:00:00 AM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=CancelSubmitted
      3/2/2017 8:00:00 AM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Cancelled
      3/2/2017 8:00:00 AM: Client OnOrderUpdate pendingEntryOrder Set To Null, OnOrderUpdate orderState=Cancelled

      3/2/2017 8:00:00 AM: Client Submitted Pending Short Price=56.16
      3/2/2017 8:00:00 AM Strategy 'MyCustomStrategy95/-1': Entered internal SubmitOrderManaged() method at 3/2/2017 8:00:00 AM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=56.16 StopPrice=0 SignalName='Short' FromEntrySignal=''
      3/2/2017 8:00:00 AM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Submitted
      3/2/2017 8:00:00 AM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Accepted
      3/2/2017 8:00:00 AM: Client OnOrderUpdate pendingEntryOrder ASSIGNED, OnOrderUpdate orderState=Working
      I also avoid any ignored messages by implementing a check for the order name as to avoid exits being submitted when there is no entry being filled:
      Code:
      if ((execution.Order.Name == "Short" || execution.Order.Name == "Long") && (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled))
      Please let me know if you have any questions.

      Comment


        #18
        Hello Patrick,

        I'm confused by your last msg.

        Changes to the "if" statement in OnExecutionUpdate will reduce some log entries

        But it does Not fix the problem I've been talking about, where NT8 CancelOrder() ignores "working" 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 hope I've been clear about the NT8 problem and that you guys at NT will have a fix for it.

        Please let me know

        Thank you

        Comment


          #19
          Hello rayko,

          Thank you for your response.

          We have already resolved the CancelOrder() item via the proper use of the order events as detail in my prior post and added below.
          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
          			[B]if (pendingEntryOrder == null)
          			{[/B]
          	            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");
          	            }
          			[B]}[/B]
          Currently you were focused on the Exit orders being called when no position is made.

          I suggest we schedule a call to discuss this on the phone so that I may ensure I am on the same page as you are on.

          Please reach out to me at platformsupport[at]ninjatrader[dot]com with 'ATTN: Patrick H' in the subject line and a reference to this thread in the body of the email. Please include your telephone number and a time I may reach you. I am available from 8:30 am to 5 pm EST Monday through Friday.

          I look forward to assisting you further.

          Comment


            #20
            Hello rayko,

            Thank you for your patience.

            I simplified the strategy further on my end and isolated the issue to the multiple exit orders. I am reporting this to development and I will follow up with you when I have any details.

            I look forward to assisting you further.

            Comment


              #21
              Hello rayko,

              Thank you for your patience.

              This is occurring due to two exits filling on the same bar in historical processing. Essentially, the historical fill processing is seeing that the exits can fill on the same bar thus an Overfill occurs and the entry gets "stuck" in state that it cannot be cancelled.

              To avoid this behavior we must use just the SetStopLoss, SetTrailStop, and SetProfitTarget methods without any Exit methods in our Managed code.
              Alternatively, you can use the Unmanaged Order Methods in order to work around the Manage Order Methods resulting in such behavior.

              Please refer to the Unmanaged Order Methods at the following link: https://ninjatrader.com/support/help...d_approach.htm

              We have however submitted this report as a feature request for Historical Fill Processing to avoid such behavior.

              Please let me know if you have any questions.

              Comment


                #22
                Originally posted by NinjaTrader_PatrickH View Post
                We have however submitted this report as a feature request for Historical Fill Processing to avoid such behavior.
                The internal tracking number for your feature request is SFT-2278. Please reference this internal tracking number if you ever have questions regarding this feature request.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Perr0Grande, Today, 08:16 PM
                0 responses
                2 views
                0 likes
                Last Post Perr0Grande  
                Started by elderan, Today, 08:03 PM
                0 responses
                4 views
                0 likes
                Last Post elderan
                by elderan
                 
                Started by algospoke, Today, 06:40 PM
                0 responses
                10 views
                0 likes
                Last Post algospoke  
                Started by maybeimnotrader, Today, 05:46 PM
                0 responses
                11 views
                0 likes
                Last Post maybeimnotrader  
                Started by quantismo, Today, 05:13 PM
                0 responses
                7 views
                0 likes
                Last Post quantismo  
                Working...
                X