Мой код выглядит следующим образом:
Код: Выделить всё
if __name__ == '__main__':
df = pd.read_csv('GBPUSD_MA_Crossover2.csv', index_col=0, parse_dates=True)
df.index.name = 'date'
threshold = 20
upper_threshold = [threshold] * len(df)
lower_threshold = [0-threshold] * len(df)
apds = [ mpf.make_addplot(df[['fast_ma', 'slow_ma']], panel=0, title='GBPUSD'),
mpf.make_addplot((df['dmi']),panel=1, title='DMI'),
mpf.make_addplot(upper_threshold, panel=1),
mpf.make_addplot(lower_threshold, panel=1)
]
mpf.plot(df, type= 'candle', tight_layout=True, datetime_format='%Y-%m-%d',
volume=False, show_nontrading=False, addplot=apds)
Подробнее здесь: https://stackoverflow.com/questions/787 ... inace-plot