我有带有 OHLC 和 DateTime 数据的 CSV,数据是用 1 分钟的条形图采样的,我想计算不同时间范围的 VWAP。如何索引框架以获取特定日期内的所有时间?
let csv_temp = Frame.ReadCsv<DateTime>(filepath, indexCol ="Date and Time")
然后
(csv_temp?Close * csv_temp?Volume)
这给了我:
1/2/2013 9:31:00 AM -> 65088
1/2/2013 9:32:00 AM -> 4432997.7
1/2/2013 9:33:00 AM -> 1407412.375
1/2/2013 9:34:00 AM -> 918077
1/2/2013 9:35:00 AM -> 1037200.32
1/2/2013 9:36:00 AM -> 1464104.6
1/2/2013 9:37:00 AM -> 1179067.16
1/2/2013 9:38:00 AM -> 1416311.45
1/2/2013 9:39:00 AM -> 1893821.16
1/2/2013 9:40:00 AM -> 521449.4442
1/2/2013 9:41:00 AM -> 656896.779
1/2/2013 9:42:00 AM -> 518200.425
1/2/2013 9:43:00 AM -> 1327152.28
1/2/2013 9:44:00 AM -> 1035047.64
1/2/2013 9:45:00 AM -> 1133165.55
... -> ...
4/10/2015 3:46:00 PM -> 1284412.341
4/10/2015 3:47:00 PM -> 900809.43
4/10/2015 3:48:00 PM -> 542263.54
4/10/2015 3:49:00 PM -> 393960.84
4/10/2015 3:50:00 PM -> 1395440.96
4/10/2015 3:51:00 PM -> 1927824.3
4/10/2015 3:52:00 PM -> 1458494.1
4/10/2015 3:53:00 PM -> 1092189.57
4/10/2015 3:54:00 PM -> 1675165.38
4/10/2015 3:55:00 PM -> 987443.275
4/10/2015 3:56:00 PM -> 1519896.625
4/10/2015 3:57:00 PM -> 1100833.68
4/10/2015 3:58:00 PM -> 1216154.3
4/10/2015 3:59:00 PM -> 1648792.64
4/10/2015 4:00:00 PM -> 5523283.36
我想要类似的东西:
(csv_temp?Close * csv_temp?Volume).GetRowsWith(DateTime(2013,1,2))
然后将不同时间跨度的数据分块来计算平均值?
这可能吗?
谢谢!