How to make OHLC charts in plotly.
OHLC charts these are the charts describing open, high, low and close values for a given x coordinate. The tip of the lines represent the low and high values and the horizontal segments represent the open and close values. Sample points where the close value is higher (lower) then the open value are called increasing (decreasing). By default, increasing items are drawn in green whereas decreasing are drawn in red.
import plotly.graph_objects as go import pandas as pd
Sample_data = pd.read_csv("/content/Apple.csv") Sample_data.head()
fig = go.Figure(data=go.Ohlc(x=Sample_data['Date'], open=Sample_data['AAPL.Open'], high=Sample_data['AAPL.High'], low=Sample_data['AAPL.Low'], close=Sample_data['AAPL.Close'])) fig.update(layout_xaxis_rangeslider_visible=False) fig.show()