In [ ]:
#load "QuantConnect.csx"
var qb = new QuantBook();
// Selecting asset data
var spy = qb.AddEquity("SPY");
var eur = qb.AddForex("EURUSD");
var btc = qb.AddCrypto("BTCUSD");
var fxv = qb.AddData<FxcmVolume>("EURUSD_Vol", Resolution.Hour);
We can use the QuantConnect API to make Historical Data Requests. The data will be presented as multi-index pandas.DataFrame where the first index is the Symbol.
For more information, please follow the link.
In [ ]:
// Gets historical data from the subscribed assets, the last 360 datapoints with daily resolution
var h1 = qb.History(qb.Securities.Keys, 360, Resolution.Daily);
Console.WriteLine(string.Join(",", h1.SelectMany(slice => slice.Keys).Distinct()))