Here is my code:
//+------------------------------------------------------------------+
//| Test.mq5 |
//| Copyright 2017, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
ENUM_TIMEFRAMES TF[]=
{
PERIOD_M1,PERIOD_M5,PERIOD_M15,PERIOD_M30,PERIOD_H1,
PERIOD_H2,PERIOD_H3,PERIOD_H4,PERIOD_H6,PERIOD_H8,
PERIOD_H12,PERIOD_D1
};
int iMACD_Handle[12];
for(int i=0;i<12;i++)
{
ResetLastError();
iMACD_Handle[i]=iMACD(Symbol(),TF[i],20,60,6,PRICE_CLOSE);
if(iMACD_Handle[i]==INVALID_HANDLE)
{
PrintFormat("iMACD_Handle==INVALID_HANDLE, Symbol=%s, TimeFrame=%s, Error=%d %s",
Symbol(),EnumToString(TF[i]),IntegerToString(GetLastError()));
}
};
Print("OnInit INIT_SUCCEEDED!");
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//--- destroy timer
EventKillTimer();
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
}
//+------------------------------------------------------------------+
//| Timer function |
//+------------------------------------------------------------------+
void OnTimer()
{
//---
}
//+------------------------------------------------------------------+
//| ChartEvent function |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
const long &lparam,
const double &dparam,
const string &sparam)
{
//---
}
//+------------------------------------------------------------------+
Biuld my terminal:
Terminal MetaTrader 5 x64 build 1596 started (MetaQuotes Software Corp.)
Terminal Windows 10 Pro (x64 based PC), IE 11.00, UAC, Intel Core i3-3120M @ 2.50GHz, RAM: 4257 / 8077 Mb, HDD: 333671 / 475588 Mb, GMT+02:00
Terminal C:\Users\barab\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075
Everything works fine and not a single error.