//+---------------------------------------------------------------- //| "ЧАСИКИ MT4" CLOCK MT4.mq4 //+----------------------------------------------------------------- #property indicator_chart_window //+---------------------------------------------------------------- extern int Corner = 1; // values [0-3] - опорный угол extern int XDistance = 25; // x расстояние от опорного угла extern int YDistance = 25; // y расстояние от опорного угла 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"); 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,2)+"$. D/" + DoubleToStr (iHigh(NULL,PERIOD_D1,0)/ nPoint-iLow(NULL,PERIOD_D1,0)/ nPoint,0) + ", "+ "M" + Period() + "/" + DoubleToStr(iHigh(NULL,0,0)/ nPoint-iLow(NULL,0,0)/ nPoint,0) +" п = " + (TimeCurrent()-Time[0])/60 + ":"+(TimeCurrent()-Time[0])%60 + ", " + 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 ); // ======================================================================================== // ======================================================================================== 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);} //+------------------------------------------------------------------ //========================================================================================