如何在有相同日期但时间不同的行时获得一整天的盈利/损失
Unnamed: 0 open high low close volume Date time Profit Loss proforloss
0 0 252.70 254.25 252.35 252.60 319790 2022-01-03 09:15:00 0.000000 0.039573 -0.039573
1 1 252.60 253.65 251.75 252.80 220927 2022-01-03 09:30:00 0.079177 0.000000 0.079177
2 2 252.95 254.90 252.30 252.85 526445 2022-01-03 09:45:00 0.000000 0.039534 -0.039534
3 3 252.85 253.15 252.40 252.55 280414 2022-01-03 10:00:00 0.000000 0.118647 -0.118647
4 4 252.55 253.10 252.25 252.80 112875 2022-01-03 10:15:00 0.098990 0.000000 0.098990
这是给我的数据,我已经获得了15分钟时间范围的损益,但是我如何获得一天的开始时间为09:30:00,而关闭时间为15:00:00。 我如何也能获得最大的利润和最低利润。当资本为100,000时。
感谢您的帮助;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以首先在相关交易时间内过滤行,然后使用 groupby() 获得当天的最大收益。最后,用所需的体积乘以。
输出:
You could filter for rows during the relevant trading times first, then use
groupby()
to get the max / min profit of the day. Finally, multiply with the desired volume.Output: