Closed JohannesHoppe closed 3 years ago
Hi, you can look into https://github.com/tvjsx/trading-vue-js/blob/master/test/tests/Datasets.vue (npm run test
, the last one). I use the datasets feature to sample from trades there.
@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 data.json
properly. But I still don't understand how to activate the datasource in the chart. How do I do it without an additional overlay?
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. E.g. https://github.com/tvjsx/trading-vue-js/blob/master/src/helpers/sampler.js
@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 tvjs-overlays
don't get any more data either, unfortunately) I think it will really be the best solution to group the data manually and use the normal data-property until I have more deep knowledge.
Anyway, here is my updated playground, for all who are interested. The version works locally for me, but not online (see https://github.com/tvjsx/trading-vue-js/issues/210): https://tvjs.io/play/?a=8br15mq9
@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! 👍