How can i check that data is bad

 
Hi, After some hours MetaTrader Terminal stops refreshing data (Ask, Bid, and TimeCurrent) IsConnected always return true, GetLastError always return 0 How can i check that data is bad? (Sorry for bad english) Best regards Rafal
 

Attach a script to a chart with this code:

datetime priorTime, currentTime, priorLocalTime;

int seconds = 60; // this value is the maximum seconds for "no new price received from server"

int start(){

Comment("Server Monitor script is RUNNING");

while (!IsStopped()){

if(priorTime != TimeCurrent()) {

priorTime = TimeCurrent();

priorLocalTime = TimeLocal();

}

if(TimeLocal() - priorLocalTime > 60){

Alert("No Price Refresh for over " + seconds + " seconds");

priorLocalTime = TimeLocal();

}

Sleep(1000);

}

Comment("Server Monitor script is STOPPED");

return(0);

}

 
song bookmark
Reason: