implicit conversion from 'number' to 'string' error on my custom fibo indicator

 

i am getting this error  " implicit conversion from 'number' to 'string' 

i am still new to coding and i am trying to figure out why this would cause this error.     

Section below is where the error is being generated

   SetIndexLabel(0,"Fibo("+BandsPeriod+")["+TimeFrame+"]");
   SetIndexLabel(1,"Fibo("+BandsPeriod+")Up1 "+BandsFiboDeviation1+"["+TimeFrame+"]");
   SetIndexLabel(2,"Fibo("+BandsPeriod+")Lo1 "+BandsFiboDeviation1+"["+TimeFrame+"]");
   SetIndexLabel(3,"Fibo("+BandsPeriod+")Up2 "+BandsFiboDeviation2+"["+TimeFrame+"]");
   SetIndexLabel(4,"Fibo("+BandsPeriod+")Lo2 "+BandsFiboDeviation2+"["+TimeFrame+"]");
   SetIndexLabel(5,"Fibo("+BandsPeriod+")Up3 "+BandsFiboDeviation3+"["+TimeFrame+"]");
   SetIndexLabel(6,"Fibo("+BandsPeriod+")Lo3 "+BandsFiboDeviation3+"["+TimeFrame+"]");


Below is the entire custom indicator.

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexBuffer(0,MovingBuffer);
   SetIndexBuffer(1,UpperBuffer1);
   SetIndexBuffer(2,LowerBuffer1);
   SetIndexBuffer(3,UpperBuffer2);
   SetIndexBuffer(4,LowerBuffer2);
   SetIndexBuffer(5,UpperBuffer3);
   SetIndexBuffer(6,LowerBuffer3);
 
 
         if(TimeFrame==0) TimeFrame = Period();
//
   SetIndexShift(0,BandsShift*TimeFrame/Period());
   SetIndexShift(1,BandsShift*TimeFrame/Period());
   SetIndexShift(2,BandsShift*TimeFrame/Period());
   SetIndexShift(3,BandsShift*TimeFrame/Period());
   SetIndexShift(4,BandsShift*TimeFrame/Period());
   SetIndexShift(5,BandsShift*TimeFrame/Period());
   SetIndexShift(6,BandsShift*TimeFrame/Period());

   SetIndexLabel(0,"Fibo("+BandsPeriod+")["+TimeFrame+"]");
   SetIndexLabel(1,"Fibo("+BandsPeriod+")Up1 "+BandsFiboDeviation1+"["+TimeFrame+"]");
   SetIndexLabel(2,"Fibo("+BandsPeriod+")Lo1 "+BandsFiboDeviation1+"["+TimeFrame+"]");
   SetIndexLabel(3,"Fibo("+BandsPeriod+")Up2 "+BandsFiboDeviation2+"["+TimeFrame+"]");
   SetIndexLabel(4,"Fibo("+BandsPeriod+")Lo2 "+BandsFiboDeviation2+"["+TimeFrame+"]");
   SetIndexLabel(5,"Fibo("+BandsPeriod+")Up3 "+BandsFiboDeviation3+"["+TimeFrame+"]");
   SetIndexLabel(6,"Fibo("+BandsPeriod+")Lo3 "+BandsFiboDeviation3+"["+TimeFrame+"]");

       if (TimeFrame < Period()) TimeFrame = Period();

 
   return(0);
  }

any advice would be great thanks.

 
  1. Ricks creations: i am getting this error  " implicit conversion from 'number' to 'string' 

    SetIndexLabel(0,"Fibo("+BandsPeriod+")["+TimeFrame+"]");

    Appending a number to a string.

  2. Ricks creations: any advice would be great thanks.

    Stop implicitly converting. Use a cast, IntegerToString, or StringFormat.

    SetIndexLabel(0, StringFormat("Fibo(%d)[%s]", BandsPeriod, TimeFrame) );
  3. No idea what TimeFrame is since you didn't provide post all relevant code (using Code button) or attach the source file.
         How To Ask Questions The Smart Way. (2004)
              Be precise and inive about your problem

    Perhaps as_string might help you.
              Why are MT5 ENUM_TIMEFRAMES strange? - General - MQL5 programming forum - Page 2 #11 (2020)