I am trying to add marker's in scatter plot if [df['signals1'] == -1] in ploltly.But the markers are not getting added.
df['signals1'].head(10)
Date Signals
2021-06-04 -1
2021-06-07 -1
2021-06-08 -1
2021-06-09 -1
2021-06-10 -1
2021-06-11 -1
2021-06-14 -1
2021-06-15 -1
2021-06-16 -1
2021-06-17 -1
Code-
fig = go.Figure(data = [
go.Scatter(x=df.index, y=[df['signals1'] == -1], mode = 'markers',
marker =dict(symbol='triangle-down', size = 16),
name='Flag')])
In matplotlib, below code is working fine.
u1, = bx.plot(df['Close'][df['signals1'] == -1], lw=0, marker='^', markersize=8, c='g',alpha=0.7)
Ref link -https://medium.com/analytics-vidhya/statistical-arbitrage-with-pairs-trading-and-backtesting-ec657b25a368