Open Price

 
double openprice0H1=iOpen(NULL,PERIOD_H1,0);

Print("0H1=",openprice0H1);


Open price of the current H1 open is returning an incorrect value of 2.0000000013102e-05.


Seems to happen on 1 symbol only, but displays the correct price on the chart.


Am I doing something wrong, broker problem or a bug?

 
double openprice0H1=iOpen(Symbol(),PERIOD_H1,0);

Please try and report back.

 

It works, Thank you.

Edit,

It did work, but again returning incorrect price.
 
double openprice0H1=iOpen(Symbol(),PERIOD_H1,0);
On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors before accessing prices.
          Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum

On MT5: Unless the chart is that specific pair/TF, you must Synchronize the terminal Data from the Server.
          Timeseries and Indicators Access /  Data Access - Reference on algorithmic/automated trading language for MetaTrader 5
          Synchronize Server Data with Terminal Data - Symbols - General - MQL5 programming forum

Reason: