-
Notifications
You must be signed in to change notification settings - Fork 653
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
How to add Horizontal Line in make_addplot? make_addplot(rsi,panel='lower',color='g',hlines=[20,80]) #140
Comments
Presently all of the lines kwargs ( I was thinking to add a I will come up with something, and include it in my next pull request, which I hope to make by the end of this week. In the meantime you can accomplish a horizontal line on the lower panel by creating a sequence of data points all the same value, and passing that as the data for a different |
oh nice! Thanks for the advice ill do it. |
Done it! woot! apds = [mpf.make_addplot(buy_signal,scatter=True,markersize=100,marker='^'),
mpf.make_addplot(sell_signal,scatter=True,markersize=100,marker='v'),
mpf.make_addplot(close_signal,scatter=True,markersize=100,marker='o'),
mpf.make_addplot(line80,panel='lower',color='r'),
mpf.make_addplot(line20,panel='lower',color='g'),
mpf.make_addplot(rsi,panel='lower',color='g') ]
|
Nice chart! Thanks for sharing! |
@toksis, You should use apds = [mpf.make_addplot(buy_signal,scatter=True,markersize=100,marker='^'),
mpf.make_addplot(sell_signal,scatter=True,markersize=100,marker='v'),
mpf.make_addplot(close_signal,scatter=True,markersize=100,marker='o'),
mpf.make_addplot(line80,panel='lower',color='r',secondary_y=False),
mpf.make_addplot(line20,panel='lower',color='g',secondary_y=False),
mpf.make_addplot(rsi,panel='lower',color='g',secondary_y=False)
]
|
I have a few questions on this:
I prefer this method of adding horizontal or vertical lines as it's line with keeping all plots as some sort of series..as opposed to adding an argument to the plot or add_plot functions. It also helps when trying to write generic code for plotting any type of series. |
line80/line20 => a series of y values |
I have this code.
I want to put a horizontal line for my RSI. But there is a kwargs error which says hline is not found.
The text was updated successfully, but these errors were encountered: