//+------------------------------------------------------------------+ //| ShowTime.mq4 Place in emplty chart to show time to candle close | //| You may also wish to make a template with all parameters set so | //| all colors are same as background. So as to only show clock. | //| Copyright © 2006 Accrete LLC. www.accrete.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006 Accrete LLC." #property link "http://www.accrete.com" #property indicator_separate_window double s1[]; string ln_txt[13], buff_str = ""; int nTime = 0, CurPeriod = 0, nDigits = 0, i = 0; int init() { IndicatorShortName("ATM_ShowTime"); return(0); } int start() { double g; int m,s,k; m=Time[0]+Period()*60-CurTime(); g=m/60.0; s=m%60; m=(m-m%60)/60; g=NormalizeDouble(g,1); for (k=1;k<=Bars-1;k++) s1[k]=0.0000001; for (k=1;k<=2;k++) s1[k]=g; ObjectCreate("lab6", OBJ_LABEL, WindowFind("ATM_ShowTime"), 0, 0); ObjectSetText("lab6",DoubleToStr(m,-4),20, "Arial Bold", Aqua); ObjectSet("lab6", OBJPROP_CORNER, 0); ObjectSet("lab6", OBJPROP_XDISTANCE, 90); ObjectSet("lab6", OBJPROP_YDISTANCE, 20); ObjectCreate("lab8", OBJ_LABEL, WindowFind("ATM_ShowTime"), 0, 0); ObjectSetText("lab8","Candle CLose in ", 9, "Arial Bold", Black); ObjectSet("lab8", OBJPROP_CORNER, 0); ObjectSet("lab8", OBJPROP_XDISTANCE, 65); ObjectSet("lab8", OBJPROP_YDISTANCE, 0); ObjectCreate("lab9", OBJ_LABEL, WindowFind("ATM_ShowTime"), 0, 0); ObjectSetText("lab9"," Minutes", 9, "Arial Bold", Black); ObjectSet("lab9", OBJPROP_CORNER, 0); ObjectSet("lab9", OBJPROP_XDISTANCE, 85); ObjectSet("lab9", OBJPROP_YDISTANCE, 50); //End Data Window //---- End Of Program return(0); } //+------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Series array that contains open time of each bar
Indicator Curves created:
Indicators Used:
Custom Indicators Used:
Order Management characteristics:
Other Features: