//+---------------------------------------------------------------- //| "ЧАСИКИ MT4" CLOCK MT4.mq4 //+----------------------------------------------------------------- #property indicator_chart_window //+---------------------------------------------------------------- extern int Corner = 1; // values [0-3] - опорный угол extern int XDistance = 15; // x расстояние от опорного угла extern int YDistance = 15; // y расстояние от опорного угла extern bool Tokyo = true ; //false true extern bool New_York = true ; //false true extern color Color1 = Lime; //цвет линии для Прибыль extern color Color2 = Maroon; // White цвет линии для убыток extern int FontSize = 9; extern string FontName = "Tahoma" ; // "Arial" "Arial Black" double profit=0; double nPoint = 0; //+----------------------------------------------------------- int init(){ return(0);} //+----------------------------------------------------------- int deinit() { ObjectDelete("CLOCK_3"); ObjectDelete("CLOCK_31"); ObjectDelete("Время Tokyo");ObjectDelete("Время New York"); return(0); } //+----------------------------------------------------------- int start(){ double nPoint = GetPoint(Symbol()); profit=0; for (int w1=0; w10) colir = Color1 ; else colir = Color2; // ======================================================================================== ObjectCreate ("CLOCK_3", OBJ_LABEL, 0,0,0); ObjectSetText("CLOCK_3", DoubleToStr (profit / OrderLots () /MarketInfo (Symbol(), MODE_TICKVALUE) ,0) + "/" + DoubleToStr (profit ,1)+ "$, D/" + DoubleToStr (iHigh(NULL,PERIOD_D1,0)/ nPoint-iLow(NULL,PERIOD_D1,0)/ nPoint,0) + ", "+ "M" + Period() + "-" + (TimeCurrent()-Time[0])/60 + ":"+ (TimeCurrent()-Time[0])%60 + "// " + DoubleToStr(iHigh(NULL,0,0)/ nPoint-iLow(NULL,0,0)/ nPoint,0) +", " + DoubleToStr(iHigh(NULL,0,1)/ nPoint-iLow(NULL,0,1)/ nPoint,0) +", " + DoubleToStr(iHigh(NULL,0,2)/ nPoint-iLow(NULL,0,2)/ nPoint,0) +" п. " + TimeToStr(TimeCurrent(), TIME_SECONDS), FontSize, FontName, colir); ObjectSet( "CLOCK_3", OBJPROP_CORNER, Corner); ObjectSet( "CLOCK_3", OBJPROP_XDISTANCE, XDistance); ObjectSet( "CLOCK_3", OBJPROP_YDISTANCE, YDistance); ObjectSet("CLOCK_3",OBJPROP_TIMEFRAMES,OBJ_PERIOD_M1 |OBJ_PERIOD_M5| OBJ_PERIOD_M15 | OBJ_PERIOD_M30 | OBJ_PERIOD_H1 ); // ======================================================================================== if (Tokyo) ObjectCreate( "Время Tokyo", OBJ_LABEL, 0,0,0); ObjectSet( "Время Tokyo", OBJPROP_CORNER, 2 ); ObjectSet( "Время Tokyo", OBJPROP_XDISTANCE, 2); ObjectSet( "Время Tokyo", OBJPROP_YDISTANCE, 2); ObjectSetText("Время Tokyo", TimeToStr(CurTime()+28800, TIME_MINUTES), FontSize, FontName, colir); // При переходе на летнее время добавте или отнимите 1 час = 3600 секунд http://time.yandex.ru/ if (New_York) ObjectCreate( "Время New York", OBJ_LABEL, 0,0,0); ObjectSet( "Время New York", OBJPROP_CORNER, 3 ); ObjectSet( "Время New York", OBJPROP_XDISTANCE, 3); ObjectSet( "Время New York", OBJPROP_YDISTANCE, 3); ObjectSetText("Время New York", TimeToStr(CurTime()- 21600, TIME_MINUTES), FontSize, FontName, colir); // ======================================================================================== ObjectCreate ("CLOCK_31", OBJ_LABEL, 0,0,0); ObjectSetText("CLOCK_31", DoubleToStr(profit,2)+ "$. " + "H1/" + DoubleToStr (iHigh(NULL,PERIOD_H1,0) / nPoint-iLow(NULL,PERIOD_H1,0)/ nPoint,0) + ", " + "H4/" + DoubleToStr (iHigh(NULL,PERIOD_H4,0) / nPoint-iLow(NULL,PERIOD_H4,0)/ nPoint,0) + ", " + "D/" + DoubleToStr (iHigh(NULL,PERIOD_D1,0) / nPoint-iLow(NULL,PERIOD_D1,0)/ nPoint,0) + ", " + "W/" + DoubleToStr (iHigh(NULL,PERIOD_W1,0) / nPoint-iLow(NULL,PERIOD_W1,0)/ nPoint,0) + ", " + "M/" + DoubleToStr (iHigh(NULL,PERIOD_MN1,0)/ nPoint-iLow(NULL,PERIOD_MN1,0)/nPoint,0) + ". " + TimeToStr(TimeCurrent(), TIME_SECONDS) ,FontSize, FontName, colir); ObjectSet( "CLOCK_31", OBJPROP_CORNER, Corner); ObjectSet( "CLOCK_31", OBJPROP_XDISTANCE, XDistance); ObjectSet( "CLOCK_31", OBJPROP_YDISTANCE, YDistance); ObjectSet("CLOCK_31",OBJPROP_TIMEFRAMES, OBJ_PERIOD_H4| OBJ_PERIOD_D1 |OBJ_PERIOD_W1| OBJ_PERIOD_MN1 ); // ======================================================================================== return(0); } //======================================================================================== double GetPoint(string vSymbol){ int vres = StringFind(vSymbol,"JPY"); if (vres == -1) return(0.0001); return(0.01);} //+------------------------------------------------------------------ //========================================================================================