//+------------------------------------------------------------------+ //| Сhart_bring_to_top.mq5 | //| Copyright © 2016, Vladimir Karputov | //| http://wmua.ru/slesar/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2016, Vladimir Karputov" #property link "http://wmua.ru/slesar/" #property version "1.01" #property description "The indicator switches all open charts after a certain interval." //--- входной параметр //--- input parameter input uchar Seconds_=3; // интервал // interval //--- bool IsCicle=false; // true - в цикле // true - in cicle //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- create timer if(Seconds_<3) { MessageBox("Interval must be greater than 3 seconds"); EventSetTimer(3); } else EventSetTimer(Seconds_); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- destroy timer EventKillTimer(); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { //--- if(IsCicle) return; IsCicle=true; //--- uchar temp_second; if(Seconds_<3) temp_second=3; // variables for chart ID long currChart,prevChart=ChartFirst(); //--- Показываем первый график //--- Show the first chart ChartBringToTop(prevChart); Sleep((int)MathAbs(temp_second*1000)); int i=0,limit=100; //Print("ChartFirst = ",ChartSymbol(prevChart)," ID = ",prevChart); // У нас наверняка не больше 100 открытых графиков // We have certainly not more than 100 open charts while(i