hi
I’m downloading data from mt5, and traying to paint it correctly, but the high is under the others, so … does any one know why this happens?
def ML(symbol):
data3=[]
data3 =pd.DataFrame( mt5.copy_rates_from_pos(symbol, mt5.TIMEFRAME_M15, 0, tpd))
data_raw=data3
....
return variacion, diferencia_en_porcentaje, diferencia, data3, data_raw
....
variacion, diferencia_en_porcentaje, diferencia, data3, data_raw = ML(symbol)
....
data=data_raw
import plotly.graph_objects as go
from plotly.subplots import make_subplots
df = data
longitud=np.arange(len(df))
trace1 = go.Scatter(
x =longitud,
y = df['open'],
name='open',
marker=dict(
color='red'
)
)
trace2 = go.Scatter(
x =longitud,
y = df['high'],
name='high',
marker=dict(
color='black'
)
)
trace3 = go.Scatter(
x = longitud,
y = df['low'],
name='low',
marker=dict(
color='blue'
)
)
trace4 = go.Scatter(
x = longitud,
y = df['close'],
name='close',
marker=dict(
color='green'
)
)
fig = make_subplots(specs=[[{"secondary_y": True}]])
fig.add_trace(trace1)
fig.add_trace(trace2,secondary_y=True)
fig.add_trace(trace3)
fig.add_trace(trace4)
fig['layout'].update(height = 600, width = 800, title = symbol,xaxis=dict(
tickangle=-90
))
fig.update_layout(
title = 'Prizes for '+str(symbol),
xaxis_tickformat = '%d %B (%a)<br>%Y'
)
fig.show()