I try to do back testing on stock data using backtrading library in python. and I use this simple strategy
class CrossOver(bt.SignalStrategy):
def __init__(self):
sma=bt.ind.SMA(period=50)
price=self.data
crossover=bt.ind.CrossOver(price,sma)
self.signal_add(bt.SIGNAL_LONG,crossover)
Then I run it and try to plot it and display in streamlit
cerebro=bt.Cerebro()
cerebro.addstrategy(CrossOver)
cerebro.adddata(data)
cerebro.run()
pl=cerebro.plot()
st.pyplot(pl)
But I am not able to see the graph in streamlit. does anyone know how to display backtrader's graph in streamlit? thanks in advance.