Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何从tick数据聚合到Kline蜡烛图 #3

Open
QGB opened this issue Jul 7, 2023 · 0 comments
Open

如何从tick数据聚合到Kline蜡烛图 #3

QGB opened this issue Jul 7, 2023 · 0 comments

Comments

@QGB
Copy link

QGB commented Jul 7, 2023

快速存储传入的实时时间序列数据,然后降低数据频率(即在每分钟结束时自动制作 1 分钟或任何周期蜡烛)并存储它

当一组新数据来自 websocket 时,循环遍历传入数据和符号,获取传入数据的时间戳,去掉分钟部分并使用该分钟作为键,更新字典中的参数。如果该分钟内没有 opn 的数据,则使用新的刻度更新所有字段。如果存在现有数据并且高于/低于字典中的高/低字段,也更新它们。最后,始终用新的报价更新收盘价。所以你有实时蜡烛。假设您处于 920 分钟,当新报价的时间戳的分钟部分为 921 时,它将自动切换到 921 蜡烛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant