Clock Indicator For MT5
Table Of Contents:
- Clock Indicator For MT5
- Installing the Clock Indicator For MT5
- Parameters of the Clock Indicator For MT5
- Buffers of the Clock Indicator For MT5
- Main Parts Of The Code
The Clock Indicator For MT5 shows you 3 relevant times. You will see the local time based on the settings of your computer. You will see the actual GMT time and you will see the time of the MT5 broker.
Installing the Clock Indicator For MT5
After you downloaded the indicator via the form above you need to unzip the zip-file. Then you need to copy the file clock.mq5 into the folder MQL5\Indicators of your MT5 installation. After that please restart MT5 and then you will be able to see the indicator in the list of indicators.
Parameters of the Clock Indicator For MT5
The Clock Indicator For MT5 has 9 parameters to configure.
input color Color1=clrBlue;//color of local time input color Color2=clrMagenta;//color of server time input color Color3=clrTeal;//color of GMT time input int FontSize=11; //font size input type_font FontType=Font14; //font type input ENUM_BASE_CORNER WhatCorner=CORNER_LEFT_LOWER; //location corner input uint Y_=20; //vertical location input uint X_=5; //horizontal location input string LableSirname="Clock 1";
Buffers of the Clock Indicator For MT5
The Clock Indicator For MT5 provides 0 buffers.
Main Parts Of The Code
int OnCalculate( const int rates_total, // amount of history in bars at the current tick const int prev_calculated,// amount of history in bars at the previous tick const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[] ) { //---- string sTime1,sTime2,sTime3; sTime1=TimeToString(TimeLocal(),TIME_SECONDS); sTime2=TimeToString(TimeCurrent(),TIME_SECONDS); sTime3=TimeToString(TimeGMT(),TIME_SECONDS); //---- SetTLabel(0,Lable1,0,WhatCorner,ENUM_ANCHOR_POINT(2*WhatCorner),X1,shift_1,"Local Time: ",Color1,sFontType,FontSize); SetTLabel(0,Lable1_,0,WhatCorner,ENUM_ANCHOR_POINT(2*WhatCorner),X2,shift_1,sTime1,Color1,sFontType,FontSize); SetTLabel(0,Lable2,0,WhatCorner,ENUM_ANCHOR_POINT(2*WhatCorner),X1,shift_2,"Brokers Time: ",Color2,sFontType,FontSize); SetTLabel(0,Lable2_,0,WhatCorner,ENUM_ANCHOR_POINT(2*WhatCorner),X2,shift_2,sTime2,Color2,sFontType,FontSize); SetTLabel(0,Lable3,0,WhatCorner,ENUM_ANCHOR_POINT(2*WhatCorner),X1,shift_3,"GMT: ",Color3,sFontType,FontSize); SetTLabel(0,Lable3_,0,WhatCorner,ENUM_ANCHOR_POINT(2*WhatCorner),X2,shift_3,sTime3,Color3,sFontType,FontSize); //---- ChartRedraw(0); //---- return(rates_total); } //+------------------------------------------------------------------+