text_plain_output_1.png
import pandas as pd

import plotly.graph_objects as go

data = pd.read_csv('/kaggle/input/ibex3519942020/IBEX-2021.csv')

import plotly.graph_objects as go
fig = go.Figure(data=go.Ohlc(x=data['Date'], open=data['Open'], high=data['High'], low=data['Low'], close=data['Close']))

data['SMA5'] = data.Close.rolling(5).mean()
data['SMA20'] = data.Close.rolling(20).mean()
data['SMA50'] = data.Close.rolling(50).mean()
fig = go.Figure(data=[go.Ohlc(x=data['Date'], open=data['Open'], high=data['High'], low=data['Low'], close=data['Close'], name='OHLC'), go.Scatter(x=data.Date, y=data.SMA5, line=dict(color='orange', width=1), name='SMA5'), go.Scatter(x=data.Date, y=data.SMA20, line=dict(color='green', width=1), name='SMA20'), go.Scatter(x=data.Date, y=data.SMA50, line=dict(color='blue', width=1), name='SMA50')])

data['EMA5'] = data.Close.ewm(span=5, adjust=False).mean()
data['EMA20'] = data.Close.ewm(span=20, adjust=False).mean()
fig = go.Figure(data=[go.Ohlc(x=data['Date'], open=data['Open'], high=data['High'], low=data['Low'], close=data['Close'], name='OHLC'), go.Scatter(x=data.Date, y=data.EMA5, line=dict(color='orange', width=1), name='EMA5'), go.Scatter(x=data.Date, y=data.EMA20, line=dict(color='green', width=1), name='EMA20')])
fig.show()