Please Fix Error Warning in this code

To add comments, please log in or register
ECURRENCY TEAM
57
ECURRENCY TEAM  

The below code is showing  Warning Message "implicit conversion from 'number' to 'string'"


please fix it....


#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);

  }

//+------

Files:
error1.png 194 kb
William Roeder
19155
William Roeder  
ECURRENCY TEAM:  Warning Message "implicit conversion from 'number' to 'string'"

 please fix it....

  1. Please don't post an image of code or the editor — it is generally to small to be read.

    Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
              Messages Editor

  2. You know what the problem is. Fix it. Period() is a number, cast it to a string.
  3. You haven't stated a problem, you stated a want. You have only four choices:
    1. Search forit.
    2. Beg at
    3. learn to code it. If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into yours.
    4. or pay (Freelance) someone to code it.
    We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
              No free help
              urgent help.
To add comments, please log in or register