mplfinance
mplfinance copied to clipboard
Feature Request: Ability to use `marketcolor_overrides` to set candle colors in multi-panel plots.
Is your feature request related to a problem? Please describe.
I'd like to be able to plot two panels of candles each colored differently. I am unable to use marketcolor_overrides to set candle color for make_addplot().
Describe the solution you'd like
Use marketcolor_overrides parameter to set candle color on other panels.
Describe alternatives you've considered Unaware of any alternatives to do this other than fiddling with external axes.
%matplotlib inline
import pandas as pd
import mplfinance as mpf
df = pd.read_csv('data/SPY_20110701_20120630_Bollinger.csv',index_col=0,parse_dates=True)
df.shape
fig = mpf.figure(figsize=(12,9))
ax1 = fig.add_subplot(2,2,1,style='yahoo')
ax2 = fig.add_subplot(2,2,2,style='yahoo')
mco = [None,None,'Yellow',None,None,'Blue',None,None,None,'Black']
mpf.plot(df.tail(10),
ax=ax1,
type='candle',
axtitle='candle',
xrotation=15
)
mpf.plot(df.tail(10),
type='candle',
ax=ax2,
axtitle='yahoo',
xrotation=15,
marketcolor_overrides=mco,
)
fig

@rterbush try this method
Yes, thank you @DrChandrakant . I figured out how to do this outside of mplf. My request is to allow doing this within mplf.