Need help after new MT4 B600 updated

 


It should have already return a value of 50 for all time frame, however the new complier insists that I need to return a value outside the switch brackets ...

 
//+------------------------------------------------------------------+
//| Program's sub-function                                           |   
//+------------------------------------------------------------------+
   int ReadMaxHistoricalBars ( int Interval )
   {
   
      switch ( Interval )
      {
         case PERIOD_MN1 : return ( 50 ) ;
         case PERIOD_W1  : return ( 50 ) ;
         case PERIOD_D1  : return ( 50 ) ;
         case PERIOD_H4  : return ( 50 ) ;
         case PERIOD_H1  : return ( 50 ) ;
         case PERIOD_M30 : return ( 50 ) ;
         case PERIOD_M15 : return ( 50 ) ;
         case PERIOD_M5  : return ( 50 ) ;
         case PERIOD_M1  : return ( 50 ) ;
         default:          return (  0 ) ; //or whatever you want
      }
      
   }
//+------------------------------------------------------------------+
 
Okay somethings wrong after doing that
 
you can return whatever you want aiready written above
//or whatever you want

but this is not the problem

//+------------------------------------------------------------------+
//| Program's sub-function                                           |   
//+------------------------------------------------------------------+
   int ReadMaxHistoricalBars ( int Interval )
   {
   
      switch ( Interval )
      {
         case PERIOD_MN1 :
            return ( 50 );
            break;
         case PERIOD_W1  :
            return ( 50 ) ;
            break;
         case PERIOD_D1  :
            return ( 50 ) ;
            break;
         case PERIOD_H4  :
            return ( 50 ) ;
            break;
         case PERIOD_H1  :
            return ( 50 ) ;
            break;
         case PERIOD_M30 :
            return ( 50 ) ;
            break;
         case PERIOD_M15 :
            return ( 50 ) ;
            break;
         case PERIOD_M5  :
            return ( 50 ) ;
            break;
         case PERIOD_M1  :
            return ( 50 ) ;
            break;
         default:
            return (  0 ) ;
            break; //or whatever you want
      }
      
   }
//+------------------------------------------------------------------+
 
excuse me sir but all the errors you are talking about is not related in any way to B600>
it's basics in programing
 
its fine before 600
 
juniorlcq:

I can't compile this part too at strict .... the last if's acquiredbars needs declare ... but i already declare it at the 2nd for loop


AcquiredBars is local to the 2nd for loop.

If you need to retain the value between different blocks of code declare it before the for()


int AcquiredBars;   //Declare it here
for ( int i = 0 ; i < 10 ; i++ ) 
    //int AcquiredBars    //Or here
         {
            for ( int x = 0 ; x < TotalPairs ; x++ )
            {
               AcquiredBars = iBars ( MajorPairs[x] , Interval ) ;
               
               
               
               if ( Error != 0 || AcquiredBars < HistoricalBars )
               {
                  continue ;
               }
               else
               {
                  break ;
               }
            }
            
            
            
               if ( i == 9 && ( Error != 0 || AcquiredBars < HistoricalBars ) )
               {
                  return ( False ) ;
               }
         }
 
ok thank you, it becomes warning now
 
juniorlcq:
ok thank you, it becomes warning now
Common Errors in MQL4 Programs and How to Avoid Them
Reason: