Click or drag to resize

Historical data

Interactive Brokers provides historical candles, which can be used for testing, and to initialize the indicators. Interactive Brokers places data download limits. Data may download correctly and throw errors due to these limits. Consider specifically handling such error (known as pacing errors).

Work with historical candles

  1. In order to get historic candles, call SubscribeCandles method:

    C#
    var series = new CandleSeries
    {
        CandleType = typeof(TimeFrameCandle),
        Security = SelectedSecurity,
        Arg = InteractiveBrokersTimeFrames.Minute1
    };
    Trader.SubscribeCandles(series, DateTime.Today.Subtract(TimeSpan.FromDays(30)), DateTime.Now);
  2. Historical candles passed through the CandleSeriesProcessing event:

    C#
    Trader.CandleSeriesProcessing += ProcessCandle;
  3. Appeared candles can be drawn through the graphical control:

    ib history
See Also

Other Resources