Click or drag to resize

Historical data

OANDA provides historical candles, which can be used for testing, and to initialize the indicators.

Work with historical candles

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

    C#
    var tf = (TimeSpan)CandlesPeriods.SelectedItem;
    var series = new CandleSeries(typeof(TimeFrameCandle), SelectedSecurity, tf);
    _trader.SubscribeCandles(SelectedSecurity, DateTime.Now.Subtract(TimeSpan.FromTicks(tf.Ticks * 100)), DateTime.Now);
  2. Historical candles passed through the NewCandles event:

    C#
    _trader.NewCandles += ProcessNewCandles;
  3. Appeared candles can be drawn through the graphical control.

See Also

Other Resources