//+------------------------------------------------------------------+ //| #OTCFX b-clock.mq4 | //| Core time code by Nick Bilak | //| http://metatrader.50webs.com/ beluck[at]gmail.com | //| modified by adoleh2000 and dwt5 | //| Modified and improved by "OTCFX" | //| //| | | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, Nick Bilak" #property link "http://metatrader.50webs.com/" #property indicator_chart_window #property indicator_color1 Aqua extern color BClockClr = Aqua; extern color Clk2Color = Lime; extern int clkcorner =3; extern string myFont = "Arial Bold" ; extern string myFont2 = "Arial" ; extern int myFontSize = 30 ; int TimeFrame = 0 ; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { switch(TimeFrame) { case 1 : string TimeFrameStr="M1" ; break; case 5 : TimeFrameStr= "M5" ; break; case 15 : TimeFrameStr= "M15"; break; case 30 : TimeFrameStr= "M30"; break; case 60 : TimeFrameStr= "H1" ; break; case 240 : TimeFrameStr= "H4" ; break; case 1440 : TimeFrameStr= "D1" ; break; case 10080 : TimeFrameStr= "W1" ; break; case 43200 : TimeFrameStr= "MN1"; break; default : TimeFrameStr= "CurrTF"; } //if (TimeFrame<Period()) TimeFrame=Period(); return(0); } return(0); int deinit() { ObjectDelete("time"); ObjectDelete("time1"); ObjectDelete("T1"); return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int t=0; double i; int m,s,k; m=Time[0]+Period()*60-CurTime(); i=m/60.0; s=m%60; m=(m-m%60)/60; Comment( m + " minutes " + s + " seconds left to bar end"); ObjectDelete("time"); if(ObjectFind("time") != 0) { ObjectCreate("time", OBJ_TEXT, 0, Time[0], Close[0]+ 0.0005); ObjectSetText("time", " <"+m+":"+s, 9, myFont2, BClockClr); } else { ObjectMove("time", 0, Time[0], Close[0]+0.0005); //} //ObjectCreate("time1", OBJ_TEXT, 0, Time[0], Close[0]+ 0.0005); ObjectSetText("time1", " <"+m+":"+s, myFontSize, myFont2 , Clk2Color); } { string P=Period(); ObjectCreate("time1", OBJ_LABEL, 0, 0, 0); ObjectSetText("time1"," "+m+"m : "+s , myFontSize, myFont ,Clk2Color); ObjectSet("time1", OBJPROP_CORNER,clkcorner); //ObjectMove("time1", 0, Time[0], Close[0]+0.0005); ObjectSet("time1", OBJPROP_XDISTANCE, 10); ObjectSet("time1", OBJPROP_YDISTANCE,10 ); ObjectCreate("T1", OBJ_LABEL, 0, 0, 0); ObjectSetText("T1",StringSubstr( (P),0),myFontSize, "Verdana", Clk2Color); ObjectSet("T1", OBJPROP_CORNER, clkcorner); ObjectSet("T1", OBJPROP_XDISTANCE, 70); ObjectSet("T1", OBJPROP_YDISTANCE, 70); } return(0); } //+------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Series array that contains open time of each bar
Series array that contains close prices for each bar
Indicator Curves created:
Indicators Used:
Custom Indicators Used:
Order Management characteristics:
Other Features: