//+------------------------------------------------------------------+ //| Trend Analysis 4.0.mq4 | //| Copyright © 2010, Ivan Tretyakov | //| tretyak-off@inbox.ru | //| Версия v4.0 | //+------------------------------------------------------------------+ #property copyright "Copyright © 2010, Ivan Tretyakov" #property link "tretyak-off@inbox.ru" #property indicator_separate_window #property indicator_minimum 0 #property indicator_maximum 1 //Переменные для редактирования extern color SignalUpColor=Blue; // цвет стрелки вверх extern color SignalDownColor=Red; // цвет стрелки вниз extern color IndicatorsTextColor=Orange; //цвет индикаторов extern color SeparatorsTextColor=Silver; //цвет разделителей extern int UseSumMetod=1; //доступные значения 1- основной тренд считается по M15-D1; 2- по H4-D1. extern int FontSize=9; // размер шрифта extern int SpaseSize=3; // промежуток между строками extern int SymbolUpCode=228; // код стрелки вверх extern int SymbolDownCode=230; // код стрелки вниз extern int PerForChangeTrend=60; //сколько процентов на то, чтобы стрелка изменила свое направление extern string FontName="Courier New"; // шрифт string Periods[]={"M5","M15","M30","H1","H4","D1","W1"};//7 //string Indicators[]={"MA_20","MA_50","MA100","ADX14","BEARS","BULLS","CCI14","DeM14","FORCE","MACD_","MOM14","RSI14","STOCH"};//13 string ShortName="Trend Analysis"; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { IndicatorShortName(ShortName); return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { string name; int x; for(int i=3; i<=5; i++) { switch(i) { case 3: name="+"; break; case 5:name="+"; break; default:name="|"; break; } int y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ASep"+0+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ASep"+0+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ASep"+0+i,OBJPROP_XDISTANCE,FontSize*0); ObjectSet("ASep"+0+i,OBJPROP_YDISTANCE,y); } for(i=3; i<=5; i++) {if((i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ASep"+1+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ASep"+1+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ASep"+1+i,OBJPROP_XDISTANCE,FontSize*1); ObjectSet("ASep"+1+i,OBJPROP_YDISTANCE,y); } } for(i=3; i<=5; i++) {if((i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ASep"+2+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ASep"+2+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ASep"+2+i,OBJPROP_XDISTANCE,FontSize*2); ObjectSet("ASep"+2+i,OBJPROP_YDISTANCE,y); } } for(i=3; i<=5; i++) {if((i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ASep"+3+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ASep"+3+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ASep"+3+i,OBJPROP_XDISTANCE,FontSize*3); ObjectSet("ASep"+3+i,OBJPROP_YDISTANCE,y); } } for(i=3; i<=5; i++) {if((i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ASep"+4+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ASep"+4+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ASep"+4+i,OBJPROP_XDISTANCE,FontSize*4); ObjectSet("ASep"+4+i,OBJPROP_YDISTANCE,y); } } for(i=3; i<=5; i++) {if((i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ASep"+5+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ASep"+5+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ASep"+5+i,OBJPROP_XDISTANCE,FontSize*5); ObjectSet("ASep"+5+i,OBJPROP_YDISTANCE,y); } } for(i=3; i<=5; i++) {if((i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ASep"+6+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ASep"+6+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ASep"+6+i,OBJPROP_XDISTANCE,FontSize*6); ObjectSet("ASep"+6+i,OBJPROP_YDISTANCE,y); } } for(i=3; i<=5; i++) {if((i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ASep"+7+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ASep"+7+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ASep"+7+i,OBJPROP_XDISTANCE,FontSize*7); ObjectSet("ASep"+7+i,OBJPROP_YDISTANCE,y); } } for(i=3; i<=5; i++) {if((i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ASep"+8+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ASep"+8+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ASep"+8+i,OBJPROP_XDISTANCE,FontSize*8); ObjectSet("ASep"+8+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) { switch(i) { case 1:name="+"; break; case 3: name="+"; break; case 5:name="+"; break; default:name="|"; break; } y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("BSep"+9+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("BSep"+9+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("BSep"+9+i,OBJPROP_XDISTANCE,FontSize*9); ObjectSet("BSep"+9+i,OBJPROP_YDISTANCE,y); } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("BSep"+10+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("BSep"+10+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("BSep"+10+i,OBJPROP_XDISTANCE,FontSize*10); ObjectSet("BSep"+10+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("BSep"+11+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("BSep"+11+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("BSep"+11+i,OBJPROP_XDISTANCE,FontSize*11); ObjectSet("BSep"+11+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("BSep"+12+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("BSep"+12+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("BSep"+12+i,OBJPROP_XDISTANCE,FontSize*12); ObjectSet("BSep"+12+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("BSep"+13+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("BSep"+13+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("BSep"+13+i,OBJPROP_XDISTANCE,FontSize*13); ObjectSet("BSep"+13+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) { switch(i) { case 1:name="+"; break; case 3: name="+"; break; case 5:name="+"; break; default:name="|"; break; } y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("CSep"+14+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("CSep"+14+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("CSep"+14+i,OBJPROP_XDISTANCE,FontSize*14); ObjectSet("CSep"+14+i,OBJPROP_YDISTANCE,y); } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("CSep"+15+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("CSep"+15+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("CSep"+15+i,OBJPROP_XDISTANCE,FontSize*15); ObjectSet("CSep"+15+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("CSep"+16+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("CSep"+16+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("CSep"+16+i,OBJPROP_XDISTANCE,FontSize*16); ObjectSet("CSep"+16+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("CSep"+17+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("CSep"+17+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("CSep"+17+i,OBJPROP_XDISTANCE,FontSize*17); ObjectSet("CSep"+17+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("CSep"+18+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("CSep"+18+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("CSep"+18+i,OBJPROP_XDISTANCE,FontSize*18); ObjectSet("CSep"+18+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) { switch(i) { case 1:name="+"; break; case 3: name="+"; break; case 5:name="+"; break; default:name="|"; break; } y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("DSep"+19+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("DSep"+19+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("DSep"+19+i,OBJPROP_XDISTANCE,FontSize*19); ObjectSet("DSep"+19+i,OBJPROP_YDISTANCE,y); } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("DSep"+20+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("DSep"+20+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("DSep"+20+i,OBJPROP_XDISTANCE,FontSize*20); ObjectSet("DSep"+20+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("DSep"+21+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("DSep"+21+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("DSep"+21+i,OBJPROP_XDISTANCE,FontSize*21); ObjectSet("DSep"+21+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("DSep"+22+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("DSep"+22+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("DSep"+22+i,OBJPROP_XDISTANCE,FontSize*22); ObjectSet("DSep"+22+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("DSep"+23+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("DSep"+23+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("DSep"+23+i,OBJPROP_XDISTANCE,FontSize*23); ObjectSet("DSep"+23+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) { switch(i) { case 1:name="+"; break; case 3: name="+"; break; case 5:name="+"; break; default:name="|"; break; } y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ESep"+24+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ESep"+24+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ESep"+24+i,OBJPROP_XDISTANCE,FontSize*24); ObjectSet("ESep"+24+i,OBJPROP_YDISTANCE,y); } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ESep"+25+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ESep"+25+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ESep"+25+i,OBJPROP_XDISTANCE,FontSize*25); ObjectSet("ESep"+25+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ESep"+26+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ESep"+26+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ESep"+26+i,OBJPROP_XDISTANCE,FontSize*26); ObjectSet("ESep"+26+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ESep"+27+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ESep"+27+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ESep"+27+i,OBJPROP_XDISTANCE,FontSize*27); ObjectSet("ESep"+27+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ESep"+28+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ESep"+28+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ESep"+28+i,OBJPROP_XDISTANCE,FontSize*28); ObjectSet("ESep"+28+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) { switch(i) { case 1:name="+"; break; case 3: name="+"; break; case 5:name="+"; break; default:name="|"; break; } y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("FSep"+29+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("FSep"+29+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("FSep"+29+i,OBJPROP_XDISTANCE,FontSize*29); ObjectSet("FSep"+29+i,OBJPROP_YDISTANCE,y); } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("FSep"+30+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("FSep"+30+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("FSep"+30+i,OBJPROP_XDISTANCE,FontSize*30); ObjectSet("FSep"+30+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("FSep"+31+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("FSep"+31+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("FSep"+31+i,OBJPROP_XDISTANCE,FontSize*31); ObjectSet("FSep"+31+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("FSep"+32+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("FSep"+32+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("FSep"+32+i,OBJPROP_XDISTANCE,FontSize*32); ObjectSet("FSep"+32+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("FSep"+33+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("FSep"+33+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("FSep"+33+i,OBJPROP_XDISTANCE,FontSize*33); ObjectSet("FSep"+33+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) { switch(i) { case 1:name="+"; break; case 3: name="+"; break; case 5:name="+"; break; default:name="|"; break; } y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("GSep"+34+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("GSep"+34+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("GSep"+34+i,OBJPROP_XDISTANCE,FontSize*34); ObjectSet("GSep"+34+i,OBJPROP_YDISTANCE,y); } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("GSep"+35+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("GSep"+35+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("GSep"+35+i,OBJPROP_XDISTANCE,FontSize*35); ObjectSet("GSep"+35+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("GSep"+36+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("GSep"+36+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("GSep"+36+i,OBJPROP_XDISTANCE,FontSize*36); ObjectSet("GSep"+36+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("GSep"+37+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("GSep"+37+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("GSep"+37+i,OBJPROP_XDISTANCE,FontSize*37); ObjectSet("GSep"+37+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("GSep"+38+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("GSep"+38+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("GSep"+38+i,OBJPROP_XDISTANCE,FontSize*38); ObjectSet("GSep"+38+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) { switch(i) { case 1:name="+"; break; case 3: name="+"; break; case 5:name="+"; break; default:name="|"; break; } y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ISep"+39+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ISep"+39+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ISep"+39+i,OBJPROP_XDISTANCE,FontSize*39); ObjectSet("ISep"+39+i,OBJPROP_YDISTANCE,y); } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ISep"+40+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ISep"+40+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ISep"+40+i,OBJPROP_XDISTANCE,FontSize*40); ObjectSet("ISep"+40+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ISep"+41+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ISep"+41+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ISep"+41+i,OBJPROP_XDISTANCE,FontSize*41); ObjectSet("ISep"+41+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ISep"+42+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ISep"+42+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ISep"+42+i,OBJPROP_XDISTANCE,FontSize*42); ObjectSet("ISep"+42+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) {if((i==1) || (i==3) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ISep"+43+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ISep"+43+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ISep"+43+i,OBJPROP_XDISTANCE,FontSize*43); ObjectSet("ISep"+43+i,OBJPROP_YDISTANCE,y); } } for(i=1; i<=5; i++) { switch(i) { case 1:name="+"; break; case 3: name="+"; break; case 5:name="+"; break; default:name="|"; break; } y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("ISep"+44+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("ISep"+44+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("ISep"+44+i,OBJPROP_XDISTANCE,FontSize*44); ObjectSet("ISep"+44+i,OBJPROP_YDISTANCE,y); } for(i=2; i<=5; i++) { switch(i) { case 2:name="+"; break; case 5:name="+"; break; default:name="|"; break; } y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("JSep"+46+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("JSep"+46+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("JSep"+46+i,OBJPROP_XDISTANCE,FontSize*46); ObjectSet("JSep"+46+i,OBJPROP_YDISTANCE,y); } for(i=2; i<=5; i++) {if((i==2) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("JSep"+47+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("JSep"+47+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("JSep"+47+i,OBJPROP_XDISTANCE,FontSize*47); ObjectSet("JSep"+47+i,OBJPROP_YDISTANCE,y); } } for(i=2; i<=5; i++) {if((i==2) || (i==5)) { name="-";y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("JSep"+48+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("JSep"+48+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("JSep"+48+i,OBJPROP_XDISTANCE,FontSize*48); ObjectSet("JSep"+48+i,OBJPROP_YDISTANCE,y); } } for(i=2; i<=5; i++) { switch(i) { case 2:name="+"; break; case 5:name="+"; break; default:name="|"; break; } y=(i-1)*FontSize+SpaseSize*i; ObjectCreate("JSep"+49+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("JSep"+49+i,name,FontSize,FontName,SeparatorsTextColor); ObjectSet("JSep"+49+i,OBJPROP_XDISTANCE,FontSize*49); ObjectSet("JSep"+49+i,OBJPROP_YDISTANCE,y); } ObjectCreate("AC",OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText("AC","AC",FontSize,FontName,IndicatorsTextColor); ObjectSet("AC",OBJPROP_XDISTANCE,FontSize*1); ObjectSet("AC",OBJPROP_YDISTANCE,(4-1)*FontSize+SpaseSize*4); for(i=1; i<=7; i++) { switch(i) { case 1:x=10;break; case 2:x=15;break; case 3:x=20;break; case 4:x=25;break; case 5:x=30;break; case 6:x=35;break; case 7:x=40;break; case 8:x=45;break; } ObjectCreate(Periods[i-1],OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSetText(Periods[i-1],Periods[i-1],FontSize,FontName,IndicatorsTextColor); ObjectSet(Periods[i-1],OBJPROP_XDISTANCE,FontSize*(x)); ObjectSet(Periods[i-1],OBJPROP_YDISTANCE,(2-1)*FontSize+2*SpaseSize); } for(i=1; i<=7; i++) { switch(i) { case 1:x=10;break; case 2:x=15;break; case 3:x=20;break; case 4:x=25;break; case 5:x=30;break; case 6:x=35;break; case 7:x=40;break; case 8:x=45;break; } ObjectCreate("S"+1+i,OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSet("S"+1+i,OBJPROP_XDISTANCE,FontSize*(x)); ObjectSet("S"+1+i,OBJPROP_YDISTANCE,(4-1)*FontSize+4*SpaseSize); } ObjectCreate("Trend",OBJ_LABEL,WindowFind(ShortName),0,0); ObjectSet("Trend",OBJPROP_XDISTANCE,FontSize*(47)); ObjectSet("Trend",OBJPROP_YDISTANCE,(3-1)*FontSize+3*SpaseSize); int Code; color CodeColor; /// Таблица направлений AC if(iAC(NULL,PERIOD_M5,0)>iAC(NULL,PERIOD_M5,1)) {Code=SymbolUpCode;CodeColor=SignalUpColor;}else{Code=SymbolDownCode;CodeColor=SignalDownColor;} ObjectSetText("s"+1+1,CharToStr(Code),FontSize,"Wingdings",CodeColor); if(iAC(NULL,PERIOD_M15,0)>iAC(NULL,PERIOD_M15,1)) {Code=SymbolUpCode;CodeColor=SignalUpColor;}else{Code=SymbolDownCode;CodeColor=SignalDownColor;} ObjectSetText("s"+1+2,CharToStr(Code),FontSize,"Wingdings",CodeColor); if(iAC(NULL,PERIOD_M30,0)>iAC(NULL,PERIOD_M30,1)) {Code=SymbolUpCode;CodeColor=SignalUpColor;}else{Code=SymbolDownCode;CodeColor=SignalDownColor;} ObjectSetText("s"+1+3,CharToStr(Code),FontSize,"Wingdings",CodeColor); if(iAC(NULL,PERIOD_H1,0)>iAC(NULL,PERIOD_H1,1)) {Code=SymbolUpCode;CodeColor=SignalUpColor;}else{Code=SymbolDownCode;CodeColor=SignalDownColor;} ObjectSetText("s"+1+4,CharToStr(Code),FontSize,"Wingdings",CodeColor); if(iAC(NULL,PERIOD_H4,0)>iAC(NULL,PERIOD_H4,1)) {Code=SymbolUpCode;CodeColor=SignalUpColor;}else{Code=SymbolDownCode;CodeColor=SignalDownColor;} ObjectSetText("s"+1+5,CharToStr(Code),FontSize,"Wingdings",CodeColor); if(iAC(NULL,PERIOD_D1,0)>iAC(NULL,PERIOD_D1,1)) {Code=SymbolUpCode;CodeColor=SignalUpColor;}else{Code=SymbolDownCode;CodeColor=SignalDownColor;} ObjectSetText("s"+1+6,CharToStr(Code),FontSize,"Wingdings",CodeColor); if(iAC(NULL,PERIOD_W1,0)>iAC(NULL,PERIOD_W1,1)) {Code=SymbolUpCode;CodeColor=SignalUpColor;}else{Code=SymbolDownCode;CodeColor=SignalDownColor;} ObjectSetText("s"+1+7,CharToStr(Code),FontSize,"Wingdings",CodeColor); //--------Основные вычисления int SumUpsM15D1=0; int SumUpsH4D1=0; //----------- Moving Average if(iMA(NULL,PERIOD_M15,20,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_M15,20,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iMA(NULL,PERIOD_M30,20,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_M30,20,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iMA(NULL,PERIOD_H1,20,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_H1,20,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iMA(NULL,PERIOD_H4,20,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_H4,20,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iMA(NULL,PERIOD_D1,20,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_D1,20,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iMA(NULL,PERIOD_M15,50,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_M15,50,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iMA(NULL,PERIOD_M30,50,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_M30,50,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iMA(NULL,PERIOD_H1,50,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_H1,50,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iMA(NULL,PERIOD_H4,50,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_H4,50,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iMA(NULL,PERIOD_D1,50,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_D1,50,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iMA(NULL,PERIOD_M15,100,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_M15,100,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iMA(NULL,PERIOD_M30,100,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_M30,100,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iMA(NULL,PERIOD_H1,100,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_H1,100,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iMA(NULL,PERIOD_H4,100,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_H4,100,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iMA(NULL,PERIOD_D1,100,0,MODE_SMA,PRICE_CLOSE,0)>iMA(NULL,PERIOD_D1,100,0,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} //-----Average Directional Movement Index if(iADX(NULL,PERIOD_M15,14,PRICE_CLOSE,MODE_MAIN,0)>iADX(NULL,PERIOD_M15,14,PRICE_CLOSE,MODE_MAIN,1)) {SumUpsM15D1++;} if(iADX(NULL,PERIOD_M30,14,PRICE_CLOSE,MODE_MAIN,0)>iADX(NULL,PERIOD_M30,14,PRICE_CLOSE,MODE_MAIN,1)) {SumUpsM15D1++;} if(iADX(NULL,PERIOD_H1,14,PRICE_CLOSE,MODE_MAIN,0)>iADX(NULL,PERIOD_H1,14,PRICE_CLOSE,MODE_MAIN,1)) {SumUpsM15D1++;} if(iADX(NULL,PERIOD_H4,14,PRICE_CLOSE,MODE_MAIN,0)>iADX(NULL,PERIOD_H4,14,PRICE_CLOSE,MODE_MAIN,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iADX(NULL,PERIOD_D1,14,PRICE_CLOSE,MODE_MAIN,0)>iADX(NULL,PERIOD_D1,14,PRICE_CLOSE,MODE_MAIN,1)) {SumUpsM15D1++;SumUpsH4D1++;} //-----Bears if(iBearsPower(NULL,PERIOD_M15,13,PRICE_CLOSE,0)>iBearsPower(NULL,PERIOD_M15,13,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iBearsPower(NULL,PERIOD_M30,13,PRICE_CLOSE,0)>iBearsPower(NULL,PERIOD_M30,13,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iBearsPower(NULL,PERIOD_H1,13,PRICE_CLOSE,0)>iBearsPower(NULL,PERIOD_H1,13,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iBearsPower(NULL,PERIOD_H4,13,PRICE_CLOSE,0)>iBearsPower(NULL,PERIOD_H4,13,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iBearsPower(NULL,PERIOD_D1,13,PRICE_CLOSE,0)>iBearsPower(NULL,PERIOD_D1,13,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} //----Bulls if(iBullsPower(NULL,PERIOD_M15,13,PRICE_CLOSE,0)>iBullsPower(NULL,PERIOD_M15,13,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iBullsPower(NULL,PERIOD_M30,13,PRICE_CLOSE,0)>iBullsPower(NULL,PERIOD_M30,13,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iBullsPower(NULL,PERIOD_H1,13,PRICE_CLOSE,0)>iBullsPower(NULL,PERIOD_H1,13,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iBullsPower(NULL,PERIOD_H4,13,PRICE_CLOSE,0)>iBullsPower(NULL,PERIOD_H4,13,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iBullsPower(NULL,PERIOD_D1,13,PRICE_CLOSE,0)>iBullsPower(NULL,PERIOD_D1,13,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} //------CCI if(iCCI(NULL,PERIOD_M15,14,PRICE_CLOSE,0)>iCCI(NULL,PERIOD_M15,14,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iCCI(NULL,PERIOD_M30,14,PRICE_CLOSE,0)>iCCI(NULL,PERIOD_M30,14,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iCCI(NULL,PERIOD_H1,14,PRICE_CLOSE,0)>iCCI(NULL,PERIOD_H1,14,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iCCI(NULL,PERIOD_H4,14,PRICE_CLOSE,0)>iCCI(NULL,PERIOD_H4,14,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iCCI(NULL,PERIOD_D1,14,PRICE_CLOSE,0)>iCCI(NULL,PERIOD_D1,14,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} //----Dem if(iDeMarker(NULL,PERIOD_M15,13,0)>iDeMarker(NULL,PERIOD_M15,13,1)) {SumUpsM15D1++;} if(iDeMarker(NULL,PERIOD_M30,13,0)>iDeMarker(NULL,PERIOD_M30,13,1)) {SumUpsM15D1++;} if(iDeMarker(NULL,PERIOD_H1,13,0)>iDeMarker(NULL,PERIOD_H1,13,1)) {SumUpsM15D1++;} if(iDeMarker(NULL,PERIOD_H4,13,0)>iDeMarker(NULL,PERIOD_H4,13,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iDeMarker(NULL,PERIOD_D1,13,0)>iDeMarker(NULL,PERIOD_D1,13,1)) {SumUpsM15D1++;SumUpsH4D1++;} //-----Force if(iForce(NULL,PERIOD_M15,13,MODE_SMA,PRICE_CLOSE,0)>iForce(NULL,PERIOD_M15,13,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iForce(NULL,PERIOD_M30,13,MODE_SMA,PRICE_CLOSE,0)>iForce(NULL,PERIOD_M30,13,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iForce(NULL,PERIOD_H1,13,MODE_SMA,PRICE_CLOSE,0)>iForce(NULL,PERIOD_H1,13,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iForce(NULL,PERIOD_H4,13,MODE_SMA,PRICE_CLOSE,0)>iForce(NULL,PERIOD_H4,13,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iForce(NULL,PERIOD_D1,13,MODE_SMA,PRICE_CLOSE,0)>iForce(NULL,PERIOD_D1,13,MODE_SMA,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} //-----MACD if(iMACD(NULL,PERIOD_M15,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>iMACD(NULL,PERIOD_M15,12,26,9,PRICE_CLOSE,MODE_MAIN,1)) {SumUpsM15D1++;} if(iMACD(NULL,PERIOD_M30,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>iMACD(NULL,PERIOD_M30,12,26,9,PRICE_CLOSE,MODE_MAIN,1)) {SumUpsM15D1++;} if(iMACD(NULL,PERIOD_H1,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>iMACD(NULL,PERIOD_H1,12,26,9,PRICE_CLOSE,MODE_MAIN,1)) {SumUpsM15D1++;} if(iMACD(NULL,PERIOD_H4,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>iMACD(NULL,PERIOD_H4,12,26,9,PRICE_CLOSE,MODE_MAIN,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iMACD(NULL,PERIOD_D1,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>iMACD(NULL,PERIOD_D1,12,26,9,PRICE_CLOSE,MODE_MAIN,1)) {SumUpsM15D1++;SumUpsH4D1++;} //-----MOM if(iMomentum(NULL,PERIOD_M15,14,PRICE_CLOSE,0)>iMomentum(NULL,PERIOD_M15,14,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iMomentum(NULL,PERIOD_M30,14,PRICE_CLOSE,0)>iMomentum(NULL,PERIOD_M30,14,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iMomentum(NULL,PERIOD_H1,14,PRICE_CLOSE,0)>iMomentum(NULL,PERIOD_H1,14,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iMomentum(NULL,PERIOD_H4,14,PRICE_CLOSE,0)>iMomentum(NULL,PERIOD_H4,14,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iMomentum(NULL,PERIOD_D1,14,PRICE_CLOSE,0)>iMomentum(NULL,PERIOD_D1,14,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} //-----RSI if(iRSI(NULL,PERIOD_M15,14,PRICE_CLOSE,0)>iRSI(NULL,PERIOD_M15,14,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iRSI(NULL,PERIOD_M30,14,PRICE_CLOSE,0)>iRSI(NULL,PERIOD_M30,14,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iRSI(NULL,PERIOD_H1,14,PRICE_CLOSE,0)>iRSI(NULL,PERIOD_H1,14,PRICE_CLOSE,1)) {SumUpsM15D1++;} if(iRSI(NULL,PERIOD_H4,14,PRICE_CLOSE,0)>iRSI(NULL,PERIOD_H4,14,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iRSI(NULL,PERIOD_D1,14,PRICE_CLOSE,0)>iRSI(NULL,PERIOD_D1,14,PRICE_CLOSE,1)) {SumUpsM15D1++;SumUpsH4D1++;} //----STOCH if(iStochastic(NULL,PERIOD_M15,5,3,3,MODE_SMA,0,MODE_MAIN,0)>iStochastic(NULL,PERIOD_M15,5,3,3,MODE_SMA,0,MODE_MAIN,1)) {SumUpsM15D1++;} if(iStochastic(NULL,PERIOD_M30,5,3,3,MODE_SMA,0,MODE_MAIN,0)>iStochastic(NULL,PERIOD_M30,5,3,3,MODE_SMA,0,MODE_MAIN,1)) {SumUpsM15D1++;} if(iStochastic(NULL,PERIOD_H1,5,3,3,MODE_SMA,0,MODE_MAIN,0)>iStochastic(NULL,PERIOD_H1,5,3,3,MODE_SMA,0,MODE_MAIN,1)) {SumUpsM15D1++;} if(iStochastic(NULL,PERIOD_H4,5,3,3,MODE_SMA,0,MODE_MAIN,0)>iStochastic(NULL,PERIOD_H4,5,3,3,MODE_SMA,0,MODE_MAIN,1)) {SumUpsM15D1++;SumUpsH4D1++;} if(iStochastic(NULL,PERIOD_D1,5,3,3,MODE_SMA,0,MODE_MAIN,0)>iStochastic(NULL,PERIOD_D1,5,3,3,MODE_SMA,0,MODE_MAIN,1)) {SumUpsM15D1++;SumUpsH4D1++;} double UpPerH4D1=NormalizeDouble(SumUpsH4D1*100/26,1); double DownPerH4D1=NormalizeDouble(100-UpPerH4D1,1); double UpPerM15D1=NormalizeDouble(SumUpsH4D1*100/65,1); double DownPerM15D1=NormalizeDouble(100-UpPerH4D1,1); if(UseSumMetod==1) { if((UpPerM15D1>DownPerM15D1) && (UpPerM15D1>=PerForChangeTrend)) {ObjectSetText("Trend",CharToStr(SymbolUpCode),FontSize*2,"Wingdings",SignalUpColor);} else {ObjectSetText("Trend","N",FontSize*2,"Wingdings",SeparatorsTextColor);} if((UpPerM15D1=PerForChangeTrend)) {ObjectSetText("Trend",CharToStr(SymbolDownCode),FontSize*2,"Wingdings",SignalDownColor);} else {ObjectSetText("Trend","N",FontSize*2,"Wingdings",SeparatorsTextColor);} } if(UseSumMetod==2) { if((UpPerH4D1>DownPerH4D1) && (UpPerH4D1>=PerForChangeTrend)) {ObjectSetText("Trend",CharToStr(SymbolUpCode),FontSize*2,"Wingdings",SignalUpColor);} else {ObjectSetText("Trend","N",FontSize*2,"Wingdings",SeparatorsTextColor);} if((UpPerH4D1=PerForChangeTrend)) {ObjectSetText("Trend",CharToStr(SymbolDownCode),FontSize*2,"Wingdings",SignalDownColor);} else {ObjectSetText("Trend","N",FontSize*2,"Wingdings",SeparatorsTextColor);} } return(0); } //+------------------------------------------------------------------+