Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Ability to use marketcolor_overrides to set candle colors in multi-panel plots. #603

Open
rterbush opened this issue Apr 10, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@rterbush
Copy link

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.

@rterbush rterbush added the enhancement New feature or request label Apr 10, 2023
@DrChandrakant
Copy link
Contributor

%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

request

@rterbush try this method

@rterbush
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants