As it turns out, I misunderstood how the backtesting works. It's loading data from the file system, so you actually need to download this from somewhere. I set up a debug project so I could get command line output from the QuantBook object and it complained about some missing files in the data folder, which, apart from some example data, is empty.
So for a local research environment, you'll need to get the data from somewhere else. Maybe someone from QC would be nice enough to provide assistance with how to get the file format right as the data seems to be stored as csvs in zip files.
As a proof of concept, I proceeded to download some forex data from FXCM via the QC data page. I can load it from my test program like this
using QuantConnect.Jupyter;
namespace JupyterDebug
{
class Program
{
static void Main(string[] args)
{
QuantBook qb = new QuantBook();
qb.AddForex("EURUSD");
var test = qb.History(180, QuantConnect.Resolution.Minute);
Console.Out.WriteLine(test.Repr());
Console.Out.WriteLine(test.Length().ToString());
Console.ReadKey();
}
}
}
Which prints out some data. Unfortunately, trying to replicate it in the notebook, I get the following error:
int() argument must be a string or a number, not 'String[]'
trying to call this:
h1 = qb.History(30, Nullable[Resolution](Resolution.Minute))
Playing around a little with error messages (I haven't been able to find out how to debug when triggering code from the notebook, attaching to python.exe didn't work) I found that the error apparently happens in the function
public PyObject GetDataFrame(IEnumerable<Slice> data)
{
var maxLevels = 0;
var sliceDataDict = new Dictionary<Symbol, PandasData>();
foreach (var slice in data)
{
foreach (var baseData in slice.Values)
{
PandasData value;
if (!sliceDataDict.TryGetValue(baseData.Symbol, out value))
{
sliceDataDict.Add(baseData.Symbol, value = new PandasData(baseData));
maxLevels = Math.Max(maxLevels, value.Levels);
}
value.Add(baseData);
}
}
using (Py.GIL())
{
if (sliceDataDict.Count == 0)
{
return _pandas.DataFrame();
}
var dataFrames = sliceDataDict.Select(x => x.Value.ToPandasDataFrame(_pandas, maxLevels));
return _pandas.concat(dataFrames.ToArray());
}
}
more specifically on the last line in the return statement in the ToArray function.
Since my original goal of messing with options is probably not gonna happen in the local environment for me as I don't have enough cash to burn for an adequate data provider, I will probably leave it at that, but I'd still be interested in getting at least the proof-of-concept to work just for kicks.