Closed SergejsBure closed 6 months ago
@SergejsBure Sergey, Thank you for your interest in using mplfinance.
To answer your questions: First, regarding moving averages, I recommend that you not calculate them yourself, but rather use mpf.plot()
kwargs mav=
and ema=
for simple and exponential moving averages respectively.
Each of these can be set to either a single number, or a tuple or list.
For example mav=50
for a single 50 period moving average, or mav=(30,60,90)
for three simple moving averages of 30, 60 and 90 periods respectively.
Secondly, since you are planning to use make_addplot()
for additional indicators, the I strongly recommend that you carefully read the addplot tutorial and pay particular attention to the section titled "Plotting additional data with a secondary y-axis" which is about half way down the page.
Let me know if these suggestions help.
Thank you, @DanielGoldfarb !
The problem was solved, by adding secondary_y
.
mpf.make_addplot(ydata["SMA"], width=0.5, panel=0, secondary_y=False)
I will use indicators, calculated by my own, whats why kwargs mav=
and ema=
don't suit me.
Sincerely yours, Sergey
I am a newbie in mplfinance. When I use make_addplot for adding Simple Moving Average (SMA) period 12 something strange is hapening. There is two y-axis on the chart with different numbers. I plan to add additional indicators, so I have started with SMA. There is a MA 200 on the chart, which shows normally.
Chart:![Chart_1](https://github.com/matplotlib/mplfinance/assets/122689345/1847d2d0-8f97-4575-a3ae-70d7cdb6ff7f)
Code:
Please, help to solve.