Is it possible to generate an accurate volume profile in python that will have the same values as TradingView?

Viewed 70

I am working on a python script that would be able to produce Volume Profile (especially VAH/VAL values).

I am using the FTX API to get historical volume data. https://docs.ftx.com/#get-historical-prices

I am using a 15min timeframe, and I read on the TradingView blog that they are using 1-minute data. https://www.tradingview.com/support/solutions/43000502040-volume-profile/

    globalRegister = pd.DataFrame()
    #Scan every 8 hours, 480min, 28,800sec
    for a in range(20):
        if a == 0:
            globalRegister = self.api.get_historical_prices(market=self.marketname, start_time = time.time() - 28800, end_time = time.time(), resolution=timeFrame)
            globalRegister = pd.DataFrame(globalRegister)
            continue
        end_time = time.time() - ((a) * 28800)
        start_time = time.time()- ((a+1) * 28800)
        historical = self.api.get_historical_prices(market=self.marketname, start_time = start_time, end_time = end_time, resolution=timeFrame)
        historical = pd.DataFrame(historical)
        globalRegister = pd.concat([historical, globalRegister], ignore_index= True)
    print(globalRegister)
    return globalRegister

Later I am plugging this data into this library. https://github.com/bfolkens/py-market-profile

And yet the output I get is similar to the one on TradingView but it is not accurate enough, and sometimes my output is not matching at all.

Is it even possible to get the same results as on TradingView? I am really frustrated, and I would be really grateful for help :) Chart: https://www.tradingview.com/chart/?symbol=FTX%3ABTCPERP

0 Answers
Related