Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Interactive Brokers: GTC and Time to Enforce

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

    Interactive Brokers: GTC and Time to Enforce

    Hi NT, we use Managed and sometimes UnManaged trade orders through NT's API.

    We recently discovered that Interactive Brokers requires a "Time to Enforce" for GTC orders to execute orders after 1PM PST. Otherwise, the GTC orders are ignored until the intraday trading hours between 6:30AM and 1PM PST. This seems like a silly requirement at IB, but how do we send Time to Enforce information through the UnManaged API?

    BigSurf


    #2
    Hello bigsurftrader,

    The TIF would be controlled by the overall strategies TIF setting. You can configure that when applying the strategy or in its code using TimeInForce:

    https://ninjatrader.com/support/help...imeinforce.htm

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse -

      Interactive Brokers requires us to submit the actual time to enforce. Where would we set that in the strategy if we want GTC orders to execute after hours?

      The example that you shared doesn't have a place for us to actually set the timeframe of when GTC orders can be executed.

      Thanks!

      Mark

      Comment


        #4
        According to Interactive Brokers, " a setting attached to the order to trigger outside regular trading hours". Are you saying that be setting "TimeInForce = TimeInForce.Gtc" will attach whatever Interactive Brokers needs to trigger our orders outside intraday hours?

        Comment


          #5
          I just verified that our strategy does have TimeInForce == TimeInForce.Gtc. However, Interactive Brokers is not executing our stop and profit orders outside of regular trading hours.

          Comment


            #6
            Hello bigsurftrader,

            Do you have trigger after hours checked in the connection menu for your IB connection?

            Aside from the strategy setting that should be all that is necessary from NinjaTrader to submit the order to IB with a certain TIF. Are you seeing a rejection for the orders or any other relevant information? Are the orders submitted in NinjaTrader and not being seen in IB or are there any other details you can provide?

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Hi Jesse -- we'll check IB settings to see if there's something there.

              Regarding the stop and profit orders, we can see them in SuperDom, and see that they are not executing. They aren't canceled. We can see they are 'working' orders waiting to trigger when hit. However, when hit after hours they do not execute.

              Comment


                #8
                Hello bigsurftrader,

                When you say its not executed what do you mean, are you seeing its not being filled but remains working without any errors?

                Are the orders showing up and showing as working in IB? Or are you seeing it working in NinjaTrader but is not showing in IB?

                Also some clarification on what I said, the setting I was referring to is in the Connections menu in NinjaTrader for your IB connection settings, you may additionally want to check in IB to see if anything in there is being reported.

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Hi Jesse -

                  (1) I can see the stop and profit orders in SuperDom (so working orders)
                  (2) There are no errors or exceptions
                  (3) IB says they can see our GTC orders and confirmed they were properly setup; however, the Time In Force did not provide the actual timing of when the GTC orders could be executed (very odd, i know!); therefore, our GTC orders w/Time In Force enabled were not executed outside of normal trading hours
                  (4) Long story short, our Time in Force orders did not have the actual timeframe they could be enforced therefore they did not execute

                  Comment


                    #10
                    Hi Jessie - under Connection settings I see "Trigger afterhours" enabled, which has been enabled since we setup the IB account.

                    Comment


                      #11
                      Can you please confirm there is no "time element" with GTC Time In Force orders? According to IB there is a time element.

                      Comment


                        #12
                        Hello bigsurftrader,
                        There are no other options in NinjaTrader for the time however the following is mentioned in the connection guide for IB, have you followed this step?

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


                        Trigger after hours: Enable this if you want stop orders to trigger outside of standard trading hours. This will only work if you also have "Allow order to be activated, triggered, or filled outside of regular trading hours" enabled in TWS (Configure > Order > Order Presets > Timing menu)
                        Can i also confirm you are using specifically the version listed in the connection guide, at the time of writing this it is : TWS 973.2

                        I look forward to being of further assistance.
                        JesseNinjaTrader Customer Service

                        Comment


                          #13
                          Thanks Jesse, that solved it for us. There's a configuration setting and it was defaulted to "DAY" which prevented after hours execution but the orders were still live. At Dorman we didn't have this issue. Appreciate all the help you've provided us.

                          Comment


                            #14
                            Hi all,

                            I am having the same issue with TWS.

                            I enabled the option "Allow order to be activated, triggered, or filled outside of regular trading hours" in TWS but still the order is not executed. If I place the order within TWS I have the option to select "Fill outside RTH" in the Time-in-Force drop-down menu and the order is executed without problems.

                            Whenever I place the order, outside regular hours, with NT I see the order in the pending orders in TWS but the option "Fill/trigger outside RTH" is marked in gray as not selectable/enabled.

                            In my NT strategy I have TimeInForce.Gtc and in the connection configuration I have the option "Trigger after hours" enabled. I also changed the Time in Force in TWS to GTC but still no execution of any order.

                            Could you please be more specific on which additional settings needed in TWS?

                            Thank & Regards.

                            Comment


                              #15
                              Hello Peppo,

                              The option in NinjaTrader is in the connection menu and then the option in IB is in their Configure > Order > Order Presets > Timing menu/

                              Trigger after hours: Enable this if you want stop orders to trigger outside of standard trading hours. This will only work if you also have "Allow order to be activated, triggered, or filled outside of regular trading hours" enabled in TWS (Configure > Order > Order Presets > Timing menu)
                              JesseNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by zacharydw00, Today, 11:13 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post zacharydw00  
                              Started by luxurious_04, Today, 10:55 PM
                              0 responses
                              1 view
                              0 likes
                              Last Post luxurious_04  
                              Started by timmbbo, Today, 10:27 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post timmbbo
                              by timmbbo
                               
                              Started by 7robert, Today, 07:48 PM
                              1 response
                              14 views
                              0 likes
                              Last Post NinjaTrader_EricB  
                              Started by saltminer, Today, 06:32 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post saltminer  
                              Working...
                              X