яю// More information about this indicator can be found at: // http://fxcodebase.com/code/viewtopic.php?f=38&t=64369&p=114750#\0p\01\01\04\07\05\00\0 \0 //+------------------------------------------------------------------+ //| MTF_MCP_3_Level_Semafor_Dashboard_Alerts.mq4.mq4 | //| Copyright © 2017, Gehtsoft USA LLC | //| http://fxcodebase.com | //+------------------------------------------------------------------+ //| Donate / Support: https://goo.gl/9Rj74e | //| BitCoin: 15VCJTLaz12Amr7adHSBtL9v8XomURo9RF | //+------------------------------------------------------------------+ //| Developed by : Mario Jemic | //| mario.jemic@gmail.com | //+------------------------------------------------------------------+ #\0p\0r\0o\0p\0e\0r\0t\0y\0 \0i\0n\0d\0i\0c\0a\0t\0o\0r\0_\0s\0e\0p\0a\0r\0a\0t\0e\0_\0w\0i\0n\0d\0o\0w\0 \0 extern bool Sound_Alert = true; extern string Comment1 = "\0-\0 \0C\0o\0m\0m\0a\0 \0S\0e\0p\0a\0r\0a\0t\0e\0d\0 \0P\0a\0i\0r\0s\0 \0-\0 \0E\0x\0:\0 \0E\0U\0R\0U\0S\0D\0,\0E\0U\0R\0J\0P\0Y\0,\0G\0B\0P\0U\0S\0D\0 \0-\0 \0"; extern string Pairs = "\0E\0U\0R\0U\0S\0D\0,\0G\0B\0P\0U\0S\0D\0,\0A\0U\0D\0U\0S\0D\0,\0N\0Z\0D\0U\0S\0D\0,\0U\0S\0D\0C\0H\0F\0,\0U\0S\0D\0C\0A\0D\0,\0U\0S\0D\0J\0P\0Y\0,\0E\0U\0R\0J\0P\0Y\0"; extern bool Include_M5 = true; extern bool Include_M15 = true; extern bool Include_M30 = true; extern bool Include_H1 = true; extern bool Include_H4 = true; extern bool Include_D1 = true; extern bool Include_W1 = true; extern bool Include_MN1 = true; extern color Labels_Color = clrBlack; extern color Up_Color = clrRed; extern color Dn_Color = clrBlue; extern color Neutral_Color = clrGreen; extern int Update_History_Every_Seconds = 7; int i; string WindowName; int WindowNumber; string Sym_arr[]; // Pairs symbols int Sym_count; // Number of symbols // Optimization datetime Last_History_Process; datetime LastAlert; int init(){ WindowName = "\0M\0T\0F\0_\0M\0C\0P\0_\03\0_\0L\0e\0v\0e\0l\0_\0S\0e\0m\0a\0f\0o\0r\0_\0D\0a\0s\0h\0b\0o\0a\0r\0d\0_\0A\0l\0e\0r\0t\0s\0"; IndicatorShortName(WindowName); return(0); } int deinit(){ ObjectsDeleteAll(); return(0); } int start() { WindowNumber = WindowFind(WindowName); int Pair_y = 50; int TF_x = 1000; int Original_x = TF_x; if (Include_M5){ int M5_x = TF_x; TF_x = TF_x-120; ObjectMakeLabel("\0M\05\0_\0L\0a\0b\0e\0l\0", M5_x, 20, "\0M\05\0", Labels_Color, 1, WindowNumber, "\0A\0r\0i\0a\0l\0", 12 ); } if (Include_M15){ int M15_x = TF_x; TF_x = TF_x-120; ObjectMakeLabel("\0M\01\05\0_\0L\0a\0b\0e\0l\0", M15_x, 20, "\0M\01\05\0", Labels_Color, 1, WindowNumber, "\0A\0r\0i\0a\0l\0", 12 ); } if (Include_M30){ int M30_x = TF_x; TF_x = TF_x-120; ObjectMakeLabel("\0M\03\00\0_\0L\0a\0b\0e\0l\0", M30_x, 20, "\0M\03\00\0", Labels_Color, 1, WindowNumber, "\0A\0r\0i\0a\0l\0", 12 ); } if (Include_H1){ int H1_x = TF_x; TF_x = TF_x-120; ObjectMakeLabel("\0H\01\0_\0L\0a\0b\0e\0l\0", H1_x, 20, "\0H\01\0", Labels_Color, 1, WindowNumber, "\0A\0r\0i\0a\0l\0", 12 ); } if (Include_H4){ int H4_x = TF_x; TF_x = TF_x-120; ObjectMakeLabel("\0H\04\0_\0L\0a\0b\0e\0l\0", H4_x, 20, "\0H\04\0", Labels_Color, 1, WindowNumber, "\0A\0r\0i\0a\0l\0", 12 ); } if (Include_D1){ int D1_x = TF_x; TF_x = TF_x-120; ObjectMakeLabel("\0D\01\0_\0L\0a\0b\0e\0l\0", D1_x, 20, "\0D\01\0", Labels_Color, 1, WindowNumber, "\0A\0r\0i\0a\0l\0", 12 ); } if (Include_W1){ int W1_x = TF_x; TF_x = TF_x-120; ObjectMakeLabel("\0W\01\0_\0L\0a\0b\0e\0l\0", W1_x, 20, "\0W\01\0", Labels_Color, 1, WindowNumber, "\0A\0r\0i\0a\0l\0", 12 ); } /*if (Include_MN1){ int MN1_x = TF_x; TF_x = TF_x-120; ObjectMakeLabel("\0M\0N\01\0_\0L\0a\0b\0e\0l\0", MN1_x, 20, "\0M\0N\01\0", Labels_Color, 1, WindowNumber, "\0A\0r\0i\0a\0l\0", 12 ); }*/ split(Sym_arr, Pairs, "\0,\0"); Sym_count = ArraySize(Sym_arr); double divisor; string arrow; color diff_color; double up, down; // For optimization, just check every certain seconds if ( TimeCurrent()-Last_History_Process > Update_History_Every_Seconds ){ string Alerts = "\0"; for (i=0; i < Sym_count; i++) { if (MarketInfo(Sym_arr[i],MODE_DIGITS)==3||MarketInfo(Sym_arr[i],MODE_DIGITS)==5) divisor = 10; else divisor = 1; ObjectMakeLabel(Sym_arr[i]+"\0_\0N\0a\0m\0e\0", Original_x+80, Pair_y, Sym_arr[i], Labels_Color, 1, WindowNumber, "\0A\0r\0i\0a\0l\0", 12 ); if (Include_M5){ up = iCustom(Sym_arr[i],PERIOD_M5,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",4,0); down = iCustom(Sym_arr[i],PERIOD_M5,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",5,0); if (up > 0.0){ diff_color = Up_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0M\05\0)\0 \0U\0p\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else if (down > 0.0){ diff_color = Dn_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0M\05\0)\0 \0D\0o\0w\0n\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else{ diff_color = Neutral_Color; arrow = "\0§\0"; } ObjectMakeLabel(Sym_arr[i]+"\0_\0M\05\0", M5_x-0, Pair_y, arrow, diff_color, 1, WindowNumber, "\0W\0i\0n\0g\0d\0i\0n\0g\0s\0", 14 ); } if (Include_M15){ up = iCustom(Sym_arr[i],PERIOD_M15,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",4,0); down = iCustom(Sym_arr[i],PERIOD_M15,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",5,0); if (up > 0.0){ diff_color = Up_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0M\01\05\0)\0 \0U\0p\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else if (down > 0.0){ diff_color = Dn_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0M\01\05\0)\0 \0D\0o\0w\0n\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else{ diff_color = Neutral_Color; arrow = "\0§\0"; } ObjectMakeLabel(Sym_arr[i]+"\0_\0M\01\05\0", M15_x-0, Pair_y, arrow, diff_color, 1, WindowNumber, "\0W\0i\0n\0g\0d\0i\0n\0g\0s\0", 14 ); } if (Include_M30){ up = iCustom(Sym_arr[i],PERIOD_M30,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",4,0); down = iCustom(Sym_arr[i],PERIOD_M30,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",5,0); if (up > 0.0){ diff_color = Up_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0M\03\00\0)\0 \0U\0p\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else if (down > 0.0){ diff_color = Dn_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0M\03\00\0)\0 \0D\0o\0w\0n\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else{ diff_color = Neutral_Color; arrow = "\0§\0"; } ObjectMakeLabel(Sym_arr[i]+"\0_\0M\03\00\0", M30_x-0, Pair_y, arrow, diff_color, 1, WindowNumber, "\0W\0i\0n\0g\0d\0i\0n\0g\0s\0", 14 ); } if (Include_H1){ up = iCustom(Sym_arr[i],PERIOD_H1,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",4,0); down = iCustom(Sym_arr[i],PERIOD_H1,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",5,0); if (up > 0.0){ diff_color = Up_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0H\01\0)\0 \0U\0p\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else if (down > 0.0){ diff_color = Dn_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0H\01\0)\0 \0D\0o\0w\0n\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else{ diff_color = Neutral_Color; arrow = "\0§\0"; } ObjectMakeLabel(Sym_arr[i]+"\0_\0H\01\0", H1_x-0, Pair_y, arrow, diff_color, 1, WindowNumber, "\0W\0i\0n\0g\0d\0i\0n\0g\0s\0", 14 ); } if (Include_H4){ up = iCustom(Sym_arr[i],PERIOD_H4,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",4,0); down = iCustom(Sym_arr[i],PERIOD_H4,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",5,0); if (up > 0.0){ diff_color = Up_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0H\04\0)\0 \0U\0p\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else if (down > 0.0){ diff_color = Dn_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0H\04\0)\0 \0D\0o\0w\0n\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else{ diff_color = Neutral_Color; arrow = "\0§\0"; } ObjectMakeLabel(Sym_arr[i]+"\0_\0H\04\0", H4_x-0, Pair_y, arrow, diff_color, 1, WindowNumber, "\0W\0i\0n\0g\0d\0i\0n\0g\0s\0", 14 ); } if (Include_D1){ up = iCustom(Sym_arr[i],PERIOD_D1,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",4,0); down = iCustom(Sym_arr[i],PERIOD_D1,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",5,0); if (up > 0.0){ diff_color = Up_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0D\01\0)\0 \0U\0p\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else if (down > 0.0){ diff_color = Dn_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0D\01\0)\0 \0D\0o\0w\0n\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else{ diff_color = Neutral_Color; arrow = "\0§\0"; } ObjectMakeLabel(Sym_arr[i]+"\0_\0D\01\0", D1_x-0, Pair_y, arrow, diff_color, 1, WindowNumber, "\0W\0i\0n\0g\0d\0i\0n\0g\0s\0", 14 ); } if (Include_W1){ up = iCustom(Sym_arr[i],PERIOD_W1,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",4,0); down = iCustom(Sym_arr[i],PERIOD_W1,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",5,0); if (up > 0.0){ diff_color = Up_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0W\01\0)\0 \0U\0p\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else if (down > 0.0){ diff_color = Dn_Color; arrow = "\0%\0"; Alerts+=Sym_arr[i]+"\0 \0(\0W\01\0)\0 \0D\0o\0w\0n\0 \03\0 \0S\0e\0m\0a\0f\0o\0r\0\\0n\0"; }else{ diff_color = Neutral_Color; arrow = "\0§\0"; } ObjectMakeLabel(Sym_arr[i]+"\0_\0W\01\0", W1_x-0, Pair_y, arrow, diff_color, 1, WindowNumber, "\0W\0i\0n\0g\0d\0i\0n\0g\0s\0", 14 ); } /*if (Include_MN1){ up = iCustom(Sym_arr[i],PERIOD_MN1,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",4,0); down = iCustom(Sym_arr[i],PERIOD_MN1,"\0S\0e\0m\0a\0p\0h\0o\0r\0_\03\0L\0e\0v\0e\0l\0_\0Z\0Z\0",5,0); if (up > 0.0){ diff_color = Up_Color; arrow = "\0%\0"; }else if (down > 0.0){ diff_color = Dn_Color; arrow = "\0%\0"; }else{ diff_color = Neutral_Color; arrow = "\0§\0"; } ObjectMakeLabel(Sym_arr[i]+"\0_\0M\0N\01\0", MN1_x-0, Pair_y, arrow, diff_color, 1, WindowNumber, "\0W\0i\0n\0g\0d\0i\0n\0g\0s\0", 10 ); //ObjectMakeLabel(Sym_arr[i]+"\0_\0M\0N\01\0_\0l\0a\0b\0e\0l\0", MN1_x-7, Pair_y, DoubleToStr(rsi0,2), diff_color, 1, WindowNumber, "\0A\0r\0i\0a\0l\0", 9 ); }*/ Pair_y = Pair_y+30; } if (TimeCurrent() > (LastAlert+60) && Alerts!="\0"){ if (Sound_Alert) Alert("\0M\0T\0F\0 \0M\0C\0P\0 \03\0 \0L\0e\0v\0e\0l\0 \0S\0e\0m\0a\0f\0o\0r\0:\0\\0n\0"+Alerts); LastAlert = TimeCurrent(); } Last_History_Process = TimeCurrent(); } //---- return(0); } void ObjectMakeLabel( string nm, int xoff, int yoff, string LabelTexto, color LabelColor, int LabelCorner=1, int Window = 0, string Font = "\0A\0r\0i\0a\0l\0", int FSize = 8 ){ ObjectDelete(nm); ObjectCreate( nm, OBJ_LABEL, Window, 0, 0 ); ObjectSet( nm, OBJPROP_CORNER, LabelCorner ); ObjectSet( nm, OBJPROP_XDISTANCE, xoff ); ObjectSet( nm, OBJPROP_YDISTANCE, yoff ); ObjectSet( nm, OBJPROP_BACK, false ); ObjectSetText( nm, LabelTexto, FSize, Font, LabelColor ); return; } void split(string& arr[], string str, string sym) { ArrayResize(arr, 0); string item; int pos, size; int len = StringLen(str); for (i=0; i < len;) { pos = StringFind(str, sym, i); if (pos == -1) pos = len; item = StringSubstr(str, i, pos-i); item = StringTrimLeft(item); item = StringTrimRight(item); size = ArraySize(arr); ArrayResize(arr, size+1); arr[size] = item; i = pos+1; } }
Комментарии к исходному коду форекс индикатора MTF_MCP_3_Level_Semafor_Dashboard_Alerts.mq4
В целях безопасности и борьбы со спамом в тексте комментариев запрещено размещать html-теги и ссылки. Благодарим за понимание.