Closed Xxobster closed 1 year ago
Few things to check first:
Hi, thanks for your reply :)
Yes I confirm that I'm using UTC candles on both TV and MP.
I understand for the VA, but what about the POC? The difference is quite significant: TV: 26732 MP: 26439
If I understand correctly according to what's below (point 6.), the POC will change according to the VA's calculation?
Would that make sense to you to add the other way of calculating the VA and POC in your library? I can try to do it but I'm quite novice in py.
Here's some info about TV's calculations: Calculating Value Area (VA)
Source: https://www.tradingview.com/support/solutions/43000502040-volume-profile/
Yes I don't think the POC shouldn't be off that much, which is why I wondered about the TZ offset.
Two more points to consider:
Also, can you send me a gist or the code for the screenshot above? I'll run it on my side and dig around...
I'm not sure how to use the tick_size, it determines the size of the rows, right? I'm probably using it wrong. On TV you have 2 options, either Ticks per Row or Number of Rows. I usually use 200 rows but I've tried both and compared with your library. Eventually I don't know how to correlate with the tick_size.
Here are the code, the data in sqlite format and the export in sqlite format. It imports the db from the same directory, calculates and then exports into a db. MP_tests.zip
For 2023-06-06 for instance (tick_size = 10): TV POC: 26711 / 26880 with MP TV VAL: 25842 / 25650 with MP TV VAH: 27339 / 27020 with MP
It probably comes from my misunderstanding of the tick_size. Any idea how I could correlate TV's parameters with your library's parameters?
Apparently the tick size on Bybit exchange is 0.01 but even with this value the results are quite off.
The following settings are relevant and the defaults are listed below:
tick_size = 0.05
prices_per_row = 1
row_size = 0.05 * 1 = 0.05
Just estimating from the chart screenshot above (since the modal has the size covered up), it looks like there's somewhere between 18 to 20 rows per $100 (assuming 20 then row_size = 5
). So if you wanted to replicate the chart above, you would use the following settings:
tick_size = 5
prices_per_row = 1
or simply:
row_size = 5
Also, keep in mind whether the start/end timestamps are inclusive or exclusive (both with TV and this library). There's probably not much volume in that last 60 seconds, but good to match regardless.
Hi, thanks for your answer and for your explanations. I really appreciate that you're taking some time.
I've tried a lots of different values for both the TV indicator's parameters (number of rows, ticks per row) and the tick_size in order to find a match. I've noticed that when the spread of the day is short the values are very similar but as soon as the spread gets bigger, the difference is quite noticeable. At this point I still haven't figured out the reason.
I just have 2 more questions: So if I understand correctly, the smaller the row_size is the more precise the results are? Are you using this indicator in technical analysis?
Thanks again.
Sure no problem at all.
One possibility is that TV isn't using OHLCV data but rather raw tick data, or that TV is using a different period for the OHLCV data than in your CSV above. That could certainly lead to differences because the OHLCV is an approximation. One way to compare it would be to use a service that uses raw tick data to compute the POC/VA/etc (I know https://cignals.io does, for example).
Excellent, thanks for your reply :)
Hi,
First of all, thanks a million for the work. Amazing!
I'm using 1m candles from the Bybit exchange and when I compare the Volume Profile for a day with TradingView I'm getting different values, so I'm wondering what I'm doing wrong.
I've compared the candles and volume between my dataset and TV and they are the same.
Any help would be gladly appreciated :)
Thank you very much!
Here's the TV values:
And here's what I'm getting:
Here's the data that I'm using: BTCUSDT Bybit.csv