www.pudn.com > RedbinaryoptionsDL.zip > BarTimer_BO.mq4, change:2013-04-15,size:2586b


//+------------------------------------------------------------------+ 
//|                                                     BarTimer.mq4 | 
//|                               Copyright ゥ 2008, Art Royal s.r.o. | 
//|                                           Author: Vasyl Gumenyak |   
//|                                           http://www.jiport.com/ | 
//+------------------------------------------------------------------+ 
#property copyright "Copyright ゥ 2008, Art Royal s.r.o." 
#property link      "http://www.jiport.com/" 
#property indicator_chart_window 
#property indicator_buffers 0 
extern string FontName="Arial"; 
extern int FontSize=14; 
extern color FontColor=White; 
extern int Corner=0;// values [0-3] - ⅰⅱ燾 鸙 
extern int XDistance=250;// x ?湜 ⅳ ⅰⅱ濵胛 ? 
extern int YDistance=0;// y ?湜 ⅳ ⅰⅱ濵胛 ? 
int lenbase; 
string s_base=":...:...:...:...:";// ? 蓁? 頏魵瑙? 竟蒻?  ??? 
int init() 
  { 
   lenbase=StringLen(s_base); 
   return(0); 
  } 
int deinit() 
  { 
   if (ObjectFind("BarTimer") != -1) ObjectDelete("BarTimer"); 
   return(0); 
  } 
//+------------------------------------------------------------------+ 
//| ??鶴 ⅳ?褪 ?裹 ??趺湜 ? 糅褌褊                  | 
//|   ⅳ濵?濵 浯?  ?煜 ?胛 矜,                     | 
//| 蒡??頸褄? 萵褪? 蒡? 糅褌褊                                | 
//|   ?ⅹ裝胛 ⅳ 浯? 矜  ?ⅷ褊                          | 
//+------------------------------------------------------------------+ 
int start() 
  { 
   int i=0,sec=0; 
   double pc=0.0; 
   string time="",s_end="",s_beg=""; 
   if (ObjectFind("BarTimer") == -1) {// 褥? 髜栁? 淲 浯鱠褊 - 鈕瑯  鈞萵褌 ?? 
     ObjectCreate("BarTimer" , OBJ_LABEL,0,0,0); 
     ObjectSet("BarTimer", OBJPROP_XDISTANCE, XDistance); 
     ObjectSet("BarTimer", OBJPROP_YDISTANCE, YDistance); 
     ObjectSet("BarTimer", OBJPROP_CORNER, Corner); 
   } 
   sec=TimeCurrent()-Time[0];// 糅褌?  ?淸瑾 ⅳ 浯? 矜 
   i=(lenbase-1)*sec/(Period()*60);// ?鉅? ??? 
   pc=100.0*sec/(Period()*60);// 糅褌? ⅳ 浯? 矜  ?ⅷ褊 
   if(i>lenbase-1) i=lenbase-1;// 粽銕鮻濵 韈?韜 ?炅? 胙瑙頽 
   if(i>0) s_beg=StringSubstr(s_base,0,i); 
   if(i<lenbase-1) s_end=StringSubstr(s_base,i+1,lenbase-i-1); 
   time=StringConcatenate(s_beg,"|",s_end,"  ",DoubleToStr(pc,0),"%"); 
   ObjectSetText("BarTimer", time, FontSize, FontName, FontColor); 
   return(0); 
  } 
//+------------------------------------------------------------------+

2018无需申请注册送58体验金