//+------------------------------------------------------------------+ //| Daily Forex Signal.mq4 | //| Copyright © 2009, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_separate_window extern bool Alert_FS=true; extern color Color=Yellow; double tik,tik1,tp[23],tp1[23],x1; int tik2,x=1; bool l_color=false,tabe=false; int init() { IndicatorShortName("Daily Forex Signal"); if(Digits==5 || Digits==3)x=10;else x=1; return (0); } int deinit() { ObjectsDeleteAll(1, OBJ_LABEL);l_color=false; return (0); } int start() { tik=Bid; if(tik!=tik1){tik1=tik;tik2++;} if(tik2==24)tik2=0; if(tik2==1)alerts(1,"EURUSD", "label-01", "arrow-01", "ttp-01", "tp-01", "act-01", 2, 38);//2 285 570 860 if(tik2==2)alerts(2,"GBPUSD", "label-02", "arrow-02", "ttp-02", "tp-02", "act-02", 2, 56); if(tik2==3)alerts(3,"AUDUSD", "label-03", "arrow-03", "ttp-03", "tp-03", "act-03", 2, 74); if(tik2==4)alerts(4,"NZDUSD", "label-04", "arrow-04", "ttp-04", "tp-04", "act-04", 2, 92); if(tik2==5)alerts(5,"EURGBP", "label-05", "arrow-05", "ttp-05", "tp-05", "act-05", 2, 110); if(tik2==6)alerts(6,"USDJPY", "label-06", "arrow-06", "ttp-06", "tp-06", "act-06", 2, 128); if(tik2==7)alerts(7,"EURJPY", "label-07", "arrow-07", "ttp-07", "tp-07", "act-07", 2, 146); if(tik2==8)alerts(8,"CHFJPY", "label-08", "arrow-08", "ttp-08", "tp-08", "act-08", 2, 164); if(tik2==9)alerts(9,"AUDJPY", "label-09", "arrow-09", "ttp-09", "tp-09", "act-09", 375, 38); if(tik2==10)alerts(10,"CADJPY", "label-10", "arrow-10", "ttp-10", "tp-10", "act-10", 375, 56); if(tik2==11)alerts(11,"GBPJPY", "label-11", "arrow-11", "ttp-11", "tp-11", "act-11", 375, 74); if(tik2==12)alerts(12,"EURCHF", "label-12", "arrow-12", "ttp-12", "tp-12", "act-12", 375, 92); if(tik2==13)alerts(13,"USDCHF", "label-13", "arrow-13", "ttp-13", "tp-13", "act-13", 375, 110); if(tik2==14)alerts(14,"GBPCHF", "label-14", "arrow-14", "ttp-14", "tp-14", "act-14", 375, 128); if(tik2==15)alerts(15,"CADCHF", "label-15", "arrow-15", "ttp-15", "tp-15", "act-15", 375, 146); if(tik2==16)alerts(16,"NZDCHF", "label-16", "arrow-16", "ttp-16", "tp-16", "act-16", 375, 164); if(tik2==17)alerts(17,"AUDCHF", "label-17", "arrow-17", "ttp-17", "tp-17", "act-17", 750, 38); if(tik2==18)alerts(18,"USDCAD", "label-18", "arrow-18", "ttp-18", "tp-18", "act-18", 750, 56); if(tik2==19)alerts(19,"AUDCAD", "label-19", "arrow-19", "ttp-19", "tp-19", "act-19", 750, 74); if(tik2==20)alerts(20,"EURCAD", "label-20", "arrow-20", "ttp-20", "tp-20", "act-20", 750, 92); if(tik2==21)alerts(21,"NZDCAD", "label-21", "arrow-21", "ttp-21", "tp-21", "act-21", 750, 110); if(tik2==22)alerts(22,"CHFCAD", "label-22", "arrow-22", "ttp-22", "tp-22", "act-22", 750, 128); if(tik2==23)alerts(23,"GBPCAD", "label-23", "arrow-23", "ttp-23", "tp-23", "act-23", 750, 146); return (0); } void alerts(int i,string asymbol_0, string aname_8, string aname_16, string aname_24, string aname_32, string aname_40, int ax_48, int ay_52) { string lsunused_176,txtsp; double lima_184; double price; double lima_192; double lima_200; double lima_208; color lcolor_220; string ltext_224; color lcolor_232; string ltext_236; color lcolor_244; string ltext_248; color lcolor_256; string lsunused_284; string lsunused_292; string lsunused_300; string lsunused_308; int li_332; string ls_56 = "Daily Forex Signal"; double lpoint_64 = MarketInfo(asymbol_0, MODE_POINT); int lperiod_72 = 24; int lperiod_76 = 72; double lima_80 = iMA(asymbol_0, PERIOD_M30, lperiod_72, 0, MODE_EMA, PRICE_CLOSE, 0); double lima_88 = iMA(asymbol_0, PERIOD_M30, lperiod_76, 0, MODE_EMA, PRICE_CLOSE, 0); double lima_96 = iMA(asymbol_0, PERIOD_H1, lperiod_72, 0, MODE_EMA, PRICE_CLOSE, 0); double lima_104 = iMA(asymbol_0, PERIOD_H1, lperiod_76, 0, MODE_EMA, PRICE_CLOSE, 0); double lima_112 = iMA(asymbol_0, PERIOD_H4, lperiod_72, 0, MODE_EMA, PRICE_CLOSE, 0); double lima_120 = iMA(asymbol_0, PERIOD_H4, lperiod_76, 0, MODE_EMA, PRICE_CLOSE, 0); double lima_128 = iMA(asymbol_0, PERIOD_D1, lperiod_72, 0, MODE_EMA, PRICE_CLOSE, 0); double lima_136 = iMA(asymbol_0, PERIOD_D1, lperiod_76, 0, MODE_EMA, PRICE_CLOSE, 0); int lbool_144 = lima_80 > lima_88 && lima_96 > lima_104 && lima_112 > lima_120 && lima_128 > lima_136; int lbool_148 = lima_80 < lima_88 && lima_96 < lima_104 && lima_112 < lima_120 && lima_128 < lima_136; int lbool_152 = lima_80 > lima_88 && lima_96 > lima_104 && lima_112 > lima_120 && lima_128 < lima_136; int lbool_156 = lima_80 < lima_88 && lima_96 < lima_104 && lima_112 < lima_120 && lima_128 > lima_136; int lcount_160 = 0; int li_164 = 49; int lcount_168 = 0; for (lcount_160 = 1; lcount_160 < li_164; lcount_160++) { lima_184 = iMA(asymbol_0, PERIOD_M30, 24, 0, MODE_EMA, PRICE_CLOSE, lcount_160 - 1); lima_192 = iMA(asymbol_0, PERIOD_M30, 72, 0, MODE_EMA, PRICE_CLOSE, lcount_160 - 1); lima_200 = iMA(asymbol_0, PERIOD_M30, 24, 0, MODE_EMA, PRICE_CLOSE, lcount_160 + 1); lima_208 = iMA(asymbol_0, PERIOD_M30, 72, 0, MODE_EMA, PRICE_CLOSE, lcount_160 + 1); if ((lima_184 > lima_192 && lima_200 < lima_208) || (lima_184 < lima_192 && lima_200 > lima_208)) lcount_168++; } int li_216 = lcount_168 < 1; string txt,alr; int lspread_316 = MarketInfo(asymbol_0, MODE_SPREAD); int ldbl2str_276 = lspread_316; double lask_324 = MarketInfo(asymbol_0, MODE_ASK); double pnt=MarketInfo(asymbol_0,MODE_POINT); int dig=MarketInfo(asymbol_0,MODE_DIGITS); double buy=MarketInfo(asymbol_0,MODE_ASK); double sell=MarketInfo(asymbol_0,MODE_BID); datetime time= TimeCurrent(); if (lask_324 > 10.0) li_332 = 2; else li_332 = 4; double lihigh_336 = iHigh(asymbol_0, PERIOD_D1, 1); double lilow_344 = iLow(asymbol_0, PERIOD_D1, 1); double liclose_352 = iClose(asymbol_0, PERIOD_D1, 1); double ld_360 = (lihigh_336 + lilow_344 + liclose_352) / 3.0; ld_360 = NormalizeDouble(ld_360, li_332); double ld_368 = 2.0 * ld_360 - lihigh_336; ld_368 = NormalizeDouble(ld_368, li_332); double ld_376 = 2.0 * ld_360 - lilow_344; ld_376 = NormalizeDouble(ld_376, li_332); double lirsi_384 = iRSI(asymbol_0, PERIOD_M30, 14, PRICE_CLOSE, 0); double limacd_392 = iMACD(asymbol_0, PERIOD_M30, 5, 13, 1, PRICE_CLOSE, MODE_MAIN, 0); double limacd_400 = iMACD(asymbol_0, PERIOD_M30, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 0); double listochastic_408 = iStochastic(asymbol_0, PERIOD_M30, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, 0); tabe=false; //price=DoubleToStr(iClose(a_symbol_0, PERIOD_D1, 0),dig); if(tik2<24 && !l_color){lcolor_256 = Gray;tabe=true;} if(tik2==23)l_color=true; if (lbool_144 && li_216 && lirsi_384 > 50.0 && limacd_392 > 0.0 && limacd_400 > 0.0) { tp[i]=lihigh_336; if(tp[i]!=tp1[i]) {tp1[i]=tp[i]; ltext_224 = "Buy"; lcolor_220 = Lime; lcolor_256 = Lime; ltext_236 = "TP "+DoubleToStr(lihigh_336,dig); lcolor_232 = Lime; ltext_248 = "TP"; lcolor_244 = Lime; txt=" AT "+DoubleToStr(buy,dig)+" ("+TimeToStr(time,TIME_MINUTES)+")"; alr = "Daily FS BUY: " + asymbol_0 + " @ " + DoubleToStr(buy,dig) + "TP "+DoubleToStr(lihigh_336,dig)+ " (" + TimeToStr(time, TIME_MINUTES) + ")"; if(Alert_FS)Alert(alr); tabe=true;} } else { if (lbool_148 && li_216 && lirsi_384 < 50.0 && limacd_392 < 0.0 && limacd_400 < 0.0) { tp[i]=lilow_344; if(tp[i]!=tp1[i]) {tp1[i]=tp[i]; ltext_224 = "Sell"; lcolor_220 = Red; lcolor_256 = Red; ltext_236 = "TP "+DoubleToStr(lilow_344,dig); lcolor_232 = Red; ltext_248 = "TP"; lcolor_244 = Red; txt=" AT "+DoubleToStr(sell,dig)+" ("+TimeToStr(time,TIME_MINUTES)+")"; alr = "Daily FS SELL: " + asymbol_0 + " @ " + DoubleToStr(sell,dig) + "TP "+DoubleToStr(lilow_344,dig)+ " (" + TimeToStr(time, TIME_MINUTES) + ")"; if(Alert_FS)Alert(alr); tabe=true;} } else { if (lbool_152 && li_216) { tp[i]=ld_376; if(tp[i]!=tp1[i]) {tp1[i]=tp[i]; ltext_224 = "Buy"; lcolor_220 = Lime; lcolor_256 = Lime; ltext_236 = "TP "+DoubleToStr(ld_376,dig); lcolor_232 = Lime; ltext_248 = "TP"; lcolor_244 = Lime; txt=" AT "+DoubleToStr(buy,dig)+" ("+TimeToStr(time,TIME_MINUTES)+")"; alr = "Daily FS BUY: " + asymbol_0 + " @ " + DoubleToStr(buy,dig) + "TP "+DoubleToStr(ld_376,dig)+ " (" + TimeToStr(time, TIME_MINUTES) + ")"; if(Alert_FS)Alert(alr); tabe=true;} } else { if (lbool_156 && li_216) { tp[i]=ld_368; if(tp[i]!=tp1[i]) {tp1[i]=tp[i]; ltext_224 = "Sell"; lcolor_220 = Red; lcolor_256 = Red; ltext_236 = "TP "+DoubleToStr(ld_368,dig); lcolor_232 = Red; ltext_248 = "TP"; lcolor_244 = Red; txt=" AT "+DoubleToStr(sell,dig)+" ("+TimeToStr(time,TIME_MINUTES)+")"; alr = "Daily FS SELL: " + asymbol_0 + " @ " + DoubleToStr(sell,dig) + "TP "+DoubleToStr(ld_368,dig)+ " (" + TimeToStr(time, TIME_MINUTES) + ")"; if(Alert_FS)Alert(alr); tabe=true;} } else { ltext_224 = ""; lcolor_220 = Black; lcolor_256 = Gray; ltext_236 = ""; lcolor_232 = Black; ltext_248 = ""; lcolor_244 = Black; txt="";tp1[i]=0;tabe=true; } } } } txtsp=" Spr "+DoubleToStr(ldbl2str_276/x,1)+" Bid "+DoubleToStr(sell,dig); ObjectCreate(aname_16, OBJ_LABEL, WindowFind(ls_56), 0, 0);//cpred ObjectSetText(aname_16,txtsp, 8, "Arial Bold", Color); ObjectSet(aname_16, OBJPROP_CORNER, 0); ObjectSet(aname_16, OBJPROP_XDISTANCE, ax_48); ObjectSet(aname_16, OBJPROP_YDISTANCE, ay_52 + 1); if(tabe) { ObjectCreate(aname_8, OBJ_LABEL, WindowFind(ls_56), 0, 0); ObjectSetText(aname_8, asymbol_0, 9, "Arial Bold", lcolor_256);//symvol ObjectSet(aname_8, OBJPROP_CORNER, 0); ObjectSet(aname_8, OBJPROP_XDISTANCE, ax_48 + 103);//13 ObjectSet(aname_8, OBJPROP_YDISTANCE, ay_52); ObjectCreate(aname_40, OBJ_LABEL, WindowFind(ls_56), 0, 0); ObjectSetText(aname_40, ltext_224, 10, "Arial Bold", lcolor_220);//buy sell ObjectSet(aname_40, OBJPROP_CORNER, 0); ObjectSet(aname_40, OBJPROP_XDISTANCE, ax_48 + 155);//65 ObjectSet(aname_40, OBJPROP_YDISTANCE, ay_52 + 0); ObjectCreate(aname_24, OBJ_LABEL, WindowFind(ls_56), 0, 0); ObjectSetText(aname_24, ltext_236, 10, "Arial Bold", lcolor_232);//cel ObjectSet(aname_24, OBJPROP_CORNER, 0); ObjectSet(aname_24, OBJPROP_XDISTANCE, ax_48 + 178);//98 ObjectSet(aname_24, OBJPROP_YDISTANCE, ay_52 + 0); //--- ObjectCreate(aname_32, OBJ_LABEL, WindowFind(ls_56), 0, 0); ObjectSetText(aname_32, txt, 10, "Arial Bold", lcolor_244);//tp ObjectSet(aname_32, OBJPROP_CORNER, 0); ObjectSet(aname_32, OBJPROP_XDISTANCE, ax_48 + 255);//165 ObjectSet(aname_32, OBJPROP_YDISTANCE, ay_52 + 0); } } //--