Download MetaTrader 5

script stop working after updates

To add comments, please log in or register
YellowCat
135
YellowCat 2014.02.21 16:04 

Hi, after the recent updates in mt4 one script I've been using for 2 years now doesn't work anymore. The script prints server time on charts and I used it to check by eyes if the price is updated to the current time, if server time on chart is not matching computer clock time then I know some disconnection occurred (I live in a place with bad connection). Can some one help me to understand what's wrong? Thanks



//+------------------------------------------------------------------+
//|                                                   ServerTime.mq4 |
//|                                      Copyright © 2005, komposter |
//|                                      mailto:komposterius@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, komposter"
#property link      "mailto:komposterius@mail.ru"

#property indicator_chart_window

extern color TextColor = Black;
//----

int init()
  {
                  ObjectCreate( "ServerTime", OBJ_LABEL, 0,0,0,0,0,0,0);
                  ObjectSet( "ServerTime", OBJPROP_CORNER, 0);
                  ObjectSet( "ServerTime", OBJPROP_XDISTANCE, 0);
                  ObjectSet( "ServerTime", OBJPROP_YDISTANCE, 12);
                  ObjectSetText(  "ServerTime", "", 12, "Arial", TextColor);
    return(0);
  }
//----
int deinit() 
  { 
    ObjectDelete("ServerTime"); 
    return(0); 
  }
//----
int start() 
  { 
    ObjectSetText("ServerTime", TimeToStr( CurTime(), TIME_SECONDS ), 12, "Arial", TextColor ); 
    return(0); 
  }
//+------------------------------------------------------------------+


Simon Gniadkowski
Moderator
18003
Simon Gniadkowski 2014.02.21 16:13  
yellowcat:

Hi, after the recent updates in mt4 one script I've been using for 2 years now doesn't work anymore. The script prints server time on charts and I used it to check by eyes if the price is updated to the current time, if server time on chart is not matching computer clock time then I know some disconnection occurred (I live in a place with bad connection). Can some one help me to understand what's wrong? Thanks

You didn't actually say what your issue/malfunction is ?

CurTime() has been Obsolete for a long time . . . you shouldn't be using it, see if changing it to TimeCurrent() helps . . .
whroeder1
14756
whroeder1 2014.02.21 16:31  
"Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
Alain Verleyen
Moderator
31167
Alain Verleyen 2014.02.21 16:46  
yellowcat:

Hi, after the recent updates in mt4 one script I've been using for 2 years now doesn't work anymore. The script prints server time on charts and I used it to check by eyes if the price is updated to the current time, if server time on chart is not matching computer clock time then I know some disconnection occurred (I live in a place with bad connection). Can some one help me to understand what's wrong? Thanks


What is the background color of your chart ?
To add comments, please log in or register