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: Horizontal Lines in add subplot #215

Closed
strikar21 opened this issue Jul 16, 2020 · 2 comments
Closed

Feature Request: Horizontal Lines in add subplot #215

strikar21 opened this issue Jul 16, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@strikar21
Copy link

strikar21 commented Jul 16, 2020

Is your feature request related to a problem? Please describe.
image

Describe the solution you'd like
i know rsi plots fine using the addsublpot method and fetching data from DataFrame.
however if i wanted to plot overbought/ oversold zones being represented with horizontal lines.
the lines dont match up with the rsi levels.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
image

if i try to plot 20/80 as over sold and overbought zones.

@strikar21 strikar21 added the enhancement New feature or request label Jul 16, 2020
@DanielGoldfarb
Copy link
Collaborator

DanielGoldfarb commented Jul 16, 2020

duplicate of #140

In the meantime, there is an easy workaround for this (which it looks like you have attempted, but you may need to add secondary_y=False to get it to look right).

If df is your dataframe containing OHLCV data, then

df['rsi_overbought'] = [80.]*len(df)
df['rsi_oversold']   = [20.]*len(df)
ap = mpf.make_addplot(df[ ['rsi_overbought','rsi_sold'] ], secondary_y=False)
mpf.plot(df,...,addplot=ap)

HTH. Thanks. --Daniel

@strikar21
Copy link
Author

duplicate of #140

In the meantime, there is an easy workaround for this (which it looks like you have attempted, but you may need to add secondary_y=False to get it to look right).

If df is your dataframe containing OHLCV data, then

df['rsi_overbought'] = [80.]*len(df)
df['rsi_oversold']   = [20.]*len(df)
ap = mpf.make_addplot(df[ ['rsi_overbought','rsi_sold'] ], secondary_y=False)
mpf.plot(df,...,addplot=ap)

HTH. Thanks. --Daniel

Thanks a Ton.
Works great.

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