how to refresh symbol data - page 2

 
PS. On a side note. My mt4 is not always on. I only on my pc in the morning and use the script to scan all pairs.
 

use code below to get new data before scan it.


   bool   get_new_data =true;
   while(!IsStopped() && get_new_data) {
      get_new_data = false;
      RefreshRates();
      for(int i = 0; i < ArraySize(FX_Pairs); i++)
         if(Time[0]!=iTime(FX_Pairs[i],0,0)) {
         get_new_data = true;  
         }
      if(get_new_data) { Print("Waiting load data !"); Sleep(2000); }
   }
 
Trinh Dat:

use code below to get new data before scan it.


   bool   get_new_data =true;
   while(!IsStopped() && get_new_data) {
      get_new_data = false;
      RefreshRates();
      for(int i = 0; i < ArraySize(FX_Pairs); i++)
         if(Time[0]!=iTime(FX_Pairs[i],0,0)) {
         get_new_data = true;  
         }
      if(get_new_data) { Print("Waiting load data !"); Sleep(2000); }
   }

Thanks. I try that.

But refreshrates is only for current symbol only right? 

 
Dua Yong Rew:

Thanks. I try that.

But refreshrates is only for current symbol only right? 

No, i do not think so. let see it https://docs.mql4.com/series/refreshrates

RefreshRates - Timeseries and Indicators Access - MQL4 Reference
RefreshRates - Timeseries and Indicators Access - MQL4 Reference
  • docs.mql4.com
RefreshRates - Timeseries and Indicators Access - MQL4 Reference
 
Trinh Dat:

No, i do not think so. let see it https://docs.mql4.com/series/refreshrates

Maybe I got the wrong idea.

Thanks. Will try and let you all know the results. 

 
The code seems to work well. Will monitor for a few more days and let you all know the results. Thanks for all the help.
 
Trinh Dat: No, i do not think so. let see it https://docs.mql4.com/series/refreshrates
  1. Please use the link button (control-K.) Use the link button See the difference: https://docs.mql4.com/series/refreshrates
  2. The documentations says
    Refreshing of data in pre-defined variables and series arrays.
    The Predefined Variables - MQL4 Reference are
    _Digits, _Point, _LastError, _Period, _RandomSeed, _StopFlag, _Symbol, _UninitReason, Ask, Bars, Bid, Close[], Digits, High[], Low[], Open[], Point, Time[], Volume[].
    And those are only the current symbol.
RefreshRates - Timeseries and Indicators Access - MQL4 Reference
RefreshRates - Timeseries and Indicators Access - MQL4 Reference
  • docs.mql4.com
RefreshRates - Timeseries and Indicators Access - MQL4 Reference
 
whroeder1:
  1. Please use the link button (control-K.) See the difference: https://docs.mql4.com/series/refreshrates
  2. The documentations says The Predefined Variables - MQL4 Reference are And those are only the current symbol.

So I'm right. Refresh rates work on current symbol. 

 
Dua Yong Rew:

So I'm right. Refresh rates work on current symbol. 

Maybe, but try to delete it from code above then you see problem.
 
Trinh Dat:
Maybe, but try to delete it from code above then you see problem.
Will try it out
Reason: