Hello,
is there a possibility to adjust the candle width (1, 2, 4 hours etc.)?
regards
You should be able to do this using pandas.DataFrame.resample() before passing the data into mpf.plot(). Let me know if you need more detail.
Additional information here: Resampling Time Series Data with Pandas
Hello Daniel,
tank you, DataFrame.resample() works great! I already coded a loop, but your way is better:
def adjust_candle_width(ticker_frame, sample_time='1D'):
adj_ticker_frame = ticker_frame.resample(sample_time).agg({
'Open': 'first',
'High': 'max',
'Low': 'min',
'Close': 'last',
'Volume': 'sum'
})
return adj_ticker_frame