Multi Alert Dahsboard Alert Problem

To add comments, please log in or register
TraDoXy
44
TraDoXy  

Dear Coders

kindly help me to fix this bug , this is a multi time-frames and multi pairs scanner,

it has a bug it only alert for the first signal not all, this is the code 

I will highly appreciate if you can guide me about this 


thanks in advance

//$------------------------------------------------------------------$
//|                                 Ichimoku Dashboard  Ultimate.mq4 |
//|                                       Copyright © 2010,  Tradoxy |
//|                                                                  |
//$------------------------------------------------------------------$
#property copyright "Copyright © 2011,  Tradoxy"


#property indicator_chart_window
// Inputs
extern string Monitoring_System           =">>>>>Ichimoku Dashboard  Ultimate<<<<<";
extern string Programmer                  ="Tradoxy";
extern string Show_the_distance_between   ="Last closed Candle and Setted line";
extern string Lines_Setup                 ="Setting of Each Line";
extern string Span_A                      = " Scanning_Mode = 0"; 
extern string Span_A_Shifted              = " Scanning_Mode = 6"; 
extern string Span_B                      = " Scanning_Mode = 1"; 
extern string FoxSen                      = " Scanning_Mode = 2"; 
extern string Tenkan                      = " Scanning_Mode = 3"; 
extern string Kijun                       = " Scanning_Mode = 4"; 
extern string FiboSen                     = " Scanning_Mode = 5"; 
string B = "   ";
extern int Scanning_Mode = 0;
extern string Corner_Position = "0,1,2,3";
extern int Corner = 1;
int X_Shift = 0;
int Y_Shift = 50;
//extern int Applied_Price= PRICE_MEDIAN; ??
extern int TextSize=16;
extern string FontType = "Arial";
extern color Label_Color= Lime;
extern color HeadsColor =White;
extern color Bullish    = Blue;
extern color At_Range   = Yellow;
extern color Bearish    = Red;

extern string Time_Frames = "Select Time Frame to Display";
extern bool Show_5M = FALSE;
extern bool Show_15M = TRUE;
extern bool Show_30M = TRUE;
extern bool Show_1H = TRUE;
extern bool Show_4H = TRUE;
extern bool Show_Daily = TRUE;
extern bool Show_Weekly = FALSE;
extern bool Show_Monthly = FALSE;

extern string Alert_Setting = "Sensitivity Setup";
extern bool Scan_only_Closed = TRUE;
extern bool NoneStopAlert=FALSE;
extern bool Disable_All_Alerts = TRUE;
extern bool Alert_5M = FALSE;
extern int Minimum_Distance_5M = 20;
extern bool Alert_15M = TRUE;
extern int Minimum_Distance_15M = 20;
extern bool Alert_30M = TRUE;
extern int Minimum_Distance_30M = 30;
extern bool Alert_1H = TRUE;
extern int Minimum_Distance_1H = 30;
extern bool Alert_4H = TRUE;
extern int Minimum_Distance_4H = 40;
extern bool Alert_Daily = TRUE;
extern int Minimum_Distance_Daily = 40;
extern bool Alert_Weekly = TRUE;
extern int Minimum_Distance_Weekly = 60;
extern bool Alert_Monthly = TRUE;
extern int Minimum_Distance_Monthly = 60;


extern string Pairs = " Select Pairs to Display ";

extern bool USDJPY = FALSE;

extern bool EURUSD = TRUE;
extern bool EURJPY = FALSE;
extern bool EURGBP = FALSE;
extern bool EURAUD = FALSE;
extern bool EURCHF = FALSE;
extern bool EURCAD = FALSE;
extern bool EURNZD = FALSE;

extern bool GBPUSD = TRUE;
extern bool GBPJPY = FALSE;
extern bool GBPCHF = FALSE;
extern bool GBPAUD = FALSE;
extern bool GBPCAD = FALSE;

extern bool AUDUSD = TRUE;
extern bool AUDJPY = FALSE;
extern bool AUDCAD = FALSE;
extern bool AUDNZD = FALSE;
extern bool AUDCHF = FALSE;

extern bool USDCHF = FALSE;
extern bool CHFJPY = FALSE;

extern bool USDCAD = FALSE;
extern bool CADCHF = FALSE;
extern bool CADJPY = FALSE;

extern bool NZDAUD = FALSE;
extern bool NZDCAD = FALSE;
extern bool NZDCHF = FALSE;
extern bool NZDUSD = FALSE;
extern bool NZDJPY = FALSE;

datetime q,Tq;

  int Tenkan_Sen, Kijun_Sen , Shift;
  string Line_Name;

//$------------------------------------------------------------------$
//| Custom indicator initialization function                         |
//$------------------------------------------------------------------$

int init()
  {
   
   
 return(0);
  }
//$------------------------------------------------------------------$
//| Custom indicator deinitialization function                       |
//$------------------------------------------------------------------$
int deinit()
  {
//----
   ObjectsDeleteAll();
//----
   return(0);
  }
//$------------------------------------------------------------------$
//| Custom indicator iteration function                              |
//$------------------------------------------------------------------$
int start()
  {


  if (Scanning_Mode == 0) 
  {
  Line_Name  = "Span A";
  Tenkan_Sen =  9 ;
  Kijun_Sen  = 26 ;
  Shift      = 0 ;
  }

  if (Scanning_Mode == 6) 
  {
  Line_Name  = "Span A+Shift";
  Tenkan_Sen =  9 ;
  Kijun_Sen  = 26 ;
  Shift      = 26 ;
  }
  
  if (Scanning_Mode == 1)
  {                               
  Line_Name  = "Span B";
  Tenkan_Sen = 52 ;
  Kijun_Sen  = 52 ;
  Shift      = 26 ;
  }
  
  
  if (Scanning_Mode == 2)                               
  {
  Line_Name  = "Fox Sen";
  Tenkan_Sen = 366 ;
  Kijun_Sen  = 366 ;
  Shift      =  0  ;  
  }

   if (Scanning_Mode == 3)
   {                                   
   Line_Name  = "Tenkan Sen";
   Tenkan_Sen =  9 ;
   Kijun_Sen  =  9 ;
   Shift      =  0 ;
  }
  
  if (Scanning_Mode == 4)
  {                                 
   Line_Name  = "Kijun Sen";
   Tenkan_Sen = 26 ;
   Kijun_Sen  = 26 ;
   Shift      =  0 ;
  }
   if (Scanning_Mode == 5)
   {
  Line_Name  = "Fibo Sen";
  Tenkan_Sen = 61 ;
  Kijun_Sen  = 61 ;
  Shift      =  0 ;
   }



                                  
  //----Label----
     ObjectCreate(Line_Name, OBJ_LABEL,0, 0, 0);
     ObjectSet(Line_Name, OBJPROP_CORNER, Corner);
     ObjectSet(Line_Name, OBJPROP_XDISTANCE, 20);
     ObjectSet(Line_Name, OBJPROP_YDISTANCE, 20);
     ObjectSetText(Line_Name,Line_Name, TextSize, FontType, Label_Color);
  //-------------
  
  
   if(Scan_only_Closed&&Tq==Time[0])return(0);
   Tq=Time[0];
  int l=0;
  if(Show_5M){create("TF_2"+B+Line_Name,"[M5]",HeadsColor,150,75,0);l=90;}
  if(Show_15M){create("TF_3"+B+Line_Name,"[M15]",HeadsColor,150+l,75,0);l+=90;}
  if(Show_30M){create("TF_4"+B+Line_Name,"[M30]",HeadsColor,150+l,75,0);l+=90;}
  if(Show_1H){create("TF_5"+B+Line_Name,"[H1]",HeadsColor,150+l,75,0);l+=90;}
  if(Show_4H){create("TF_6"+B+Line_Name,"[4H]",HeadsColor,150+l,75,0);l+=90;}
  if(Show_Daily){create("TF_7"+B+Line_Name,"[D1]",HeadsColor,150+l,75,0);l+=90;}
  if(Show_Weekly){create("TF_8"+B+Line_Name,"[W1]",HeadsColor,150+l,75,0);l+=90;}
  if(Show_Monthly){create("TF_9"+B+Line_Name,"[MN1]",HeadsColor,150+l,75,0);l+=90;}
   int q=0;
   if(USDCHF){
   create("USDCHF"+B+Line_Name,"USDCHF",HeadsColor,20,120,0);
   draw("USDCHF",120+q);q+=30;alert("USDCHF");}
   if(EURUSD){
   create("EURUSD"+B+Line_Name,"EURUSD",HeadsColor,20,120+q,0);
   draw("EURUSD",120+q);q+=30;alert("EURUSD");}
   if(EURJPY){
   create("EURJPY"+B+Line_Name,"EURJPY",HeadsColor,20,120+q,0);
   draw("EURJPY",120+q);q+=30;alert("EURJPY");}
   if(GBPUSD){
   create("GBPUSD"+B+Line_Name,"GBPUSD",HeadsColor,20,120+q,0);
   draw("GBPUSD",120+q);q+=30;alert("GBPUSD");}
   if(GBPJPY){
   create("GBPJPY"+B+Line_Name,"GBPJPY",HeadsColor,20,120+q,0);
   draw("GBPJPY",120+q);q+=30;alert("GBPJPY");}
   if(USDJPY){
   create("USDJPY"+B+Line_Name,"USDJPY",HeadsColor,20,120+q,0);
   draw("USDJPY",120+q);q+=30;alert("USDJPY");}
   if(AUDUSD){
   create("AUDUSD"+B+Line_Name,"AUDUSD",HeadsColor,20,120+q,0);
   draw("AUDUSD",120+q);q+=30;alert("AUDUSD");}
   if(USDCAD){
   create("USDCAD"+B+Line_Name,"USDCAD",HeadsColor,20,120+q,0);
   draw("USDCAD",120+q);q+=30;alert("USDCAD");}
   if(CADJPY){
   create("CADJPY"+B+Line_Name,"CADJPY",HeadsColor,20,120+q,0);
   draw("CADJPY",120+q);q+=30;alert("CADJPY");}
   if(EURGBP){
   create("EURGBP"+B+Line_Name,"EURGBP",HeadsColor,20,120+q,0);
   draw("EURGBP",120+q);q+=30;alert("EURGBP");}
   if(EURCHF){
   create("EURCHF"+B+Line_Name,"EURCHF",HeadsColor,20,120+q,0);
   draw("EURCHF",120+q);q+=30;alert("EURCHF");}
   if(EURCAD){
   create("EURCAD"+B+Line_Name,"EURCAD",HeadsColor,20,120+q,0);
   draw("EURCAD",120+q);q+=30;alert("EURCAD");}
   if(AUDJPY){
   create("AUDJPY"+B+Line_Name,"AUDJPY",HeadsColor,20,120+q,0);
   draw("AUDJPY",120+q);q+=30;alert("AUDJPY");}
   if(EURAUD){
   create("EURAUD"+B+Line_Name,"EURAUD",HeadsColor,20,120+q,0);
   draw("EURAUD",120+q);q+=30;alert("EURAUD");}
   if(CHFJPY){
   create("CHFJPY"+B+Line_Name,"CHFJPY",HeadsColor,20,120+q,0);
   draw("CHFJPY",120+q);q+=30;alert("CHFJPY");}
   if(GBPCHF){
   create("GBPCHF"+B+Line_Name,"GBPCHF",HeadsColor,20,120+q,0);
   draw("GBPCHF",120+q);q+=30;alert("GBPCHF");}
   if(AUDCAD){
   create("AUDCAD"+B+Line_Name,"AUDCAD",HeadsColor,20,120+q,0);
   draw("AUDCAD",120+q);q+=30;alert("AUDCAD");}
   if(GBPAUD){
   create("GBPAUD"+B+Line_Name,"GBPAUD",HeadsColor,20,120+q,0);
   draw("GBPAUD",120+q);q+=30;alert("GBPAUD");}
   if(NZDJPY){
   create("NZDJPY"+B+Line_Name,"NZDJPY",HeadsColor,20,120+q,0);
   draw("NZDJPY",120+q);q+=30;alert("NZDJPY");}
   if(AUDCHF){
   create("AUDCHF"+B+Line_Name,"AUDCHF",HeadsColor,20,120+q,0);
   draw("AUDCHF",120+q);q+=30;alert("AUDCHF");}
   if(EURNZD){
   create("EURNZD"+B+Line_Name,"EURNZD",HeadsColor,20,120+q,0);
   draw("EURNZD",120+q);q+=30;alert("EURNZD");}    
   if(GBPCAD){
   create("GBPCAD"+B+Line_Name,"GBPCAD",HeadsColor,20,120+q,0);
   draw("GBPCAD",120+q);q+=30;alert("GBPCAD");}
   if(CADCHF){
   create("CADCHF"+B+Line_Name,"CADCHF",HeadsColor,20,120+q,0);
   draw("CADCHF",120+q);q+=30;alert("CADCHF");}
   if(NZDAUD){
   create("NZDAUD"+B+Line_Name,"NZDAUD",HeadsColor,20,120+q,0);
   draw("NZDAUD",120+q);q+=30;alert("NZDAUD");}
   if(NZDCAD){
   create("NZDCAD"+B+Line_Name,"NZDCAD",HeadsColor,20,120+q,0);
   draw("NZDCAD",120+q);q+=30;alert("NZDCAD");}
   if(NZDCHF){
   create("NZDCHF"+B+Line_Name,"NZDCHF",HeadsColor,20,120+q,0);
   draw("NZDCHF",120+q);q+=30;alert("NZDCHF");}
   if(NZDUSD){
   create("NZDUSD"+B+Line_Name,"NZDUSD",HeadsColor,20,120+q,0);
   draw("NZDUSD",120+q);q+=30;alert("NZDUSD");}
   if(AUDNZD){
   create("AUDNZD"+B+Line_Name,"AUDNZD",HeadsColor,20,120+q,0);
   draw("AUDNZD",120+q);q+=30;alert("AUDNZD");}
 
    return(0);
  }
  
void draw(string Sym,int q){
int l;
if(Show_5M){create(Sym+"_5M"+B+Line_Name,DoubleToStr(MathAbs(GetInd(Sym,5)),0),GetColor(Minimum_Distance_5M,Sym,5),150,q,0);l=90;}
if(Show_15M){create(Sym+"_15M"+B+Line_Name,DoubleToStr(MathAbs(GetInd(Sym,15)),0),GetColor(Minimum_Distance_15M,Sym,15),150+l,q,0);l+=90;}
if(Show_30M){create(Sym+"_30M"+B+Line_Name,DoubleToStr(MathAbs(GetInd(Sym,30)),0),GetColor(Minimum_Distance_30M,Sym,30),150+l,q,0);l+=90;}
if(Show_1H){create(Sym+"_60M"+B+Line_Name,DoubleToStr(MathAbs(GetInd(Sym,60)),0),GetColor(Minimum_Distance_1H,Sym,60),150+l,q,0);l+=90;}
if(Show_4H){create(Sym+"_240M"+B+Line_Name,DoubleToStr(MathAbs(GetInd(Sym,240)),0),GetColor(Minimum_Distance_4H,Sym,240),150+l,q,0);l+=90;}
if(Show_Daily){create(Sym+"_1440M"+B+Line_Name,DoubleToStr(MathAbs(GetInd(Sym,1440)),0),GetColor(Minimum_Distance_Daily,Sym,1440),150+l,q,0);l+=90;}
if(Show_Weekly){create(Sym+"_10080M"+B+Line_Name,DoubleToStr(MathAbs(GetInd(Sym,10080)),0),GetColor(Minimum_Distance_Weekly,Sym,10080),150+l,q,0);l+=90;}
if(Show_Monthly){create(Sym+"_43200M"+B+Line_Name,DoubleToStr(MathAbs(GetInd(Sym,43200)),0),GetColor(Minimum_Distance_Monthly,Sym,43200),150+l,q,0);l+=90;}
}
   
color GetColor(int Min,string Sym,int TF){
if(GetInd(Sym,TF)>Min)return(Bullish);
if(GetInd(Sym,TF)<-Min)return(Bearish);
if(GetInd(Sym,TF)<Min)return(At_Range);
}
void alert(string Sym){
 if(!Disable_All_Alerts){
if(GetInd(Sym,5)<Minimum_Distance_5M&&Alert_5M)if(!SameCandle(Time[0])||NoneStopAlert)Alert(Sym+"  Inside Range ,TimeFrame : 5M ");
if(GetInd(Sym,15)<Minimum_Distance_15M&&Alert_15M)if(!SameCandle(Time[0])||NoneStopAlert)Alert(Sym+"  Inside Range ,TimeFrame : 15M ");
if(GetInd(Sym,30)<Minimum_Distance_30M&&Alert_30M)if(!SameCandle(Time[0])||NoneStopAlert)Alert(Sym+"  Inside Range ,TimeFrame : 30M ");
if(GetInd(Sym,60)<Minimum_Distance_1H&&Alert_1H)if(!SameCandle(Time[0])||NoneStopAlert)Alert(Sym+"  Inside Range ,TimeFrame : 1H ");
if(GetInd(Sym,240)<Minimum_Distance_4H&&Alert_4H)if(!SameCandle(Time[0])||NoneStopAlert)Alert(Sym+"  Inside Range ,TimeFrame : 4H ");
if(GetInd(Sym,1440)<Minimum_Distance_Daily&&Alert_Daily)if(!SameCandle(Time[0])||NoneStopAlert)Alert(Sym+"  Inside Range ,TimeFrame : 1D ");
if(GetInd(Sym,10080)<Minimum_Distance_Weekly&&Alert_Weekly)if(!SameCandle(Time[0])||NoneStopAlert)Alert(Sym+"  Inside Range ,TimeFrame : 1W ");
if(GetInd(Sym,43200)<Minimum_Distance_Monthly&&Alert_Monthly)if(!SameCandle(Time[0])||NoneStopAlert)Alert(Sym+"  Inside Range ,TimeFrame : 1MN ");
  }
 }
bool SameCandle(datetime T){

 if(T!=q){
 q=T;
 return(FALSE);
  }
 return(TRUE);
 } 
double GetInd(string Sym,int TF){
int D;double point;
if(Scan_only_Closed)D=1;
else D=0;
if(MarketInfo(Sym,MODE_DIGITS)<4){point=0.01;}
 else{point=0.0001;}
//double span=iCustom(Sym,TF,"Span A",Tenkan_Sen,Kijun_Sen,0,2,Shift,SandyBrown,2,D+Shift);
double span=iIchimoku(Sym,TF,Tenkan_Sen,Kijun_Sen,52,MODE_SENKOUSPANA,D+Shift);
return((iClose(Sym,TF,D)-span)/point);
}  
void create(string name, string text, color Color_, int X, int Y, int TextCorner) {
   if (ObjectFind(name) != -1) ObjectDelete(name);
   ObjectCreate(name, OBJ_LABEL, 0, 0, 0);
   ObjectSet(name, OBJPROP_CORNER, Corner);
 
   ObjectSet(name, OBJPROP_COLOR, Color_);
   ObjectSet(name, OBJPROP_XDISTANCE, X-X_Shift);
   ObjectSet(name, OBJPROP_YDISTANCE, Y-Y_Shift);
   ObjectSetText(name, text, TextSize, FontType, Color_);
   //Bodoni MT Black
} 

//$------------------------------------------------------------------$

TraDoXy
44
TraDoXy  

Dear Coders

Kindly support about this issue

Marco vd Heijden
Moderator
8175
Marco vd Heijden  
Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • www.mql5.com
First remove errors change  if(DayOfWeek()==5 && Hour() >= FridayCloseHour)  FridayCloseHour r//if time == 00;00 do nothing  leave trade open quote separably  for below Add custom indicator joy to ea //same job as here  but coded as modular , calling magic to each signal https://www.mql5.com/en/job/83347 custom indicator addition  to ea...
To add comments, please log in or register