When i try to get values of current bar for multi symbols it returns 0.0
When
it returns 0.0 for some of the symbols but
When
all works fine,
Why should it be returning 0.0 for some symbols?
I also tried
but did not work
How can you can try to get it for multi symbol while _Symbol is returning only attached indicator current charts symbol.
? that is not explaining my question.
iHigh with _Symbol will return only current attached symbols High value. That will be different only if the indicator gets called by another indicator as buffer. But that is definitely is not the question asked by the topic starter.
? that is not explaining my question.
iHigh with _Symbol will return only current attached symbols High value. That will be different only if the indicator gets called by another indicator as buffer. But that is definitely is not the question asked by the topic starter.
//+------------------------------------------------------------------+ //| HighLow.mq5 | //| Copyright 2021, Dark Ryd3r | //| https://t.me/DarkRyd3r | //+------------------------------------------------------------------+ #property copyright "Copyright 2021, Dark Ryd3r" #property link "https://t.me/DarkRyd3r" #property version "1.00" #property indicator_chart_window int total = 0,shift = 0; double iH[],iL[]; string symbolsList[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { total = SymbolsTotal(true); ArrayResize(symbolsList, total); ArrayResize(iH, total); //--- indicator buffers mapping for(int i=0; i<total; i++) { symbolsList[i] = SymbolName(i,true); } //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //--- for(int i=0; i<total; i++) { iH[i] = iHigh(symbolsList[i],PERIOD_M1,0); // High Print("#"+(string)(i+1)+" "+symbolsList[i]+"| High : "+DoubleToString(iH[i],(int)SymbolInfoInteger(symbolsList[i],SYMBOL_DIGITS))+"."); } //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { //--- } //+------------------------------------------------------------------+
Now your calling is correct.
Those symbols don't have candlestick data. That is one of the issues of the MT4-MT5. Make sure you open that charts manually and candlesticks there. Then if you re run your code the data will be represented. So that timeframe + symbol must have the data and candlestick of that index.
Now your calling is correct.
Those symbols don't have candlestick data. That is one of the issues of the MT4-MT5. Make sure you open that charts manually and candlesticks there. Then if you re run your code the data will be represented. So that timeframe + symbol must have the data and candlestick of that index.
Thanks for your reply. if that is a MT5 issue, I am looking to solve this issue with any alternative, I cant open charts manually as this is for more than 100 symbols and MT5 only supports opening 100 charts max.
Thanks for your reply. if that is a MT5 issue, I am looking to solve this issue with any alternative, I cant open charts manually as this is for more than 100 symbols and MT5 only supports opening 100 charts max.
If the market watch pairs are not get updated that is commonly broker issue.
MetaTrader has no problems - users have a problem: no one wants to read the help.
Read the help: Organizing Data Access
Read the help : iHigh and especially pay attention to the fact that you SHOULD check the results!

- www.mql5.com
MetaTrader has no problems - users have a problem: no one wants to read the help.
Read the help: Organizing Data Access
Read the help : iHigh and especially pay attention to the fact that you SHOULD check the results!
MetaTrader has no problems - users have a problem: no one wants to read the help.
Read the help: Organizing Data Access
Read the help : iHigh and especially pay attention to the fact that you SHOULD check the results!
ERR_HISTORY_NOT_FOUND | 4401 | Requested history not found |
so i see this error, how can it be fixed, I am sure the chart has history and receiving ticks
When i check with CheckLoadHistory(), it confirms there are bars

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
When i try to get values of current bar for multi symbols it returns 0.0
When
barshift = 0;
it returns 0.0 for some of the symbols but
When
barshift = 1;
all works fine,
Why should it be returning 0.0 for some symbols?
I also tried
but did not work