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

Trace

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

    Trace


    Hello,
    I have a strategy that submitted an order on Monday morning but was cancelled.
    I was checking log files but it does not say much about it. Only that it was cancelled.
    I also checked trace file but I do not understand the reason that made the order to be cancelled.
    There are log and traces files attached, please help me understand!
    I need to know the reason in order to know how to solve it in my strategy script.

    Thanks in advance.

    #2
    Hi lismartin, thanks for writing in.

    If the order is not submitted with the overload:

    EnterLongLimit(int barsInProgressIndex, bool isLiveUntilCancelled (true), int quantity, double limitPrice, string signalName)

    the submitted order will be canceled at the close of the next bar unless the order is resubmitted. The log looks like the order was canceled in this way.

    If this doesn not resolve your inquiry, please share details on the strategy you are running. You may post them here, or send them to scriptingsupport at ninjatrader.com and reference "Attn ChrisL" in the body of the email.

    Kind regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello Chris, thanks for answering.

      I indeed am using isLiveUntilCancelled=true in my strategy.
      I have added a custom order management logic for order handling that cancels current order after 10 seconds when it is not PartFilled nor Filled and resubmits the order with a new limit price.
      I am sure that this is not the reason that that specific order cancelled because it cancelled after 5~6seconds and it did not resubmit the order.

      I know that there is a line in the trace file with timestamp
      Code:
      2021-07-26 06:16:00:305
      that says

      Code:
      IB.Adapter.OnError: id=862 errorCode='OutsideRTHIgnored' errorMessage='Advertencia sobre evento de órdenes:Attribute 'Fuera del horario de apertura de la Bolsa' is ignored based on the order type and destination. PlaceOrder is now being processed.'
      the text in spanish says "warning about orders event: Attribute 'Outside the opening hours of the Stock Exchange' is ignored..."

      I want to know if this may be a cause to the order cancelling or is there any other clue I could follow along so I can solve this issue for future trades on this strategy
      Thanks

      Comment


        #4
        Hello lismartin,

        Prints beside the logic calling CancelOrder can confirm if the order was cancelled from your own logic. We should also note the TimeInForce parameter used with the strategy to ensure the orders are submitted GTC or Good Till Close.

        Do you have Trigger After Hours checked in the Interactive Brokers Connection? This option can be found at the bottom of the Connection parameters when configuring the Interactive Brokers connection in NinjaTrader. More details on the Connection Adapter properties can be found in the Connection Guide.

        Connection Guide - https://ninjatrader.com/ConnectionGu...nnection-Guide

        Please also check Trader Workstation to see if you have the following checked: "Allow order to be activated, triggered, or filled outside of regular trading hours" (Configure > Order > Order Presets > Timing menu)

        We look forward to hearing from you.
        JimNinjaTrader Customer Service

        Comment


          #5

          Hello Jim, thanks for replaying.

          I previously confirmed that the reason this order cancelled was not the custom logic I added to the strategy.

          In regard to Time In Force set to GTC, according to the documentation the orders generated under this setting will remain working until explicitly cancelled, which it's not the case because this event occurred at 2am in the timezone me and my team work, which means there was no one watching out our live trading environment.

          My team just checked the option Trigger After Hours on my Interactive Brokers Connection and it is active. But we do not use Trader Workstation, we want to know how to check "Allow order to be activated, triggered, or filled outside of regular trading hours" in the Interactive Brokers Gateway.

          Thanks in advance.
          Last edited by lismartin; 07-28-2021, 11:43 AM.

          Comment


            #6
            Hello lismartin,

            Interactive Brokers describes changing this property here (publicly available link) and this appears to be present in IB Gateway as well.

            If you are still stuck after this, please write in to platformsupport [at] ninjatrader [dot] com with the text "Attn Jim/Chris 3197787" and include a link to this thread with the log and trace files and a snippet of the order method which submitted the order.
            JimNinjaTrader Customer Service

            Comment


              #7
              Hello
              I was wondering, do I really need to mark Trigger After Hours as checked?
              My strategy trading logic is set that if conditions are met the order is placed after the first minute in the trading hour has passed.

              Do I really need to mark Trigger After Hours as checked? and Allow order to be activated, triggered, or filled outside of regular trading hours? Since my strategy is not trading outside of the trading hours of the instrument (FDAX 09-21, TH: Eurex Equity Index Futures, NinjaTrader Settings TimeZone: UTC)

              Thanks

              Comment


                #8
                Hello lismartin,

                According to the error code presented in post #3, yes, this would be my recommendation.

                Please test that and if we are still having issues, please provide the detail noted in post #6 to Chris and I.
                JimNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by quantismo, Yesterday, 05:13 PM
                2 responses
                16 views
                0 likes
                Last Post quantismo  
                Started by maybeimnotrader, Yesterday, 05:46 PM
                4 responses
                23 views
                0 likes
                Last Post maybeimnotrader  
                Started by frankthearm, Today, 09:08 AM
                6 responses
                25 views
                0 likes
                Last Post frankthearm  
                Started by adeelshahzad, Today, 03:54 AM
                5 responses
                33 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by stafe, 04-15-2024, 08:34 PM
                7 responses
                32 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X