very simple!!

 

Guys,

I'm trying to write one line in the init() function to tell me if EA is attached to wrong time period..

please can someone tell me what is wrong with thsi!

if(!MarketInfo(Symbol(),PERIOD_H1))MessageBox("Attach EA to 1 Hour chart","Wrong Time Period",0);

thanks

 

!MarketInfo(Symbol(),PERIOD_H1)) //does not exist

try:

if(Period()!=PERIOD_H1){//BLA BLA BlA}
 
int start()
{

   if(Period()!=PERIOD_H1)
   {
      MessageBox("Attach EA to 1 Hour chart","Wrong Time Period",0);
      return(0);
   }
   //your code
}
 
codersguru:


thanks guys the simple ones always trip me up!
Reason: