Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Level 2 data after hours from TD

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

    #16
    1) What feed is NT using from the TD for the charts - Level One Quotes or Time and Sales? See the attached video for a speed comparison between three charts with ThinkOrSwim and NT8. The NT8 updates are slower.

    I've compared my own program's Level One Quotes and Time and Sales to ThinkOrSwim and they are very close to the same timing.

    2) Why am I only getting Level 2 in NT for some instruments? I am also to see Level 2 in my own program using the TD API for the instruments that are blank in NT8.

    3) Have you considered open-sourcing your connectors so that other developers may contribute? I'm not saying that to allow for other brokers to be used, but I'm sure there's probably a backlog of updates on your schedule that others would be glad to pitch in on.

    Thanks.

    Comment


      #17
      Hello clabough,

      Thanks for the post.

      As your inquiry directly reates to your previous topic, I have merged your latest note here.

      As my collogues previously noted, TD Ameritrade accounts in the NinjaTrader platform use what is called 'Time and Sales' data, which is essentially snapshot or filtered data. As discussed, the data is going to work a bit different in NinjaTrader versus other platforms, so some differences are expected.

      There is an existing feature request, SFT-3936, which is to enhance the TD Ameritrade adapter. My colleague Jermaine has already added your vote to this feature request.

      Regarding your question about open-source adapters, while we do have business relationships with some vendors/programmers who provide their own adapters for connection technologies within our platform, this is generally to add the ability to connect to a new technology rather than enhance an old one. The adaptors themselves are not open source and this is unlikely to change.

      Please let us know if we may be of any further assistance.

      Melissa J.NinjaTrader Customer Service

      Comment


        #18
        I could leave it at that if I weren't able to connect to the API and compare myself. What I'm stuck on is that I keep being told that this is what TD provides to you, but I think I've demonstrated that TD does provide what I'm looking for.

        My testing directly with the TD API shows that both the Level 1 feed and the Time and Sales feed do not suffer from slow or missed data. I also get Level 2 book data for all the instruments that NT8 is showing nothing. I made videos of all this so that you could be sure that it's an issue that I'm experiencing and would help track down the issue.

        Is anyone willing to work with me and do some diagnostics to confirm where the issue lies? Are you sure there's not a code issue in NT8?

        Comment


          #19
          Hello,

          Thanks for the reply.

          As previously discussed, this is a limitation of the TD Ameritrade adapter in the NinjaTrader platform. We have added your vote to the existing feature request to enhance this adapter, but otherwise there are no further analytics we would be able to do since this is a known symptom of the adaptor in the way it is currently implemented in the platform.

          Please feel free to reach out with any further NinjaTrader inquiry you may have.
          Melissa J.NinjaTrader Customer Service

          Comment


            #20
            Thanks. Any chance you could provide the C# Interface so maybe someone could build a new adapter for your use?

            Comment


              #21
              I've now switched to using Kinetick as my data feed and the problem is the same. In this video, notice how behind NT gets at about 20 seconds in.

              My machine is an AMD Ryzen 9 3900X 12-Core Processor w/32GB RAM, so not a struggle for my machine.

              Also, I've subscribed to these services and I'm not seeing Level II data for all NASDAQ stocks - like the one in the video.
              Kinetick Basic Service
              NYSE AMERICAN N/P Exchge Fee
              Market Depth
              RT NASDAQ Level 1 Non Pro
              NASDAQ L2/OpenView Non Pro
              NYSE Non-Pro Exchange Fee
              Last edited by clabough; 09-10-2021, 10:56 AM.

              Comment


                #22
                OK. One more example that's as plain as I can make it. I'm connected to Kinnetick for data. I'm using the strategy coded below. In this video you can see missed prices, and OnBarUpdate not called very often.



                Code:
                 public class PriceDump : Strategy
                {
                protected override void OnStateChange()
                {
                if (State == State.SetDefaults)
                {
                Description = @"Enter the description for your new custom Strategy here.";
                Name = "PriceDump";
                Calculate = Calculate.OnPriceChange;
                EntriesPerDirection = 1;
                EntryHandling = EntryHandling.AllEntries;
                IsExitOnSessionCloseStrategy = true;
                ExitOnSessionCloseSeconds = 30;
                IsFillLimitOnTouch = false;
                MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
                OrderFillResolution = OrderFillResolution.High;
                OrderFillResolutionType = BarsPeriodType.Minute;
                OrderFillResolutionValue = 1;
                Slippage = 0;
                StartBehavior = StartBehavior.WaitUntilFlat;
                TimeInForce = TimeInForce.Gtc;
                TraceOrders = false;
                RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
                StopTargetHandling = StopTargetHandling.PerEntryExecution;
                BarsRequiredToTrade = 20;
                // Disable this property for performance gains in Strategy Analyzer optimizations
                // See the Help Guide for additional information
                IsInstantiatedOnEachOptimizationIteration = true;
                }
                }
                
                protected override void OnBarUpdate()
                {
                Print("close: " + Close[0] + " @ " + DateTime.Now.TimeOfDay);
                }
                }

                Comment


                  #23
                  Hello clabough,

                  There are a couple different data related items here, involving Level 1 and Level 2 data.

                  Level 1

                  NinjaTrader uses these Level 1 feed from TDA's API as NinjaTrader provides bid/ask and Last ticks from the level 1 feed. As my colleague Ryan mentions and as you may already be aware, this is a snapshot based feed and the updates then become filtered for performance reasons to be around 5 updates per second.

                  As I understand, the TDA API Level 1 feed is not the same as Think Or Swim, and this is not the same data feed as Kinetick. As the L1 TDA API data is snapshot based and can vary between Think Or Swim and through their API, it would not be a good apples to apples comparison. With the Level 1 feed being snapshot based, differences would likely be seen with higher volatility stocks when trades are more frequent. I have not done my own comparison of TDA's Level 1 feed from API vs. what is seen in Think Or Swim, but that would be out of the scope for this question.

                  While the below is still not an apples to apples comparison, and we should not expect 1:1 data, it does better illustrate the differences in data seen between TDA and Kinetick when used through NinjaTrader. We can see that Kinetick is providing NinjaTrader more Level 1 updates to the Level 2 window. (The GIF below was recorded with a build of NinjaTrader enable to be run alongside another instance, with Left being Kinetick, and Right being a TDA connection.)

                  Click image for larger version

Name:	2021-09-13_13-55-54.gif
Views:	233
Size:	596.1 KB
ID:	1171039

                  Level 2

                  Clayton asked me about this earlier when you were working with him and we wanted you to test switching the exchange to NASDAQ in NinjaTrader's instrument definitions. Behind the scenes, the set exchange does change how the symbol is accessed through the connection adapter and API. This is likely the case here for the instruments you are viewing which we wanted to confirm. I went ahead and used a TDA connection to do the test above, and I also added the symbol ATER to test Level 2.

                  We have to remember that if a symbol does not exist in NinjaTrader's database and we open up a new chart of that symbol, a new instrument definition will be made. When I first added ATER, there was no Level 2 data seen (tested after 2:00PM MST/4:00PM EST) until I checked Nasdaq as an exchange for instrument definitions. Once Nasdaq was checked for the instrument definitions and I reconnected to apply the changes, I was receiving data in the Level 2 window.

                  Click image for larger version

Name:	2021-09-13_14-29-07.gif
Views:	290
Size:	668.6 KB
ID:	1171038

                  Could you confirm this with ATER on your end? Several symbol you have added and are mentioning here are not already configured in NinjaTrader's instrument database, and checking Nasdaq for the exchange may be necessary as I have tested.

                  Getting past ATER, if there are still affected symbols, please let me know which and please confirm you have tested with exchange set with Default + Nasdaq. Screenshots help for confirmation.
                  JimNinjaTrader Customer Service

                  Comment


                    #24
                    I was able to get Level 2 data to show for all instruments. I needed to change the preferred connection - real time to Kinetick. But I'm not seeing the full book. How do I get the full book to show?

                    Click image for larger version

Name:	Screenshot 2021-09-14 110820.png
Views:	153
Size:	80.1 KB
ID:	1171155


                    Attached Files

                    Comment


                      #25
                      Hello clabough,

                      Setting the realtime preferred connection to Kinetick would allow using Kinetick for the Level 2 data.

                      I asked a colleague with Kinetick to elaborate if they were aware of any differences between Kinetick and TDA as there appears to be different market makers listed in your screenshots.

                      Kinetick's only L2 service for equities is the NASDAQ OpenView. Kinetick doesn't have a dedicated L2 service for NYSE stocks. The NASDAQ OpenView will only show NASDAQ participation on NYSE stocks.
                      I am not sure the symbol you are viewing as it is not in your screenshot, but this may provide an answer to this question.

                      If you are looking to see the Level 2 data given from TDA, I think we should go back to getting the after hours Level 2 data working, or to report an issue with a specific symbol. As I tested on my end in post #23, where I set the exchange on ATER to Nasdaq, and reconnecting, I got the Level 2 data after 4pm EST. This tells me that setting the exchange to Nasdaq allows the Nasdaq Level 2 data to be used instead of Listed Level 2 data from TDA.

                      Connection order will matter, but to move forward here, could you follow up regarding the same procedure I did to test ATER, connecting to TDA only, and with preferred connections disabled? After we confirm you are getting the Level 2 data after 4pm EST on this symbol, you could then go back and set your preferred connections so TDA is the preferred realtime data provider for stocks.

                      Working with Multiple Connections - https://ninjatrader.com/support/help...onnections.htm

                      To summarize with ATER please do the following after 4pm EST:
                      1. Connect to TDA, test viewing this symbol in the Level 2 window
                      2. Change the Instrument definitions and set the Exchange to Default + Nasdaq
                      3. Restart NinjaTrader and check the Level 2 window for ATER again
                      This is all I had to do on my end to get the Level 2 window populated after 4pm EST with TDA.

                      Please confirm your results testing this with ATER, and we can move on to other symbols after that. We would then need to confirm if you are not getting the Level 2 data from those symbols when Nasdaq is checked as an exchange in the instrument definitions, and you have restarted after changing the instrument definitions.
                      JimNinjaTrader Customer Service

                      Comment


                        #26
                        I am seeing Level 2 data for many instruments after hours and after switching my preferred connection to Kinetick. Oddly, Level 2 for AMC stops at 4pm EST. Must be because it's NYSE.

                        Right now, I'm seeing Level 2 for LIFE, OCGN, BBIG, JCS, and ATER, but not AMC. But they are all just top of book still.

                        I have all Market Data connections set to Kinetick.

                        Click image for larger version

Name:	Screenshot 2021-09-14 131513.png
Views:	154
Size:	34.7 KB
ID:	1171180

                        Comment


                          #27
                          Hello clabough,

                          The Level 2 data provided by Kinetick would include the Nasdaq Market Makers only. I watched AMC in the Level 2 window for both Kinetick and TDA going into after hours for today, and I did see the Level 2 data only show for NSDQ after this time. I agree this sounds normal for an NYSE stock and Kinetick only showing Nasdaq participants.

                          ATER is not that different between TDA and Kinetick as far as I see and I have attached a screenshot. The only difference I am seeing in that specific screenshot is MEMX being missing on Kinetick side. (Keep in mind I set the exchange to Nasdaq for ATER to view it with TDA)

                          Click image for larger version  Name:	image_69171.png Views:	5 Size:	48.8 KB ID:	1171308

                          You may be perceiving "top of book" as what was fetched at that time. Many data providers will limit how many depth levels get requested at once, and the Level 2 book then gets built with more information as MarketDepthUpdates are received.

                          We can observe this with futures between Rithmic and Kinetick. Rithmic would let you view quite a bit more level 2 data immediately when Kinetick will not. Below we have a screenshot where Kinetick(left) has little depth data painted in comparison to Rithmic(right) when the EdsLevel2 indicator is just added to the chart.

                          Click image for larger version  Name:	NinjaTrader_2021-09-15_14-41-21.png Views:	0 Size:	68.7 KB ID:	1171312
                          Last edited by NinjaTrader_Jim; 09-15-2021, 03:02 PM.
                          JimNinjaTrader Customer Service

                          Comment


                            #28
                            OK, Yes, understood, but how do I get the full book to show - even during market hours? I'm paying for NASDAQ L2/OpenView.

                            Also, If I disconnect from Kinetick after hours, then I see Level 2 for AMC, but not for others. Is there a way to tell it to use TDA for NYSE and Kinetick for NASDAQ?

                            Comment


                              #29
                              You will have to let the book build over time as you are viewing it to view the whole thing. (For futures, Rithmic would provide it all at once.)

                              There is not a way to separate preferred data providers per instrument or per exchange. It is only allowed to set preferred data providers by asset type.

                              For the other instruments that you are not seeing when connected to TDA, did you change the exchange to Nasdaq and restart NinjaTrader? This is all that I did on my end to view ATER.
                              Last edited by NinjaTrader_Jim; 09-15-2021, 03:05 PM.
                              JimNinjaTrader Customer Service

                              Comment


                                #30
                                Not sure what you mean by letting the book "build over time". It should be a point in time that shows the full book. I've set ATER to Default+NASDAQ and it's been running for a couple of hours and I'm still only seeing the top for each market maker. On the right is the full book (without letting it build) from Fidelity. The point of wanting the full book is so that I can see things like the 15,475 order at 10.00 and others below the high bid/low ask. I'm paying $60/mo for NASDAQ OpenView so I should be able to see all levels in the book.

                                As a test, I completely disconnected from TDA and the Level II for ATER remained the same (but was still getting bid/ask updates).

                                Click image for larger version

Name:	Screenshot 2021-09-16 091308.png
Views:	155
Size:	221.2 KB
ID:	1171403

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Waxavi, Today, 02:10 AM
                                0 responses
                                3 views
                                0 likes
                                Last Post Waxavi
                                by Waxavi
                                 
                                Started by TradeForge, Today, 02:09 AM
                                0 responses
                                7 views
                                0 likes
                                Last Post TradeForge  
                                Started by Waxavi, Today, 02:00 AM
                                0 responses
                                2 views
                                0 likes
                                Last Post Waxavi
                                by Waxavi
                                 
                                Started by elirion, Today, 01:36 AM
                                0 responses
                                4 views
                                0 likes
                                Last Post elirion
                                by elirion
                                 
                                Started by gentlebenthebear, Today, 01:30 AM
                                0 responses
                                4 views
                                0 likes
                                Last Post gentlebenthebear  
                                Working...
                                X