AJUDA: MÉDIA MÓVEL x AFIRMA

 

estou tentando fazer um cruzamento entre média móvel e o indicador AFIRMA, mas nao roda no backtest pois aparece erro nessa linha: int Afirmahandle =iCustom(0,0,2,21,Blackman,0); dizendo algo sobre o  "indicador 2" (referente ao número 2 da sequencia anterior).


se alguém souber, poderia me ajudar?








//+------------------------------------------------------------------+

//|                                                         new1.mq5 |
//|                                  Copyright 2021, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+

#include<trade/Symbolinfo.mqh>

#include <Trade/Trade.mqh>   //biblioteca padrão ctrade







//| Declaration of enumerations                  |
//+----------------------------------------------+
enum ENUM_WINDOWS   // Type of constant
  {
   Rectangular = 1, // Rectangular window
   Hanning1,        // Hanning window 1
   Hanning2,        // Hanning window 2
   Blackman,        // Blackman window
   Blackman_Harris  // Blackman-Harris window
  };
  
  
 
 
string BoolToString(bool b)
{
   if (b) return("true");
   else return("false");
}

// * Média móvel
input ENUM_TIMEFRAMES      period=PERIOD_CURRENT;        // timeframe
input int                  ma_period=10;                 // Média móvel
input int                  ma_shift=0;                   // deslocamento
input ENUM_MA_METHOD       ma_method=MODE_SMA;           // tipo de média
input ENUM_APPLIED_PRICE   applied_price=PRICE_CLOSE;    // aplicar a
//Afirma                                                    
input double                  Period = 2;                // LF transmission width 1/(2*Periods)
input int                  Taps    = 21;                 // Number of delay units in the filter
input   ENUM_WINDOWS       Window=Blackman;              // Window index
input int                  Shift=0;                      // Horizontal shift of the indicator in bars
                                                      
// Entrada                                               // Tipo de Operação
extern bool  OPERARSell=false;                           // Operar vendido
extern bool  OPERARBuy=false;                            // Operar comprado
extern bool  OPERARSelleBuy=true;                        // Operar comprado e vendido
input double                  lote=0.01;                 // Quantidade de Contratos
input int                  stoploss=150;                 // Stop loss
input int                  takeprofit=300;               // Takeprofit
input int                  EA_magic=12345;               // EA magic number
                                                          



//+------------------------------------------------------------------+
//--- manipuladores dos indicadores de média móvel
int mediamovelHandle = INVALID_HANDLE;
int AfirmaHandle = INVALID_HANDLE;


//* vetores de dados dos indicadores
double Afirma[];
double mediamovel[];









CTrade trade;

int OnInit()
  {
//---
int ind_c=iCustom (_Symbol,_Period,"afirma",2,21,Blackman,0);

ChartIndicatorAdd(0,0,ind_c);




ArraySetAsSeries(Afirma,true);
ArraySetAsSeries(mediamovel,true);


int Afirmahandle =iCustom(0,0,2,21,Blackman,0);
int mediamovelhandle =iMA(0,0,7,2,MODE_EMA,PRICE_CLOSE);


   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {

      if(isNewBar())
     {
      // execute a lógica operacional do robô
      
      //+------------------------------------------------------------------+
      //| OBTENÇÃO DOS DADOS                                               |
      //+------------------------------------------------------------------+
      int copied1 = CopyBuffer(mediamovelHandle,0,0,3,mediamovel);
      int copied2 = CopyBuffer(AfirmaHandle,0,0,3,Afirma);
      //---
      bool sinalCompra = false;
      bool sinalVenda = false;
      //--- se os dados tiverem sido copiados corretamente
      if(copied1==3 && copied2==3)
        {
         //--- sinal de compra
         if( Afirma[1]>mediamovel[1] && Afirma[2]<mediamovel[2] )
           {
            sinalCompra = true;
           }
         //--- sinal de venda
         if( Afirma[1]<mediamovel[1] && Afirma[2]>mediamovel[2] )
           {
            sinalVenda = true;
           }
   
  }
  
  //+------------------------------------------------------------------+
      //| VERIFICAR SE ESTOU POSICIONADO                                   |
      //+------------------------------------------------------------------+
      bool comprado = false;
      bool vendido = false;
      if(PositionSelect(_Symbol))
        {
         //--- se a posição for comprada
         if( PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY )
           {
            comprado = true;
           }
         //--- se a posição for vendida
         if( PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_SELL )
           {
            vendido = true;
           }
        }
      
  
  
  //+------------------------------------------------------------------+
      //| LÓGICA DE ROTEAMENTO                                             |
      //+------------------------------------------------------------------+
      //--- ZERADO
      if( !comprado && !vendido )
        {
         //--- sinal de compra
         if( sinalCompra )
           {
            trade.Buy(lote,_Symbol,0,0,0,"Compra a mercado");
           }
         //--- sinal de venda
         if( sinalVenda )
           {
            trade.Sell(lote,_Symbol,0,0,0,"Venda a mercado");
           }
        }
      else
        {
         //--- estou comprado
         if( comprado )
           {
            if( sinalVenda )
              {
               trade.Sell(lote*2,_Symbol,0,0,0,"Virada de mão (compra->venda)");
              }
           }
         //--- estou vendido
         else if( vendido )
           {
            if( sinalCompra )
              {
               trade.Buy(lote*2,_Symbol,0,0,0,"Virada de mão (venda->compra)");
              }
           }
        }
      
      
     }
  }
//+------------------------------------------------------------------+

bool isNewBar()
  {
//--- memorize the time of opening of the last bar in the static variable
   static datetime last_time=0;
//--- current time
   datetime lastbar_time=(datetime)SeriesInfoInteger(Symbol(),Period(),SERIES_LASTBAR_DATE);

//--- if it is the first call of the function
   if(last_time==0)
     {
      //--- set the time and exit
      last_time=lastbar_time;
      return(false);
     }

//--- if the time differs
   if(last_time!=lastbar_time)
     {
      //--- memorize the time and return true
      last_time=lastbar_time;
      return(true);
    }
//--- if we passed to this line, then the bar is not new; return false
   return(false);
}
Descubra novos recursos para o MetaTrader 5 com a comunidade e os serviços MQL5
Descubra novos recursos para o MetaTrader 5 com a comunidade e os serviços MQL5
  • 2021.05.03
  • www.mql5.com
MQL5: linguagem de estratégias de negociação inseridas no Terminal do Cliente MetaTrader 5. A linguagem permite escrever seus próprios sistemas automáticos de negócios, indicadores técnicos, scripts e bibliotecas de funções
 
ZIMÁ:

estou tentando fazer um cruzamento entre média móvel e o indicador AFIRMA, mas nao roda no backtest pois aparece erro nessa linha: int Afirmahandle =iCustom(0,0,2,21,Blackman,0); dizendo algo sobre o  "indicador 2" (referente ao número 2 da sequencia anterior).


se alguém souber, poderia me ajudar?


Bom dia!


O autor já publicou também um EA baseado no indicador AFIRMA.


Obs.: Ao postar código, utilize esse botão   (ou Alt+S) para facilitar a leitura / análise.

Exp_AFIRMA
Exp_AFIRMA
  • www.mql5.com
O Expert Advisor Exp_AFIRMA é baseado nos sinais do indicador AFIRMA - Autoregressive Finite Impulse Response Moving Average (Resposta Impulsional Finita Autoregressiva da Média Móvel).
 
Vinicius de Oliveira:


Bom dia!


O autor já publicou também um EA baseado no indicador AFIRMA.


Obs.: Ao postar código, utilize esse botão   (ou Alt+S) para facilitar a leitura / análise.

SIM, mas ele não compila, pois aparece muitos erros.

 
ZIMÁ:

SIM, mas ele não compila, pois aparece muitos erros.

Vou dar uma olhada ...

 

Aqui não deu erro de compilação. Acho que você não está salvando os arquivos nas pastas corretas:



 
Vinicius de Oliveira:

Aqui não deu erro de compilação. Acho que você não está salvando os arquivos nas pastas corretas:



Eu baixei esse outro arquivo e eu tinha errado e baixei um diferente, mas fiz o download correto e compilei, e apareceu 

o aviso na compilação:

return value of 'OrderCalcProfit' should be checked tradealgorithms.mqh 1170 10.


e no backtest nao funciona, pois aparece varios alertas e ele nao realizada nenhuma ordem de compra ou venda; o gráfico corre normalmente, mas não realiza operações.


 
ZIMÁ:

Eu baixei esse outro arquivo e eu tinha errado e baixei um diferente, mas fiz o download correto e compilei, e apareceu 

o aviso na compilação:

return value of 'OrderCalcProfit' should be checked tradealgorithms.mqh 1170 10.


e no backtest nao funciona, pois aparece varios alertas e ele nao realizada nenhuma ordem de compra ou venda; o gráfico corre normalmente, mas não realiza operações.


Esses avisos não impedem a execução do EA.


Faça o seguinte:

- Crie uma pasta \MQL5\Indicators\Testes e salve o indicador nessa pasta;

- No código do EA, onde tem:

InpInd_Handle=iCustom(Symbol(),InpInd_Timeframe,"AFIRMA",Periods,Taps,Window,0);

... Atere para:

InpInd_Handle=iCustom(Symbol(),InpInd_Timeframe,"Testes\\AFIRMA",Periods,Taps,Window,0);
 

Salvar o indicador AFIRMA na pasta Terminal\[...]\MQL5\Indicators\Testes.


[CÓDIGO ORIGINAL AQUI ...]


//+------------------------------------------------------------------+
//|                                                     MA Cross.mq5 |
//|                                  Copyright 2021, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
//---
#include <Trade\PositionInfo.mqh>
#include <Trade\Trade.mqh>
#include <Trade\SymbolInfo.mqh>  
//---
CPositionInfo  m_position;                   // trade position object
CTrade         m_trade;                      // trading object
CSymbolInfo    m_symbol;                     // symbol info object
//+----------------------------------------------+
//| declaration of enumerations                  |
//+----------------------------------------------+
enum ENUM_WINDOWS //Type of constant
  {
   Rectangular = 1, //Rectangular window
   Hanning1,        //Hanning window 1
   Hanning2,        //Hanning window 2
   Blackman,        //Blackman window
   Blackman_Harris  //Blackman-Harris window
  };
//+----------------------------------------------+
//| AFIRMA indicator input parameters            |
//+----------------------------------------------+
input int                Periods     = 4;              // 1/(2*Periods) filter bandwidth
input int                Taps        = 21;             // Taps (odd number)
input ENUM_WINDOWS       Window      = Blackman;       // Window index
input uint               SignalBar   = 1;              // Bar number for getting an entry signal
//--- slow ma
input int                MA_2_Period = 13;             // Averaging period of the 2nd MA
input ENUM_MA_METHOD     MA_2_Method = MODE_LWMA;      // Method for calculating MA2
input ENUM_APPLIED_PRICE MA_2_Price  = PRICE_MEDIAN;   // Method for calculating the price MA2
input int                MA_2_Shift  = 0;              // Indicator shift MA2 
//--- volume
input double             Lot         = 0.1;            // Fixed lot
//---
int                  New_Bar;                          // 0/1 Факт образования нового бара
datetime             Time_0;                           // Время начала нового бара
int                  PosOpen;                          // Направление пересечения
int                  PosClose;                         // Направление пересечения
int                  all_positions;                    // Количество открытых позиций
double               MA1_0;                            // Текущее значение 1-й МА
double               MA1_1;                            // Предыдущее значение 1-й МА
double               MA2_0;                            // Текущее значение 2-й МА
double               MA2_1;                            // Предыдущее значение 2-й МА
int                  PosBuy;                           // 1 = факт наличия позиции Buy
int                  PosSell;                          // 1 = факт наличия позиции Sell
//---
int    handle_iMA_1;                   // variable for storing the handle of the AFIRMA indicator
int    handle_iMA_2;                   // variable for storing the handle of the iMA indicator
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   m_symbol.Name(Symbol());                  // sets symbol name
//--- create handle of the indicator AFIRMA
   handle_iMA_1=iCustom(m_symbol.Name(),Period(),"Testes\\AFIRMA",Periods,Taps,Window,0);
//--- if the handle is not created
   if(handle_iMA_1==INVALID_HANDLE)
     {
      //--- tell about the failure and output the error code
      PrintFormat("Failed to create handle of the AFIRMA indicator for the symbol %s/%s, error code %d",
                  m_symbol.Name(),
                  EnumToString(Period()),
                  GetLastError());
      //--- the indicator is stopped early
      return(INIT_FAILED);
     }
//--- create handle of the indicator iMA
   handle_iMA_2=iMA(m_symbol.Name(),Period(),MA_2_Period,MA_2_Shift,MA_2_Method,MA_2_Price);
//--- if the handle is not created
   if(handle_iMA_2==INVALID_HANDLE)
     {
      //--- tell about the failure and output the error code
      PrintFormat("Failed to create handle of the iMA indicator for the symbol %s/%s, error code %d",
                  m_symbol.Name(),
                  EnumToString(Period()),
                  GetLastError());
      //--- the indicator is stopped early
      return(INIT_FAILED);
     }
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   if(!RefreshRates())
      return;

   PosBuy=0;
   PosSell=0;
   int openOrders=0;
   all_positions=PositionsTotal();                                  // Общее количество позиций
   for(int i=all_positions-1;i>=0;i--) // returns the number of open positions
     {
      if(m_position.SelectByIndex(i)) // Выбираем позицию
        {
         if(m_position.PositionType()==POSITION_TYPE_BUY)// Если позиция BUY
           {
            PosBuy=1;
            if(CrossPositionClose()==1) // Закрывем ордер, если удовлетворяет условию CrossPositionClose()=1
              {
               m_trade.PositionClose(m_position.Ticket());
              }
           }
         if(m_position.PositionType()==POSITION_TYPE_SELL) // Если позиция SELL
           {
            PosSell=1;
            if(CrossPositionClose()==2) // Закрывем ордер, если удовлетворяет условию CrossPositionClose()=2
              {
               m_trade.PositionClose(m_position.Ticket());
              }
           }
        }
     }

   New_Bar=0;                          // Для начала обнулимся
   if(Time_0!=iTime(m_symbol.Name(),Period(),0)) // Если уже другое время начала бара
     {
      New_Bar=1;                      // А вот и новый бар
      Time_0=iTime(m_symbol.Name(),Period(),0);               // Запомним время начала нового бара
     }

   MA1_0=iMAGet(handle_iMA_1, 1, SignalBar);       // Current value of 1st MA
   MA1_1=iMAGet(handle_iMA_1, 1, SignalBar + 1);   // Previous value of 1st MA
   MA2_0=iMAGet(handle_iMA_2, 0, 0);               // Current value of 2nd MA
   MA2_1=iMAGet(handle_iMA_2, 0, 1);               // Previous value of 2nd MA

   if(CrossPositionOpen()==1 && New_Bar==1) // Движение снизу вверх = откр. Buy
     {
      OpenBuy();
     }
   if(CrossPositionOpen()==2 && New_Bar==1) // Движение сверху вниз = откр. Sell
     {
      OpenSell();
     }
   return;
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CrossPositionOpen()
  {
   PosOpen=0;                                                 // Вот где собака зарыта!!:)
   if((MA1_1<=MA2_0 && MA1_0>MA2_0) || (MA1_1<MA2_0 && MA1_0>=MA2_0)) // Пересечение снизу вверх  
     {
      PosOpen=1;
     }
   if((MA1_1>=MA2_0 && MA1_0<MA2_0) || (MA1_1>MA2_0 && MA1_0<=MA2_0)) // Пересечение сверху вниз
     {
      PosOpen=2;
     }
   return(PosOpen);                                          // Возвращаем направление пересечен.
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int CrossPositionClose()
  {
   PosClose=0;                                                // Вот где собака зарыта!!:)
   if((MA1_1>=MA2_0 && MA1_0<MA2_0) || (MA1_1>MA2_0 && MA1_0<=MA2_0)) // Пересечение сверху вниз
     {
      PosClose=1;
     }
   if((MA1_1<=MA2_0 && MA1_0>MA2_0) || (MA1_1<MA2_0 && MA1_0>=MA2_0)) // Пересечение снизу вверх
     {
      PosClose=2;
     }
   return(PosClose);                                          // Возвращаем направление пересечен.
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OpenBuy()
  {
   if(all_positions==1)
     {
      for(int i=PositionsTotal()-1;i>=0;i--) // returns the number of open positions
         if(m_position.SelectByIndex(i))
            if(m_position.PositionType()==POSITION_TYPE_BUY)
               return;                          // Если buy, то не открываемся
     }
   if(!RefreshRates())
      return;

   m_trade.Buy(Lot,m_symbol.Name(),m_symbol.Ask(),0.0,0.0,"Buy: MA_cross_Method_PriceMode");// Открываемся
   return;
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OpenSell()
  {
   if(all_positions==1)
     {
      for(int i=PositionsTotal()-1;i>=0;i--) // returns the number of open positions
         if(m_position.SelectByIndex(i))
            if(m_position.PositionType()==POSITION_TYPE_SELL)
               return;                             // Если sell, то не открываемся
     }
   m_trade.Sell(Lot,m_symbol.Name(),m_symbol.Bid(),0.0,0.0,"Sell: MA_cross_Method_PriceMode");
   return;
  }
//+------------------------------------------------------------------+
//| Refreshes the symbol quotes data                                 |
//+------------------------------------------------------------------+
bool RefreshRates()
  {
//--- refresh rates
   if(!m_symbol.RefreshRates())
      return(false);
//--- protection against the return value of "zero"
   if(m_symbol.Ask()==0 || m_symbol.Bid()==0)
      return(false);
//---
   return(true);
  }
//+------------------------------------------------------------------+
//| Get value of buffers for the iMA                                 |
//+------------------------------------------------------------------+
double iMAGet(const int handle,const int buffer_num, const int index)
  {
   double MA[];
   ArraySetAsSeries(MA,true);
//--- reset error code
   ResetLastError();
//--- fill a part of the iMABuffer array with values from the indicator buffer that has 0 index
   if(CopyBuffer(handle,buffer_num,0,index+1,MA)<0)
     {
      //--- if the copying fails, tell the error code
      PrintFormat("Failed to copy data from the indicator, error code %d",GetLastError());
      //--- quit with zero result - it means that the indicator is considered as not calculated
      return(0.0);
     }
   return(MA[index]);
  }
//+------------------------------------------------------------------+
MA Cross
MA Cross
  • www.mql5.com
The Expert Advisor based on intersection of two iMA.
 
Vinicius de Oliveira:

Salvar o indicador AFIRMA na pasta Terminal\[...]\MQL5\Indicators\Testes.


[CÓDIGO ORIGINAL AQUI ...]


eu consegui com um esboço de um cruzamento de 2 media, adicionando o icustom fazer ser compilado; porém o backtest não executou nenhuma ordem, ao fim aparecia na tela :

ERRO 4801:Ativo desconhecido.

Com esse seu código, também compilou e o backtest também não executou nenhuma ordem e apareceu ao final:

ERRO 4802: Indicador não pode ser criado.

Ou seja, o problema está no indicador Afirma que não é executado junto com todo o código, como se ele não estive sido introduzido ao que queremos...


PS: Obrigado pela dedicação e atenção...

 
ZIMÁ:

eu consegui com um esboço de um cruzamento de 2 media, adicionando o icustom fazer ser compilado; porém o backtest não executou nenhuma ordem, ao fim aparecia na tela :

ERRO 4801:Ativo desconhecido.

Com esse seu código, também compilou e o backtest também não executou nenhuma ordem e apareceu ao final:

ERRO 4802: Indicador não pode ser criado.

Ou seja, o problema está no indicador Afirma que não é executado junto com todo o código, como se ele não estive sido introduzido ao que queremos...


PS: Obrigado pela dedicação e atenção...

De nada.


Quando eu salvo o indicador AFIRMA diretamente na pasta MQL5\Indicators, realmente ocorre esse erro. Mas eu criei essa pasta MQL5\Indicators\Testes, salvei o indicador nela e alterei o path na criação do handle e funcionou.


Não sei qual a lógica de funcionar numa pasta e noutra não, mas o fato é que aqui tá funcionando. 😃


Você tentou essa alteração como eu sugeri?


PS.: Testei no EURUSD H1 com os parâmetros default. Se você seguir essas sugestões e ainda assim não abrir nenhuma posição, dê uma olhada na guia Diário pra ver os logs de erros e retorne.

 
Vinicius de Oliveira:

De nada.


Quando eu salvo o indicador AFIRMA diretamente na pasta MQL5\Indicators, realmente ocorre esse erro. Mas eu criei essa pasta MQL5\Indicators\Testes, salvei o indicador nela e alterei o path na criação do handle e funcionou.


Não sei qual a lógica de funcionar numa pasta e noutra não, mas o fato é que aqui tá funcionando. 😃


Você tentou essa alteração como eu sugeri?


PS.: Testei no EURUSD H1 com os parâmetros default. Se você seguir essas sugestões e ainda assim não abrir nenhuma posição, dê uma olhada na guia Diário pra ver os logs de erros e retorne.

Olhe o caminho declarado no codigo....

 handle_iMA_1=iCustom(m_symbol.Name(),Period(),"Testes\\AFIRMA",Periods,Taps,Window,0);

A documentação diz o seguinte:

name

[in]  O nome do indicador personalizado, com o caminho relativo ao diretório raiz de indicadores (MQL5\Indicators\). Se um indicador está localizado em um subdiretório, por exemplo, em MQL5/Indicadores/Exemplos, o seu nome deve ser especificado como: "Examples\\nome_do_indicador" (é necessário utilizar uma barra dupla, em vez de uma única barra como um separador).

Na atualização 2845 temos uma abordagem melhorada. 


This version features a revised custom indicator loading algorithm via iCustom.

If the backslash '\' is indicated before the custom indicator name, the EX5 indicator file is searched relative to the MQL5 root folder. So, for a call of iCustom(Symbol(), Period(), "\FirstIndicator"...), the indicator will be loaded as MQL5\FirstIndicator.ex5. If the file is not found at this path, error 4802 (ERR_INDICATOR_CANNOT_CREATE) is returned.

If the path does not start with a backslash '\', the indicator is searched and loaded based on the following sequence of actions:

  • The EX5 file is searched in the same folder, where the caller program's EX5 is located. For example, the CrossMA.EX5 Expert Advisor is located at MQL5\Experts\MyExperts. It contains the following call: iCustom(Symbol(), Period(), "SecondIndicator"...). In this case, the indicator is searched at MQL5\Experts\MyExperts\SecondIndicator.ex5.
  • If the indicator is not found, a search relative to the Indicators root directory is performed: MQL5\Indicators. Thus, file MQL5\Indicators\SecondIndicator.ex5 is searched. If the indicator is not found, the function returns INVALID_HANDLE and error 4802 (ERR_INDICATOR_CANNOT_CREATE) is raised.
If the indicator path is set in a subdirectory such as MyIndicators\ThirdIndicator, the search starts in the folder of the calling program (the Expert Advisor is located in the folder MQL5\Experts\MyExperts) at the following path: MQL5\Experts\MyExperts\MyIndicators\ThirdIndicator.ex5. In case of failure, file MQL5\Indicators\MyIndicators\ThirdIndicator.ex5 is searched. Please note that the path separator should be specified as a double backslash '\\'. For example: iCustom(Symbol(), Period(), "MyIndicators\\ThirdIndicator"...)

Also, if a custom indicator call via iCustom is found in the program code, the compiler will implicitly add the "#property tester_indicator XXX" directive if it is not specified.
MetaTrader 5 build 2485: iCustom improvements and overall optimization in MQL5
MetaTrader 5 build 2485: iCustom improvements and overall optimization in MQL5
  • 2020.06.05
  • MetaQuotes
  • www.metaquotes.net
Optimized and significantly accelerated bar history editing for custom financial instruments. The improvement also concerns the CustomRatesUpdate function. Fixed exporting of custom symbol settings to a JSON file. Fixed errors reported in crash logs. This version features a revised custom indicator loading algorithm via iCustom. If the...
Razão: