尝试为 Moonshot 找到 QuantRocket 'prices' 数据框的结构

Trying to find the structure of QuantRocket's 'prices' dataframe for Moonshot

我正在尝试将 QuantRocket 的 Moonshot 回测器与单独的数据源一起使用,我需要知道价格数据框的格式,以便创建自己的数据框。

我尝试 运行 QuantRocket 试用,但我无法获得历史价格,因为我没有付费的 Interactive Brokers 帐户,所以它基本上无法使用。

如有任何见解,我们将不胜感激。

您可以在 QuantRocket 的 usage guide 中看到许多示例 DataFrames。索引是Field和Date的Multiindex,列是ConIds(合约ID):

>>> prices.head()
ConId              13857203   13905344   13905462   13905522   13905624   \
Field Date
Close 2017-01-04    11150.0     3853.0     4889.0     4321.0     2712.0
      2017-01-05    11065.0     3910.0     4927.0     4299.0     2681.0
      2017-01-06    11105.0     3918.0     4965.0     4266.0     2672.5
      2017-01-10    11210.0     3886.0     4965.0     4227.0     2640.0
      2017-01-11    11115.0     3860.0     4970.0     4208.0     2652.0
...
Volume 2018-01-29   685800.0  2996700.0  1000600.0  1339000.0  6499600.0
       2018-01-30   641700.0  2686100.0  1421900.0  1709900.0  7039800.0
       2018-01-31   603400.0  3179000.0  1517100.0  1471000.0  5855500.0
       2018-02-01   447300.0  3300900.0  1295800.0  1329600.0  5540600.0
       2018-02-02   510200.0  4739800.0  2060500.0  1145200.0  5585300.0