使用finplot,这很容易:
import finplot as fplt
import yfinance
df = yfinance.download('GOOG')
ax = fplt.create_plot('Alphabet 1D')
fplt.candlestick_ochl(df[['Open', 'Close', 'High', 'Low']], ax=ax)
# create a ribbon around MA200/50
df['ma200'] = df.Close.rolling(200).mean()
df['ma50'] = df.Close.rolling(50).mean()
df['one'] = 1
fplt.volume_ocv(df[['ma200','ma50','one']], candle_width=1, ax=ax.overlay(scale=0.1))
fplt.show()
免责声明:我是 finplot 的作者。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句