Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Fundamental Data in IB

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

    Fundamental Data in IB

    Hi, I'm using Interactive Brokers and have a strategy based on daily bars. Most of the strategy only needs three bars (today, yesterday, day before), but I also want the average daily volume, and I honestly don't care if it's 10-, 20-, or 30-day volume and I don't care if it's exponential or simple average.

    My strategy uses the variable VOLMA(10)[1], which means I need to set Min Bars Required to 11 and Days To Load to 22 (double the bars because it's using an exponential average).

    To reduce the number of bars required, I tried using FundamentalDataType : AverageDailyVolume, but it appears that IB doesn't support this.

    So, does IB support AverageDailyVolume?

    If yes, how do I get the AverageDailyVolume from IB? I used the sample code in the reference manual under FundamentalDataEventArgs.

    If no, is there a more efficient way to calculate the average volume than VOLMA? For example, is there a way to get a simple moving average for the last 10 daily bars, which would allow me to reduce Days To Load from 22 to 11?

    #2
    Hi egan857,

    You would need to check with IB if they support the average volume data. If you want to show what you've tried so far with OnFundamentalData() I'm happy to verify the technique.

    Best may be to manually calculate an average of volume, using your preferred averaging technique. This is not computationally expensive, even with CalculateOnBarClose = false. Any performance gains reducing minimum bars required from 20 bars to 10 is also negligible / unnoticeable.

    double myVolume = SMA(VOL(), 10)[0];
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi RyanM,

      I lifted the code for OnFundamentalData straight from the reference manual, so if it doesn't work I'm just going to assume IB doesn't support it.

      Thank you for the alternate average calculation. I'm not concerned with performance as much as I'm concerned about the amount of historical data that has to be loaded.

      Here's the odd thing. Even using the formula SMA(VOL(),10)[1], the strategy requires Days To Load to be at least 20. I can understand that happening with VOLMA(10)[1] because it's an exponential moving average, but SMA is a simple average. Why would it require twice as many bars as the size of the average? I'm sure there's nothing else in the code that looks back more than 10 bars.

      If you know why this is happening, please let me know. If you've never seen this before, it's not important enough to investigate. The workaround is simple: set Days To Load to 20. I'm trying to increase the number of symbols I can load before getting the dreaded "pacing problem" error.

      The other workaround, of course, is to upgrade to Kinetick, which will probably happen very soon.

      Comment


        #4
        Thanks for the reply. I see your motivation to reduce historical data requests now. If you're using daily bars, you could use the free connection to Kinetick to load this and wouldn't run into IB pacing limits. You can connect to both at the same time, and if Kinetick is first it will be used for daily charts.

        The strategy shouldn't require that minimum bars required is set to 20. You could set lower, but will typically want it set it to at least the largest lookback used for your indicator calculations.

        I've not seen where the strategy requires minimum bars setting of 20. Is it overwriting your input here?
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Actually, this is a multi-timeframe strategy with 3 timeframes: daily (goes back 10 days for avg volume, 2 days for price history, plus today); minute (goes back 10 bars); and minute for symbol DIA (also 10 bars). So I can't benefit from free Kinetick and I'm making IB grab at least 30 bars of history. The best I could hope for is to reduce that number to 22 by using fundamental data, and this issue is forcing me to pull in 40 bars (20 daily bars plus 10 1-min plus 10 1-min DIA).

          When I start the strategy with Min Bars Required set to less than 11 or Days To Load to less than 20, it will enable (there are some combinations of settings where it won't even enable), but it'll never qualify for a strategy, even when I loosen the entry conditions wide open. It's not overwriting the input, it's just not enabling, or it's enabling and not firing, based on the inputs I enter.

          Comment


            #6
            I see. Minimum bars required does need to be satisfied for all series in the strategy. I would check log tab of control center when it doesn't enter to see if there are any error messages.

            The best choice that I can see here is supplementing the IB connection with a data only provider like Kinetick, so that you're not running into pacing limits and can just focus on designing the strategy you want. You may be able to save a day or two here and there in your code, but it will be lot more convenient for you not having a download size restriction.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Hi RyanM,

              I agree. The best solution is to supplement the feed with Kinetick, which is what I just did. I've been messing with this all day and most of yesterday, so it's already cost me as much as a month's worth of Kinetick.

              As always, thanks for your help.

              Comment


                #8
                Great to hear. I'm sure it will work much better for you. Have a great day and please let us know if we can be of further assistance.
                Ryan M.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                647 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                368 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                108 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                571 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                573 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X