-
Notifications
You must be signed in to change notification settings - Fork 631
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
Beginner question: how do I group raw data to OHLC (in different time periods)? #209
Comments
Hi, you can look into https://github.com/tvjsx/trading-vue-js/blob/master/test/tests/Datasets.vue ( |
@C451 Many thanks for your quick reply. Your work here is awesome. 🙂 👍 I took a close look at the test and tried to understand how to get used with overlays. But this is indeed a bit tricky if you have never worked with Vue and TradingVue.js before.... I think I have set up the the Here is my progress so far: https://tvjs.io/play/?a=8br15mq9 |
I've done this project. Just want to give u some suggestions. I use thegraph to get the data, graphql is really fast and u dont have to store the data. Then aggr to ohlc by a manual foreach function (nodejs backend). |
@JohannesHoppe you need an overlay (with a script). But as @OnlyC mentioned, there are tons of ways to sample candles. |
@C451 Thanks for the input. I got it working with an overlay, but the solution changes several things. (the Y axis has no more numbers and the great overlays from Anyway, here is my updated playground, for all who are interested. The version works locally for me, but not online (see #210): @OnlyC Sharing is caring, isn't it? 😉 |
Description
I am not so familiar with the processing of financial data, so I hope for your patience. I have some data from Uniswap, every single trade is available. I want to group the raw data by different time frames to be able to display them in the TradingVue.js chart. As an example we can take this dead fake-pair:
https://app.astrotools.io/pair-explorer/0x97289c815c495e53ba1fa12c1fdfb61ad6a2867f
https://tools.unimonitor.io/#/pair-explore/0x97289c815c495e53ba1fa12c1fdfb61ad6a2867f
https://www.dextools.io/app/uniswap/pair-explorer/0x97289c815c495e53ba1fa12c1fdfb61ad6a2867f
So I actually need a function that aggregates the data into the OHLC format correctly. Ideally, of course, in different time frames (5, 10, 15 minutes, one hour...).
I found a promising library at valamidev/candlestick-convert. Unfortunately, it generates quite different output than on the above websites. You can see my first attempt in the demo. (unfortunately one candle is missing, there should be a total of 9 aggregated hours). 😞
How do you process raw data/ticks in JavaScript? Is there already a corresponding library I can use?
Demo
https://tvjs.io/play?a=hfht2hd0
Here you see 8 candles in my version:
But 9 candles on the other websites:
I would be very grateful if you could help me in any way! Many thanks in advance! 👍
The text was updated successfully, but these errors were encountered: