Hi all,
I'm looking for a solution, maybe someone knows about something...
The ideal will be an EA that I can run everytime I open mt4.
The EA then automatically checks a provided list of instruments if all the data (M1 to H4 for example) is up to date.
The EA then downloads all new data from history center to make 100% sure all the historical data is up to date.
Lastly the data refreshes all the instruments (various timeframes) to make 100% sure every timeframe for every instrument (on selected list) is updated and refreshed.
I always need updated and refreshed data before I start running another EA and do analysis.
Kind Regards,
Peter
Try Freelance.
//+------------------------------------------------------------------+ //| RefreshMarketWatchSymbols.mq4 | //| nicholishen | //| https://www.forexfactory.com/nicholishen | //+------------------------------------------------------------------+ #property copyright "nicholishen" #property link "https://www.forexfactory.com/nicholishen" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { ENUM_TIMEFRAMES tfs[] = { PERIOD_M1, PERIOD_M5, PERIOD_M15, PERIOD_M30, PERIOD_H1, PERIOD_H4, PERIOD_D1, PERIOD_W1, PERIOD_MN1 }; for(int i=SymbolsTotal(true)-1; i>=0; --i) for(int j=ArraySize(tfs)-1; j>=0; --j) while(!IsStopped() && !is_ready(SymbolName(i, true), tfs[j])); } //+------------------------------------------------------------------+ bool is_ready(string symbol, ENUM_TIMEFRAMES tf) { ResetLastError(); int n = iBars(symbol, tf); if(GetLastError() != ERR_NO_ERROR || n <= 0){ Sleep(10); return false; } return true; }
Thank you, I'll give it a try!
Add a "RefreshRates();" after ResetLastError to make sure it updates
Hi Apursch or nicholi,
i have same problem too.....how to use the script ?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
I'm looking for a solution, maybe someone knows about something...
The ideal will be an EA that I can run everytime I open mt4.
The EA then automatically checks a provided list of instruments if all the data (M1 to H4 for example) is up to date.
The EA then downloads all new data from history center to make 100% sure all the historical data is up to date.
Lastly the data refreshes all the instruments (various timeframes) to make 100% sure every timeframe for every instrument (on selected list) is updated and refreshed.
I always need updated and refreshed data before I start running another EA and do analysis.
Kind Regards,
Peter