Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TD Ameritrade (Thinkorswim) data vs NinjaTrader data

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

    TD Ameritrade (Thinkorswim) data vs NinjaTrader data

    I've been working on developing an auto trading strategy that is largely based on a modified hull moving average indicator. My strategy was initially built in the Thinkorswim (ToS) platform (TD Ameritrade broker) and now am looking to translate that into a Ninjatrader (NT) auto trading strategy. I trade e-mini S&P futures on a 1 min chart.

    After having worked through the translation in code, I believe the indicators are identical in code, however I am still getting misaligned entries/exists when I compare the indicators side by side in both platforms. Note that the connection data feed used to compare in NT was the NinjaTrader Continuum connection feed.

    Doing a little digging, it seems like this may be due to the data that each platform uses, i.e., ToS uses the data of formed bars, which is why the HMA value on the current bar shows static (doesn't change) but NT indicator uses the current bar in its calculations, and because of this, the NT entries/exists lag behind ToS by one bar. I don't have concrete support that this is indeed causing the misalignment.

    Does anyone have any thoughts on how to resolve this misalignment? I'd like to ultimately have the NT indicator mirror the ToS as without it, it pretty significantly throws off my results.

    I've also read that maybe different broker / data feeds can provide more aligned data for NJ to use?

    Any ideas that anyone has would be very helpful and appreciated. I can certainly provide any code or specific examples if that would help get to a better understanding/answer. Thank you!​

    #2
    Hello cloud889,

    Welcome to the NinjaTrader Forums.

    If your strategy is set to run in the mode of Calculate.OnBarClose, this means that the strategy code executes once at the end of each bar and will perform calculations on completed bars. If your strategy determines to enter an order, the order would be placed on the next bar. In this mode, your strategy will operate the same historically as it does when connected to real-time (or market replay) data.

    You could consider using the calculate mode of Calculate.OnPriceChange, or Calculate.OnEachTick, which will allow the strategy to be executed intrabar with a greater frequency. This means your code will be executed on each tick or each change in price. Entry orders would be executed intrabar instead of waiting until the next bar.

    See this help guide page for information about Calculate: https://ninjatrader.com/support/help.../calculate.htm

    Note that there could be slight discrepancies between ​data when comparing data between different platforms/providers. You could consider using TD Ameritrade as your data provider.

    You may also comb through each line in your script to ensure that the NinjaScript code you programmed matches your TD Ameritrade program to ensure there are no discrepancies there that might throw off results.

    Please let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Thanks NinjaTrader_BrandonH. Am I able to use TD Ameritrade as a data provider if I am trading e-mini S&P500 futures? Thought I saw somewhere that this wasn't the case.
      Last edited by cloudt889; 01-22-2023, 06:10 PM.

      Comment


        #4
        Hello cloudt889,

        Thanks for your note.

        Futures instruments are not supported for TD Ameritrade in NinjaTrader. Equities and Indexes are the instruments supported for TD Ameritrade in NinjaTrader. This could be seen on the Data By Provider help guide page linked below.

        Data By Provider: https://ninjatrader.com/support/help...y_provider.htm

        Please let me know if you have further questions on this.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        54 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        131 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X