python中的订单手册及时可视化

发布于 2025-02-01 20:25:10 字数 956 浏览 2 评论 0原文

我有每次瞬间描述限制订单簿分布的订单的市场数据,我想像一种热图一样绘制,类似于 bookmap软件。 目前,我的数据存储在熊猫的数据框架中,如下:

df.head()

            date type     price     amount
0  1618417260072    b  0.144202     9.3675
1  1618417260072    b  0.144201    18.1250
2  1618417260072    b  0.143937     4.6692
3  1618417260072    b  0.143898   253.2957
4  1618417260072    b  0.143896  2607.5407

df.tail()

          date type     price   amount
2793578  1618531145215    a  0.158781   5.9798
2793579  1618531145215    a  0.158782  28.8190
2793580  1618531145215    a  0.158795   4.6692
2793581  1618531145215    a  0.158938   3.9173
2793582  1618531145215    a  0.158950   2.4963

数据框是时间订购的,这意味着我有第一个时间戳记,首先是购买订单,其次是以各自价格的卖出订单 - 级别和金额,然后我有第二个时间戳,然后卖出,等等... 总结我想要的绘制方式是: x =时轴 y =价格轴 z =音量轴(通过热图或线的宽度增加,含义更高的体积按顺序) 在此图表中,我想查看数据框架的每个价格级别的信息。

I have market data of the orders describing the limit order book distribution at each time instant and I'd like to plot it like a kind of heatmap similar to the one of the BookMap Software.
Currently my data are stored in a pandas dataframe like the following:

df.head()

            date type     price     amount
0  1618417260072    b  0.144202     9.3675
1  1618417260072    b  0.144201    18.1250
2  1618417260072    b  0.143937     4.6692
3  1618417260072    b  0.143898   253.2957
4  1618417260072    b  0.143896  2607.5407

df.tail()

          date type     price   amount
2793578  1618531145215    a  0.158781   5.9798
2793579  1618531145215    a  0.158782  28.8190
2793580  1618531145215    a  0.158795   4.6692
2793581  1618531145215    a  0.158938   3.9173
2793582  1618531145215    a  0.158950   2.4963

The dataframe is time-ordered, meaning I have the first timestamp with first the buy orders and secondly the sell orders with their respective price-level and amount, then I have the second timestamp with buy then sell and so on...
To summarize the way I want it plotted is:
x= time axis
y= price axis
z= volume axis (through heatmap or increasing width of the line meaning higher volume in order)
and in this chart I'd like to see the information of each price level of the dataframe.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文