May-08-2023, 09:19 AM
What I don't quite understand is if I just use this part of the code you wrote:
def calc_max(): pair = 'BTC/USD' interval = 15 # make the API request for OHLC data ohlc_data = api.query_public('OHLC', {'pair': pair, 'interval': interval}) # Convert the data to a pandas dataframe df = pd.DataFrame(ohlc_data['result'][pair], columns=['time', 'open', 'high', 'low', 'close', 'vwap', 'volume', 'count']) df['time'] = pd.to_datetime(df['time'], unit='s') df.set_index('time', inplace=True) max_price = df['high'].max() print(f"Maximum price in the <high column>: {max_price}") if __name__ == '__main__': calc_max() #calc_pair_price()That I get the very same number without any of my code. I'm sorry if this is a dumb observation.