Please Fix Error Warning in this code

To add comments, please log in or register
ECURRENCY TEAM
82
ECURRENCY TEAM  
//+------------------------------------------------------------------+
//|                                                      BOCount.mq4 |
//|     Copyright © 2019, INSTITUTE OF TECHNICAL ANALYSIS & TRAINING |
//|                                                                  |
//+------------------------------------------------------------------+

#property copyright "Copyright © 2019, INSTITUTE OF TECHNICAL ANALYSIS AND TRAINING "
#property link      "https://itatraining.business.site/"

#property strict
#property indicator_chart_window
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- input parameters
extern int ADX_period = 14;
extern bool UseADX_level        = true;
extern double ADX_level  = 23.6;

extern int CountBars=350;
extern bool Alert =true;
extern bool Sound =true;
extern bool Alert_via_Mobile = true;
extern string SoundFile="wait.waw";
//---- buffers
double val1[];
double val2[];
double b4plusdi,nowplusdi,b4minusdi,nowminusdi,b4adxmain,nowadxmain;
bool SoundBuy=False;
bool SoundSell=False;
string mss ="";
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- indicator line
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,108);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,108);
   SetIndexBuffer(0,val1);
   SetIndexBuffer(1,val2);
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| AltrTrend_Signal_v2_2                                            |
//+------------------------------------------------------------------+
int start()
  {
   if (CountBars>=Bars) CountBars=Bars;
   SetIndexDrawBegin(0,Bars-CountBars);
   SetIndexDrawBegin(1,Bars-CountBars);
   int i,shift,limit,CountedBars=IndicatorCounted();
   if (CountedBars < 1)
     {
      for(i=0; i<=CountBars; i++) {val1[i]=0.0; val2[i]=0.0;}
     }

   if(CountedBars > 0) CountedBars--;
//----   
   limit=Bars - CountedBars;
//----
   for(shift=limit; shift>=0; shift--)
     {
      b4plusdi=iADX(NULL,0,ADX_period,PRICE_CLOSE,MODE_PLUSDI,shift+1);
      nowplusdi=iADX(NULL,0,ADX_period,PRICE_CLOSE,MODE_PLUSDI,shift);
      b4minusdi=iADX(NULL,0,ADX_period,PRICE_CLOSE,MODE_MINUSDI,shift+1);
      nowminusdi=iADX(NULL,0,ADX_period,PRICE_CLOSE,MODE_MINUSDI,shift);
      b4adxmain = iADX(NULL,0,ADX_period,PRICE_CLOSE,MODE_MAIN,shift+1);
      nowadxmain = iADX(NULL,0,ADX_period,PRICE_CLOSE,MODE_MAIN,shift);
 
  
   if   (UseADX_level) 
     {
      if (b4plusdi<b4minusdi && nowplusdi>nowminusdi  &&  nowadxmain >= ADX_level)
         
         val1[shift]=Low[shift]-5*Point;
         
       if (b4adxmain < ADX_level && nowadxmain > ADX_level && nowplusdi>nowminusdi)
         
         val1[shift]=Low[shift]-5*Point;
            
         
      if (b4plusdi>b4minusdi && nowplusdi<nowminusdi  &&  nowadxmain >= ADX_level)
       val2[shift]=High[shift]+5*Point;
      if (b4adxmain < ADX_level && nowadxmain > ADX_level && nowplusdi<nowminusdi)
          val2[shift]=High[shift]+5*Point;

     } 
   
     else 
      {
      if (b4plusdi<b4minusdi && nowplusdi>nowminusdi)
         {
         val1[shift]=Low[shift]-5*Point;
         }
      if (b4plusdi>b4minusdi && nowplusdi<nowminusdi)
         {
         val2[shift]=High[shift]+5*Point;
         }
       } 
     }
   if (val1[0]!=EMPTY_VALUE && val1[0]!=0 && SoundBuy)
     {
      SoundBuy=False;
      if (Alert) Alert(Symbol(), " M", Period(), " ADX Cross UP");
      if (Sound) PlaySound (SoundFile);
      mss = Symbol()+ " M" + Period() +" ADX Cross UP ";
      if (Alert_via_Mobile) SendNotification(mss);
      
     }
   if (!SoundBuy && (val1[0]==EMPTY_VALUE || val1[0]==0)) SoundBuy=True;
   if (val2[0]!=EMPTY_VALUE && val2[0]!=0 && SoundSell)
     {
      SoundSell=False;
      if (Sound) PlaySound (SoundFile);
      mss = Symbol()+ " M" + Period() +" ADX Cross Down ";
      if (Alert_via_Mobile) SendNotification(mss);
     }
   if (!SoundSell && (val2[0]==EMPTY_VALUE || val2[0]==0)) SoundSell=True;
   return(0);
  }
//+------
William Roeder
19407
William Roeder  

You where shown previously how to fix the implicit string warning. You've learning nothing.

There are no slaves here. Learn to code or pay someone.

Mehmet Bastem
862
Mehmet Bastem  
ECURRENCY TEAM:
//+------------------------------------------------------------------+
//|                                                      BOCount.mq4 |
//|     Copyright © 2019, INSTITUTE OF TECHNICAL ANALYSIS & TRAINING |
//|                                                                  |
//+------------------------------------------------------------------+

#property copyright "Copyright © 2019, INSTITUTE OF TECHNICAL ANALYSIS AND TRAINING "
#property link      "https://itatraining.business.site/"

#property strict
#property indicator_chart_window
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- input parameters
extern int ADX_period = 14;
extern bool UseADX_level        = true;
extern double ADX_level  = 23.6;

extern int CountBars=350;
extern bool Alert =true;
extern bool Sound =true;
extern bool Alert_via_Mobile = true;
extern string SoundFile="wait.waw";
//---- buffers
double val1[];
double val2[];
double b4plusdi,nowplusdi,b4minusdi,nowminusdi,b4adxmain,nowadxmain;
bool SoundBuy=False;
bool SoundSell=False;
string mss ="";
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- indicator line
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,108);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,108);
   SetIndexBuffer(0,val1);
   SetIndexBuffer(1,val2);
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| AltrTrend_Signal_v2_2                                            |
//+------------------------------------------------------------------+
int start()
  {
   if (CountBars>=Bars) CountBars=Bars;
   SetIndexDrawBegin(0,Bars-CountBars);
   SetIndexDrawBegin(1,Bars-CountBars);
   int i,shift,limit,CountedBars=IndicatorCounted();
   if (CountedBars < 1)
     {
      for(i=0; i<=CountBars; i++) {val1[i]=0.0; val2[i]=0.0;}
     }

   if(CountedBars > 0) CountedBars--;
//----   
   limit=Bars - CountedBars;
//----
   for(shift=limit; shift>=0; shift--)
     {
      b4plusdi=iADX(NULL,0,ADX_period,PRICE_CLOSE,MODE_PLUSDI,shift+1);
      nowplusdi=iADX(NULL,0,ADX_period,PRICE_CLOSE,MODE_PLUSDI,shift);
      b4minusdi=iADX(NULL,0,ADX_period,PRICE_CLOSE,MODE_MINUSDI,shift+1);
      nowminusdi=iADX(NULL,0,ADX_period,PRICE_CLOSE,MODE_MINUSDI,shift);
      b4adxmain = iADX(NULL,0,ADX_period,PRICE_CLOSE,MODE_MAIN,shift+1);
      nowadxmain = iADX(NULL,0,ADX_period,PRICE_CLOSE,MODE_MAIN,shift);
 
  
   if   (UseADX_level) 
     {
      if (b4plusdi<b4minusdi && nowplusdi>nowminusdi  &&  nowadxmain >= ADX_level)
         
         val1[shift]=Low[shift]-5*Point;
         
       if (b4adxmain < ADX_level && nowadxmain > ADX_level && nowplusdi>nowminusdi)
         
         val1[shift]=Low[shift]-5*Point;
            
         
      if (b4plusdi>b4minusdi && nowplusdi<nowminusdi  &&  nowadxmain >= ADX_level)
       val2[shift]=High[shift]+5*Point;
      if (b4adxmain < ADX_level && nowadxmain > ADX_level && nowplusdi<nowminusdi)
          val2[shift]=High[shift]+5*Point;

     } 
   
     else 
      {
      if (b4plusdi<b4minusdi && nowplusdi>nowminusdi)
         {
         val1[shift]=Low[shift]-5*Point;
         }
      if (b4plusdi>b4minusdi && nowplusdi<nowminusdi)
         {
         val2[shift]=High[shift]+5*Point;
         }
       } 
     }
   if (val1[0]!=EMPTY_VALUE && val1[0]!=0 && SoundBuy)
     {
      SoundBuy=False;
      if (Alert) Alert(Symbol(), " M", Period(), " ADX Cross UP");
      if (Sound) PlaySound (SoundFile);
      mss = Symbol()+ " M" + string(Period()) +" ADX Cross UP ";
      if (Alert_via_Mobile) SendNotification(mss);
      
     }
   if (!SoundBuy && (val1[0]==EMPTY_VALUE || val1[0]==0)) SoundBuy=True;
   if (val2[0]!=EMPTY_VALUE && val2[0]!=0 && SoundSell)
     {
      SoundSell=False;
      if (Sound) PlaySound (SoundFile);
      mss = Symbol()+ " M" + string(Period()) +" ADX Cross Down ";
      if (Alert_via_Mobile) SendNotification(mss);
     }
   if (!SoundSell && (val2[0]==EMPTY_VALUE || val2[0]==0)) SoundSell=True;
   return(0);
  }
//+------
nicholi shen
2383
nicholi shen  
      if (Alert_via_Mobile) {
         SendNotification(StringFormat(
            "%s %s ADX Cross Down",
            Symbol(),
            EnumToString((ENUM_TIMEFRAMES)Period())
         ));
      }
To add comments, please log in or register