Skip to content

Instantly share code, notes, and snippets.

@SajidLhessani
Created August 27, 2021 21:12
Show Gist options
  • Select an option

  • Save SajidLhessani/25fb28278fe0acc09b23d737d3751b01 to your computer and use it in GitHub Desktop.

Select an option

Save SajidLhessani/25fb28278fe0acc09b23d737d3751b01 to your computer and use it in GitHub Desktop.
#declare figure
fig = go.Figure()
#Set up traces
fig.add_trace(go.Candlestick(x=df.index,
open=df['Open'],
high=df['High'],
low=df['Low'],
close=df['Close'], name = 'market data'))
# Add titles
fig.update_layout(
title='Tesla price',
yaxis_title='Stock Price (USD per Shares)')
# X-Axes
fig.update_xaxes(
rangeslider_visible=True,
rangeselector=dict(
buttons=list([
dict(count=1, label="30m", step="minute", stepmode="backward"),
dict(count=6, label="90m", step="minute", stepmode="backward"),
dict(count=1, label="HTD", step="hour", stepmode="todate"),
dict(step="all")
])
)
)
#Show
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment