Импорт данных в Quantbase
C#
Загрузить и сохранить данные в QuantBase можно следующим скриптом:
Код
using System;
using OpenQuant.API;
public class LoadHistoryQB : Script
{
[Parameter]
public string Instrument = "AAPL";
[Parameter]
public string Provider = "IQFeed";
public override void Run()
{
= InstrumentManager.Instruments[Instrument];
Instrument instrument
// Load 1 minute bars.
= DataManager.GetHistoricalBars(Provider, instrument, DateTime.Now.Date, DateTime.Now, 60);
BarSeries barSeries
// Save bars.
foreach (Bar bar in barSeries)
.Add(instrument, bar);
DataManager
.WriteLine("Loaded and added {0} bars", barSeries.Count);
Console}
}