Why do I get wrong this?

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()

Hi, check the dtype of your columns, might be string instead of numeric or datetype.

But maybe I don’t understand the question correctly.

Hi, sorry, I didn’t made the q propperly:

the data is this:

           time      open      high       low     close  tick_volume  spread  real_volume
0    1683698400  27630.14  27660.48  27620.16  27654.21          817   11397            0
1    1683699300  27654.93  27670.98  27623.78  27629.05          755   11397            0
2    1683700200  27629.05  27660.76  27598.39  27653.31          804   11397            0
3    1683701100  27653.32  27677.64  27627.42  27639.51          768   11397            0
4    1683702000  27638.90  27645.99  27619.28  27630.53          715   11397            0
..          ...       ...       ...       ...       ...          ...     ...          ...
995  1684595700  26861.01  26896.79  26844.60  26876.58          663   11397            0
996  1684596600  26876.59  26881.04  26850.13  26852.27          624   11397            0
997  1684597500  26854.10  26859.60  26841.72  26845.73          508   11397            0
998  1684598400  26844.84  26869.65  26830.77  26836.11          558   11397            0
999  1684599300  26835.83  26846.30  26829.19  26829.83          274   11397            0

but the plot shows wrong:

I don’t understand that of the dtype … (data is shown)?

I’m not very sure of what this means, can the problem be here?:

fig = make_subplots(specs=[[{"secondary_y": True}]])
          
                fig.add_trace(trace2,secondary_y=True)

yes … deleting specs was sufficient to make it work.