Download MetaTrader 5

"Not all control paths return a value" error

To add comments, please log in or register
tradingemperor
9
tradingemperor  

Hello, I am trying to code this system however after compiling it returns the "not all control paths return a value" and when I double click it shows its in the following block, could someone please point out the problem.

Thank you in advance

   {
      if(MainCCI[i] > ErgoCCI[i])
      {signal = "SHORT";}
      if (MainCCI[i] < ErgoCCI[i])
      {signal = "LONG";}
      if (MainCCI[i] == ErgoCCI[i])
      {signal = "NEUTRAL";}
 
    IndicatorShortName(""+signal);
   return(0); }
 }
//+------------------------------------------------------------------+
error
Ilyas
1202
Ilyas  
   {
    if(MainCCI[i] > ErgoCCI[i])
      {signal = "SHORT";}
    if (MainCCI[i] < ErgoCCI[i])
      {signal = "LONG";}
    if (MainCCI[i] == ErgoCCI[i])
      {signal = "NEUTRAL";}
 
    IndicatorShortName(""+signal);
    return(0);
   }

  // !!! return is absent in this block
 }
//+------------------------------------------------------------------
tradingemperor
9
tradingemperor  

mql5: I have tried it but it still doesn't work. Does it have a bug or something? :(

error 2

To add comments, please log in or register