Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. import plotly
  2. import plotly.graph_objs as go
  3. from plotly.offline import iplot
  4. from plotly import tools
  5. plotly.offline.init_notebook_mode()
  6.  
  7. trace1 = go.Scatter(x=indicators_df.index,y=indicators_df['close'],name = 'AAPL')
  8. trace2 = go.Scatter(x=indicators_df.index,y=indicators_df['ema'],name = 'EMA')
  9. trace3 = go.Scatter(x=indicators_df.index,y=indicators_df['aroon'],name = 'Aroon')
  10. trace4 = go.Scatter(x=indicators_df.index,y=indicators_df['rsi'],name = 'RSI')
  11.  
  12. fig = tools.make_subplots(rows=3, cols=1, print_grid=False,shared_xaxes=True,vertical_spacing=0.01)
  13.  
  14. fig.append_trace(trace1, 1, 1)
  15. fig.append_trace(trace2, 1, 1)
  16. fig.append_trace(trace3, 2, 1)
  17. fig.append_trace(trace4, 3, 1)
  18.  
  19. fig['layout'].update(height=800, width=1000, title='Price and technical indicators ' )
  20.  
  21. iplot(fig, filename='Trading simulator')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement