EA init M1 and Signal M5 - different behavior from demo account to real account.

 

I have studied EA and one question is challenge me.

This EA is initialized with second argument "Period()" as showed below. I have tested with M1 chart. I supposed the refresh (check close and open trade) is about each minute...

In the second block, I coded a signal, that is based each M5. 

In the demo account it works perfectly, but in the real account, the same EA open and close one trade for each minute! The broker is the same !


I updated the MT5 to the same version...


Any ideas to solve this mistery ?


Cheers,


input ENUM_TIMEFRAMES periodo=PERIOD_M5;


CExpert ExtExpert;
//+------------------------------------------------------------------+
//| Initialization function of the expert                            |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- Initializing expert
   if(!ExtExpert.Init(Symbol(),Period(),Expert_EveryTick,Expert_MagicNumber))
      
     {
     
      //--- failed
      printf(__FUNCTION__+": error initializing expert");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }


//--- Creating filter CSignalMACD
   CSignalMACD *filter0=new CSignalMACD;
   if(filter0==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating filter0");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
   signal.AddFilter(filter0);
//--- Set filter parameters
   filter0.Period(periodo);
   filter0.PeriodFast(Signal_MACD_PeriodFast);
   filter0.PeriodSlow(Signal_MACD_PeriodSlow);
   filter0.PeriodSignal(Signal_MACD_PeriodSignal);
   filter0.Applied(Signal_MACD_Applied);
   filter0.Weight(Signal_MACD_Weight);