/* G e n e r a t e d by ex4-to-mq4 decompiler FREEWARE 4.0.509.5 Website: h T T P :/ / wwW .m E T a Q u o TeS .Ne T E-mail : s u PP Or T@me T aquot E s.N E t */ #property copyright "Copyright © 2010, gspe" #property link "" #property indicator_chart_window extern bool ShowCurrentPairOnly = TRUE; extern string PairsToTrade = "AUDCAD,AUDCHF,AUDJPY,AUDNZD,AUDUSD,EURAUD,EURCAD,EURCHF,EURGBP,EURJPY,EURNZD,EURUSD,GBPAUD,GBPCAD,GBPCHF,GBPJPY,GBPNZD,GBPUSD,NZDUSD,NZDJPY,USDCAD,USDCHF,USDJPY"; extern string PeriodsToTrade = "M15,H1,H4,D1,W1"; extern string PDI = "----Pair display inputs----"; extern int FontSize = 10; extern color FontColour = Yellow; extern string Font_Font = "Lucida Sans Unicode"; extern double DisplayStarts_X = 5.0; extern double DisplayStarts_Y = 15.0; extern bool inpAlertPopUp = true; extern bool inpAlertEmail = true; bool Gi_136 = FALSE; string Gs_140 = "RSI(3)"; double Gd_148 = 0.0; double Gd_156 = 0.0; int Gi_164 = 233; int Gi_168 = 234; int Gi_172 = 236; int Gi_176 = 238; int Gi_180 = 232; int Gi_184 = 16711680; int Gi_188 = 255; int Gi_192 = 16760576; int Gi_196 = 16711935; int Gi_200 = 55295; int Gi_204; int Gi_208; string Gsa_212[]; string Gsa_216[]; int Gia_220[]; int Gia_224[][5]; int Gia_228[][5]; int trendcount[]; int trendcount_old[]; bool Gba_unused_232[]; string Gs_dummy_236; int G_window_248 = 0; string Gs_252; string G_str_concat_260; datetime lastBar; string txt; // E37F0136AA3FFAF149B351F6A4C948E9 int init() { string Ls_8; Gs_252 = WindowExpertName(); if (Gi_136) { G_window_248 = WindowFind(Gs_140); if (G_window_248 < 0) { Alert("RSI_WindowName is Wrong"); return (0); } DisplayStarts_X = 5; DisplayStarts_Y = 5; } if (!ShowCurrentPairOnly) { Gi_204 = f0_2(PairsToTrade, ",") + 1; ArrayResize(Gsa_212, Gi_204); Ls_8 = StringSubstr(Symbol(), 6, 4); f0_7(PairsToTrade, Gsa_212, Ls_8); } else { Gi_204 = 1; ArrayResize(Gsa_212, Gi_204); Gsa_212[0] = Symbol(); } Gi_208 = f0_2(PeriodsToTrade, ",") + 1; ArrayResize(Gsa_216, Gi_208); ArrayResize(Gia_220, Gi_208); f0_4(PeriodsToTrade, Gsa_216); for (int index_4 = 0; index_4 < Gi_208; index_4++) Gia_220[index_4] = f0_6(Gsa_216[index_4]); ArrayResize(Gia_224, Gi_204); ArrayInitialize(Gia_224, Gi_180); ArrayResize(Gia_228, Gi_204); ArrayInitialize(Gia_228, Gi_200); ArrayResize(trendcount, Gi_204); ArrayInitialize(trendcount, 0); ArrayResize(trendcount_old, Gi_204); ArrayInitialize(trendcount_old, 0); return (0); } // 52D46093050F38C27267BCE42543EF60 int deinit() { Comment(""); f0_3(Gs_252); return (0); } // EA2B2676C28C0DB26D39331A336C6B92 int start() { f0_1(Gia_224, Gia_228); f0_0(); return (0); } // 7EFBB2081D355DE1694C4F6F7C12CA9E void f0_3(string As_0) { string name_12 = ""; for (int objs_total_8 = ObjectsTotal(); objs_total_8 >= 0; objs_total_8--) { name_12 = ObjectName(objs_total_8); if (StringFind(name_12, As_0, 0) > -1) ObjectDelete(name_12); } } // 526300A01320C18B1450726F6592D4CF int f0_2(string As_0, string As_8) { int count_16 = 0; for (int Li_20 = 0; Li_20 < StringLen(As_0); Li_20++) if (StringSubstr(As_0, Li_20, StringLen(As_8)) == As_8) count_16++; return (count_16); } // DC60A01CB1101605BEC400C7DE64AF07 void f0_7(string As_0, string &Asa_8[], string As_12, string As_20 = ",") { int Li_28 = -1; int Li_32 = 0; for (int index_36 = 0; index_36 < ArraySize(Asa_8); index_36++) { Li_32 = StringFind(As_0, As_20, Li_28 + 1); Asa_8[index_36] = StringSubstr(As_0, Li_28 + 1, Li_32 - Li_28 - 1) + As_12; if (Li_32 >= StringLen(As_0) - 1) break; Li_28 = Li_32; } } // A4563DC2E9AE1AF2738D0D3A795F85F4 void f0_4(string As_0, string &Asa_8[], string As_12 = ",") { int Li_20 = -1; int Li_24 = 0; for (int index_28 = 0; index_28 < ArraySize(Asa_8); index_28++) { Li_24 = StringFind(As_0, As_12, Li_20 + 1); Asa_8[index_28] = StringSubstr(As_0, Li_20 + 1, Li_24 - Li_20 - 1); if (Li_24 >= StringLen(As_0) - 1) break; Li_20 = Li_24; } } // DA6C8804AAD418F26893B1623B85CAC5 int f0_6(string As_0) { As_0 = f0_5(As_0); As_0 = StringTrimLeft(As_0); As_0 = StringTrimRight(As_0); if (As_0 == "M1") return (1); if (As_0 == "M5") return (5); if (As_0 == "M15") return (15); if (As_0 == "M30") return (30); if (As_0 == "H1") return (60); if (As_0 == "H4") return (240); if (As_0 == "D1") return (1440); if (As_0 == "W1") return (10080); if (As_0 == "MN") return (43200); return (0); } // D27AF7D1516C24C3278EA8BCC56C9759 string f0_5(string As_0) { int Li_36; string Ls_ret_8 = ""; string Ls_16 = "abcdefghijklmnopqrstuvwxyz"; string Ls_24 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; for (int Li_32 = 0; Li_32 < StringLen(As_0); Li_32++) { Li_36 = StringFind(Ls_16, StringSubstr(As_0, Li_32, 1), 0); if (Li_36 >= 0) Ls_ret_8 = Ls_ret_8 + StringSubstr(Ls_24, Li_36, 1); else Ls_ret_8 = Ls_ret_8 + StringSubstr(As_0, Li_32, 1); } return (Ls_ret_8); } // 4B231BB5928C56E58BBF9AA7FB00F81F void f0_1(int &Aia_0[][5], int &Aia_4[][5]) { double iclose_16; double ima_24; double Ld_32; for (int index_8 = 0; index_8 < Gi_204; index_8++) { for (int index_12 = 0; index_12 < Gi_208; index_12++) { Aia_0[index_8][index_12] = Gi_180; Aia_4[index_8][index_12] = Gi_200; iclose_16 = iClose(Gsa_212[index_8], Gia_220[index_12], 0); ima_24 = iMA(Gsa_212[index_8], Gia_220[index_12], 10, 0, MODE_EMA, PRICE_CLOSE, 0); Ld_32 = MathAbs(iclose_16 - ima_24); if (iclose_16 - ima_24 > 0.0) { if (Ld_32 > Gd_156) { Aia_0[index_8][index_12] = Gi_164; Aia_4[index_8][index_12] = Gi_184; } if (Ld_32 > Gd_148 && Ld_32 < Gd_156) { Aia_0[index_8][index_12] = Gi_172; Aia_4[index_8][index_12] = Gi_192; } } if (iclose_16 - ima_24 < 0.0) { if (Ld_32 > Gd_156) { Aia_0[index_8][index_12] = Gi_168; Aia_4[index_8][index_12] = Gi_188; } if (Ld_32 > Gd_148 && Ld_32 < Gd_156) { Aia_0[index_8][index_12] = Gi_176; Aia_4[index_8][index_12] = Gi_196; } } } } } // 022A65C9EE1E1604E3C067339BD3E94E void f0_0() { f0_3(Gs_252); for (int index_0 = 0; index_0 < Gi_204; index_0++) { G_str_concat_260 = StringConcatenate(Gs_252, Gsa_212[index_0]); ObjectDelete(G_str_concat_260); ObjectCreate(G_str_concat_260, OBJ_LABEL, G_window_248, 0, 0, 0, 0); ObjectSet(G_str_concat_260, OBJPROP_CORNER, 1); ObjectSet(G_str_concat_260, OBJPROP_XDISTANCE, DisplayStarts_X + FontSize * (Gi_208 * 2)); ObjectSet(G_str_concat_260, OBJPROP_YDISTANCE, DisplayStarts_Y + (index_0 + 1) * (FontSize + FontSize / 2)); ObjectSetText(G_str_concat_260, Gsa_212[index_0], FontSize - 2, Font_Font, FontColour); } for (int index_4 = 0; index_4 < Gi_208; index_4++) { G_str_concat_260 = StringConcatenate(Gs_252, Gsa_216[index_4]); ObjectDelete(G_str_concat_260); ObjectCreate(G_str_concat_260, OBJ_LABEL, G_window_248, 0, 0, 0, 0); ObjectSet(G_str_concat_260, OBJPROP_CORNER, 1); ObjectSet(G_str_concat_260, OBJPROP_XDISTANCE, DisplayStarts_X + (Gi_208 - 1 - index_4) * (FontSize * 2)); ObjectSet(G_str_concat_260, OBJPROP_YDISTANCE, DisplayStarts_Y); ObjectSetText(G_str_concat_260, Gsa_216[index_4], FontSize - 2, Font_Font, FontColour); } for (index_0 = 0; index_0 < Gi_204; index_0++) { trendcount[index_0] = 0; for (index_4 = 0; index_4 < Gi_208; index_4++) { G_str_concat_260 = StringConcatenate(Gs_252, Gsa_212[index_0], Gsa_216[index_4]); ObjectDelete(G_str_concat_260); ObjectCreate(G_str_concat_260, OBJ_LABEL, G_window_248, 0, 0, 0, 0); ObjectSet(G_str_concat_260, OBJPROP_CORNER, 1); ObjectSet(G_str_concat_260, OBJPROP_XDISTANCE, DisplayStarts_X + (Gi_208 - 1 - index_4) * (FontSize * 2)); ObjectSet(G_str_concat_260, OBJPROP_YDISTANCE, DisplayStarts_Y + (index_0 + 1) * (FontSize + FontSize / 2)); ObjectSetText(G_str_concat_260, CharToStr(Gia_224[index_0][index_4]), FontSize, "Wingdings", Gia_228[index_0][index_4]); if (Gia_224[index_0][index_4]==Gi_164 || Gia_224[index_0][index_4]==Gi_172) { trendcount[index_0]=trendcount[index_0]+1; } else { if (Gia_224[index_0][index_4]==Gi_168 || Gia_224[index_0][index_4]==Gi_176) { trendcount[index_0]=trendcount[index_0]-1; } } } if (MathAbs(trendcount[index_0])==Gi_208 && MathAbs(trendcount_old[index_0])!=Gi_208) { if (trendcount[index_0]>0) { txt = "EMA10 BEGIN UP - " + Gsa_212[index_0] + "\n\n@ " + TimeToString(Time[0]); //TimeToString(TimeCurrent()); SendAlert(txt, 0); } if (trendcount[index_0]<0) { txt = " EMA10 BEGIN DN - " + Gsa_212[index_0] + "\n\n@ " + TimeToString(Time[0]); //TimeToString(TimeCurrent()); SendAlert(txt, 0); } } if (MathAbs(trendcount[index_0])!=Gi_208 && MathAbs(trendcount_old[index_0])==Gi_208) { if (trendcount_old[index_0]>0) { txt = "EMA10 END UP - " + Gsa_212[index_0] + "\n\n@ " + TimeToString(Time[0]); //TimeToString(TimeCurrent()); SendAlert(txt, 0); } if (trendcount_old[index_0]<0) { txt = " EMA10 END DN - " + Gsa_212[index_0] + "\n\n@ " + TimeToString(Time[0]); //TimeToString(TimeCurrent()); SendAlert(txt, 0); } } trendcount_old[index_0] = trendcount[index_0]; } } //+------------------------------------------------------------------+ //| SendAlert | //+------------------------------------------------------------------+ void SendAlert(string text, int idx) { if(idx!=0) return; if(Time[0]==lastBar) return; lastBar = Time[0]; if(inpAlertPopUp) Alert(text); if(inpAlertEmail) SendMail(text,text); } string GetTFtext(int tf) { switch(tf) { case 0: return("current"); case 1: return("M1"); case 5: return("M5"); case 15: return("M15"); case 30: return("M30"); case 60: return("H1"); case 240: return("H4"); case 1440: return("D1"); case 10080: return("W1"); case 43200: return("MN1"); default: return("current"); } }