//+-------------------------------------------------------------------+ //| MF_Sessions Times 0-002.mq4 | //| Copyright © Zhunko | //| | //| | //| MF ZHUNKO zhunko@mail.ru | //+-------------------------------------------------------------------+ //| Nicaai ia iniiaa eiaeeaoi?a : | //| i-Sessions.mq4 | //| Eei Eai?u A. aka KimIV | //| http://www.kimiv.ru | //| | //| 16.11.2005 Eiaeeaoi? oi?aiauo nannee | //+-------------------------------------------------------------------+ //| Ia?aee??aoaee : | //| extern bool Time_Summer = true ; | //| extern int Time_MT4_GMT = 2 ; | //| aoaoo ?aaioaou oieuei anee noiia?iia a?aiy ia aoaao i?aauoaou | //| 24:00. A iniiaiii yoi eanaaony eiioa aia?eeaineie nannee. | //+-------------------------------------------------------------------+ //| ECIAIAIE? e AIIIEIAIE?. | //| 1.Aiiieiaiey a aa?nee MF_Sessions Times 0-001 io 11.09.2006 . | //| 1.1.Aaaaaia iano?ieea ?acieou a?aiaie ia?ao IO4 e GMT. | //| 1.2.Aaaa?i ia?aee??aoaeu ceiiaa/eaoiaa a?aiy. | //| 2.Aiiieiaiey a aa?nee MF_Sessions Times 0-002 io 10.10.2006 . | //| 2.1.Ia?aaaeai ia?aee??aoaeu "ceiiaa/eaoiaa a?aiy". | //+-------------------------------------------------------------------+ #property copyright "Copyright © 2006 Zhunko" #property link "zhunko@mail.ru" #property indicator_chart_window //------- Aiaoiea ia?aiao?u eiaeeaoi?a ------------------------------- extern bool Time_Summer = false ; // false - ceiiaa a?aiy / true - eaoiaa a?aiy. extern int Time_MT4_GMT = 1 ; // ?acieoa a?aiaie a ?anao ia?ao IO4 e GMT. extern int NumberOfDays = 30 ; // Eiee?anoai aiae. extern string AsiaBegin = "00:00"; // Ioe?uoea aceaoneie nannee. extern string AsiaEnd = "08:00"; // Cae?uoea aceaoneie nannee. extern color AsiaColor = C'46,24,24';// Oaao aceaoneie nannee. extern string EurBegin = "07:00"; // Ioe?uoea aa?iiaeneie nannee. extern string EurEnd = "17:00"; // Cae?uoea aa?iiaeneie nannee. extern color EurColor = C'26,36,40';// Oaao aa?iiaeneie nannee. extern string USABegin = "13:00"; // Ioe?uoea aia?eeaineie nannee. extern string USAEnd = "22:00"; // Cae?uoea aia?eeaineie nannee. extern color USAColor = C'19,44,16';// Oaao aia?eeaineie nannee. //-------------------------------------------------------------------- int TWS; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void init() { DeleteObjects(); for (int i=0; i 5) dt = decDateTradeDay (dt); } } //+------------------------------------------------------------------+ //| I?i?eniaea iauaeoia ia a?aoeea | //| Ia?aiao?u: | //| dt - aaoa oi?aiaiai aiy | //| no - iaeiaiiaaiea iauaeoa | //| tb - a?aiy ia?aea nannee | //| te - a?aiy ieii?aiey nannee | //+------------------------------------------------------------------+ void DrawObjects (datetime dt, string no, string tb, string te) { datetime t1, t2; double p1, p2; int b1, b2; t1 = StrToTime (StringConcatenate (TimeToStr (dt, TIME_DATE), " ", tb)); t2 = StrToTime (StringConcatenate (TimeToStr (dt, TIME_DATE), " ", te)); b1 = iBarShift (NULL, 0, t1); b2 = iBarShift (NULL, 0, t2); p1 = High[Highest (NULL, 0, MODE_HIGH, b1-b2, b2)]; p2 = Low [Lowest (NULL, 0, MODE_LOW , b1-b2, b2)]; ObjectSet (no, OBJPROP_TIME1 , t1); ObjectSet (no, OBJPROP_PRICE1, p1); ObjectSet (no, OBJPROP_TIME2 , t2); ObjectSet (no, OBJPROP_PRICE2, p2); } //+------------------------------------------------------------------+ //| Oiaiuoaiea aaou ia iaei oi?aiaue aaiu | //| Ia?aiao?u: | //| dt - aaoa oi?aiaiai aiy | //+------------------------------------------------------------------+ datetime decDateTradeDay (datetime dt) { int ty = TimeYear (dt); int tm = TimeMonth (dt); int td = TimeDay (dt); int th = TimeHour (dt); int ti = TimeMinute (dt); td--; if (td == 0) { tm--; if (tm == 0) { ty--; tm = 12; } if (tm == 1 || tm == 3 || tm == 5 || tm == 7 || tm == 8 || tm == 10 || tm == 12) td = 31; if (tm == 2) if (MathMod (ty, 4) == 0) td = 29; else td = 28; if (tm == 4 || tm == 6 || tm == 9 || tm == 11) td = 30; } return (StrToTime (StringConcatenate (ty, ".", tm, ".", td, " ", th, ":", ti))); } //+------------------------------------------------------------------+