For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Binance data doesn't plot correctly
-
Trying to plot this data and it ends up not looking like the expected graph. I loaded it up in a csv viewer and my generated graph looks nothing like it. I'm assuming it's because I'm not plotting all of the data from the csv file, but I don't know how I would go about doing it without errors, please help.
Code sample:
btc = pd.read_csv( "D:\Projects\Algo\Data\BTCUSDT-1m-2022-04-27.csv", names = ['datetime', 'open', 'high', 'low', 'close', 'volume'], parse_dates = ['datetime'], date_parser = lambda d: pd.to_datetime(d).strftime('%Y-%m-%d %H:%M:%S'), ) data = bt.feeds.PandasData( dataname = btc, compression = 1, timeframe = bt.TimeFrame.Minutes, datetime = 0, open = 1, high = 2, low = 3, close = 4, volume = 5, openinterest = -1, ) cerebro.adddata(data) cerebro.run() cerebro.plot()
Data sample:
1651017600000,38112.64000000,38136.59000000,38080.85000000,38104.14000000,114.26374000,1651017659999,4354852.56207570,1283,50.22287000,1914106.74409190,0
Data explanation (from api docs):
[ [ 1499040000000, // Open time "0.01634790", // Open "0.80000000", // High "0.01575800", // Low "0.01577100", // Close "148976.11427815", // Volume 1499644799999, // Close time "2434.19055334", // Quote asset volume 308, // Number of trades "1756.87402397", // Taker buy base asset volume "28.46694368", // Taker buy quote asset volume "17928899.62484339" // Ignore. ] ]
-
@xeramph said in Binance data doesn't plot correctly:
date_parser = lambda d: pd.to_datetime(d).strftime('%Y-%m-%d %H:%M:%S')
Did you find any solution by any chance? I have the very same problem.