Tudo sobre Programação, com código fonte exemplo - página 9

 

Fórum de negociação, sistemas de negociação automatizados e testes de estratégias de negociação

Usar Bid, High e Low

Henrique Araújo, 2019.07.04 02:18

Eu estou iniciando meus estudos em Mql5, estou programando um EA que imprime uma mensagem na tela se houver o rompimento de minima ou maxima da vela anterior, porem no video o rapaz utiliza Mql4, e pra acessar o preço ele apenas digita Bid, e usa High e Low sem ter declarado antes, eu declarei bid pra pegar o Preço Bid e acredito ter resolvido isso, mas High e Low, ainda não resolvi.


//VARIAVEIS
double bid = SymbolInfoDouble(_Symbol,SYMBOL_BID);
double max_ant;
double min_ant;


void OnTick(){
max_ant = High[1];
min_ant = Low[1];

  if (bid > max_ant){
  Comment("ROMPIMENTO DE MAXIMA ANTERIOR");
  }
  
  if (bid < min_ant){
  Comment("ROMPIMENTO DE MINIMA ANTERIOR");
  }
   
  }
	

EDIT

O codigo está rodando, porém aparentemente não está funcionando, ele imprime ROMPIMENTO DE MÁXIMA ANTERIOR e não imprime a minima.


//VARIAVEIS
double bid = SymbolInfoDouble(_Symbol,SYMBOL_BID);
double max_ant;
double min_ant;


void OnTick(){
max_ant = iHigh(_Symbol,_Period,1);
min_ant = iLow(_Symbol,_Period,1);

  if (bid > max_ant){
  Comment("ROMPIMENTO DE MAXIMA ANTERIOR");
  }
  
  if (bid < min_ant){
  Comment("ROMPIMENTO DE MINIMA ANTERIOR");
  }
   
  }


 

Fórum de negociação, sistemas de negociação automatizados e testes de estratégias de negociação

[INVALID STOPS] Ordens não abrem

Rogerio Figurelli, 2019.07.11 02:09

Olá  Henrique Araújo, seu problema é muito simples: você está confundindo valor absoluto (preço) e relativo (pontos, pips, etc.) de S/L.

Como na função a ser passada você deve passar um preço para S/L, deve antes converter seu S/L em pontos (int) para um preço (double), como o exemplo abaixo (em metalinguagem):

S/L (preço) = Ask - S/L (pontos) * Point();

Sds.,

Rogério Figurelli

 


 
PauloVasques:

Oi, não seria o caso de você somente criar uma média móvel com 4 ou 5 períodos?


Na verdade não tinha pensado nisso, obrigado vou tentar!

 

Fórum de negociação, sistemas de negociação automatizados e testes de estratégias de negociação

Leitura da posição atual para impedir novas entradas

Trader_Patinhas, 2019.07.17 03:15

É que você inseriu o comando  trade.SetExpertMagicNumber(magicNum) no OnDeinit().

Com isso as suas posições não estão com o Magic Number que vc usa pra comparar.

A solução é inserir   trade.SetExpertMagicNumber(magicNum) no OnInit() e não no OnDeinit().

Aliás, também há outros comandos no OnDeinit(), como o SetTypeFilling e o SetDeviationPoints, que também deveriam estar no OnInit().


 

Fórum de negociação, sistemas de negociação automatizados e testes de estratégias de negociação

Verificação de posição mini índice

Arthur Albano, 2019.07.14 01:54

Em contas netting há somente uma posição para cada ativo. Talvez você queira dizer ordens abertas.

int SymbolOrdersTotal(const string &SYMBOL)
{
        int result = 0;
        for(int i=0;i<OrdersTotal();i++)
        {
                if(
                        OrderSelect(OrderGetTicket(i)) &&
                        (OrderGetString(ORDER_SYMBOL)==SYMBOL)
                ) result = result + 1;
        };
        return(result);
};

 

Fórum de negociação, sistemas de negociação automatizados e testes de estratégias de negociação

Como pegar a data que a EA está rodando.

LeandroCD, 2019.07.17 02:30

Galera,


Estou rodando uma EA na conta demo para um determinado período, com a intenção de validar uma estratégia de bandas de bolinger.

O problema eh que as bandas variam no dia a dia e eu fiz um código usando switch para variar as bandas inferiores e superiores de acordo com o dia, porém eu não consigo retornar a data que a EA está rodando.

Estou usando o TimeCurrent(), mas está retornando somente a data atual. Como faço para pegar a data que a EA está naquele momento dentro do período que eu selecionei?

Por exemplo: 02/01/2019, 03/01/2019 e assim sucessivamente até o fim do período que eu selecionei.


Segue o trecho do código que eu estou usando e não está funcionando.


void ParametrizaBandas()
{
   MqlDateTime DataAtual;
   datetime TesteData= ;
   TimeCurrent(DataAtual);
   TimeToStruct(TesteData, DataAtual);
         
   switch (DataAtual.day_of_year + 1)
   {   
      case 193:  dBandaSuperior = 1.053; dBandaInferior = 1.009; break; // 12/07/2019
      case 192:  dBandaSuperior = 1.054; dBandaInferior = 1.010; break;
      case 191:  dBandaSuperior = 1.057; dBandaInferior = 1.008; break;
      default: dBandaSuperior = 0; dBandaInferior = 0; dMedia = 0; break;
   }
}

 
Bom dia ou boa tarde, alguem tem um script EA que indica topos e fundos e seja avaliado as velas 0, 1 e 2, tanto para compra e venda, Grato
 
Cara to com um problema no meu Ea de mt4 pois to teste dele ele funciona notmalmente porem quando testo na conta demos ele nao abre ordens automaticament
// Initialization variables
double            MinLot,
MaxLot,
LotStep,
StopLevel,
TickValue,
Spread;
int               DigitLot,
DigitFactor;
// Display
string            lbl               = "GridEA";
int               XValue            = 20,
YValue            = 20,
XSize             = 80,
YSize             = 20;
string            Font              = "Tahoma";          // Font
int               FontSize          = 8;                 // Font size
ENUM_ALIGN_MODE   TextAlign         = ALIGN_CENTER;      // Text align
ENUM_BASE_CORNER  ChartCorner       = CORNER_LEFT_UPPER; // Chart corner for anchoring
color             RectangleColor    = clrRed;            // Rectangle color
color             TextColor         = clrGold;           // Text color
color             BackColor         = clrBlack;          // Background color
color             ButtonColor       = clrBlue;           // Background color
color             BorderColor       = clrBlack;          // Border color                  

input int         TakeProfit        = 100;
input double      Lot               = 0.1;
input double      LotExponential    = 2;
input int         MaxTrades         = 20;
input int         Slippage          = 10;
int               MagicNumber       = 1368;

double            BuyPrice,
SellPrice;
int               SumBuy,
SumSell;
double            NextBuy,
NextSell,
NextBuyLot,
NextSellLot;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   MinLot            = MarketInfo(Symbol(),MODE_MINLOT);
   MaxLot            = MarketInfo(Symbol(),MODE_MAXLOT);
   LotStep           = MarketInfo(Symbol(),MODE_LOTSTEP);
   DigitLot          = (int) MathLog10(MinLot)*-1;
   StopLevel         = MarketInfo(Symbol(),MODE_STOPLEVEL);
   TickValue         = MarketInfo(Symbol(),MODE_TICKVALUE);

   if(Digits==3 || Digits==5) DigitFactor=10;
   else DigitFactor=1;
   CreateDisplay();
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   RemoveObjects();
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   if(IsTesting())
      if(OrdersTotal()==0)
        {
         BuyPrice=OpenMarketOrder(Lot,OP_BUY,"0Buy");
         SellPrice=OpenMarketOrder(Lot,OP_SELL,"0Buy");
         NextBuy=BuyPrice;
         NextSell=SellPrice;
         SumBuy=0;
         SumSell=0;
         NextBuyLot=Lot*LotExponential;
         NextSellLot=Lot*LotExponential;
        }

   if(TotalOrder()>0)
      CheckTP();

   if(TotalOrder()>0 && TotalOrder()<MaxTrades)
      AddTrade();
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
   if(id==CHARTEVENT_OBJECT_CLICK)
     {
      if(sparam==lbl+"Trade")
        {
         BuyPrice=OpenMarketOrder(Lot,OP_BUY,"0Buy");
         SellPrice=OpenMarketOrder(Lot,OP_SELL,"0Buy");
         NextBuy=BuyPrice;
         NextSell=SellPrice;
         SumBuy=0;
         SumSell=0;
         NextBuyLot=Lot*LotExponential;
         NextSellLot=Lot*LotExponential;
         ObjectSetInteger(0,sparam,OBJPROP_STATE,false);
        }
     }
  }
//+------------------------------------------------------------------+
//| Check Total Order Function                                       |
//+------------------------------------------------------------------+
int TotalOrder()
  {
   int Result=0;
   for(int cnt=OrdersTotal()-1; cnt>=0; cnt--)
      if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))
         if(OrderSymbol()==Symbol() && 
            OrderMagicNumber()==MagicNumber)
            Result++;
   return(Result);
  }
//+------------------------------------------------------------------+
//| Check Total Order Function                                       |
//+------------------------------------------------------------------+
int TotalOrderType(int Sum,string Type)
  {
   int Result=0;
   for(int cnt=OrdersTotal()-1; cnt>=0; cnt--)
      if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))
         if(OrderSymbol()==Symbol() && 
            OrderMagicNumber()==MagicNumber)
            if(NumberComment(OrderComment(),Type)==Sum)
               Result++;
   return(Result);
  }
//+------------------------------------------------------------------+
//| Check Type Function                                              |
//+------------------------------------------------------------------+
int CheckType()
  {
   int Result=-1;
   for(int cnt=OrdersTotal()-1; cnt>=0; cnt--)
      if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))
         if(OrderSymbol()==Symbol() && 
            OrderMagicNumber()==MagicNumber)
            Result=OrderType();
   return(Result);
  }
//+------------------------------------------------------------------+
//| Add Trade Function                                               |
//+------------------------------------------------------------------+
void AddTrade()
  {
   int Sum=0;
   string Type="";
   if(SumBuy==0 && SumSell==0)
     {
      Sum=0;
      Type="Buy";

      if(TotalOrderType(Sum,Type)==1)
        {
         if(CheckType()==1)
           {
            SumBuy++;
            BuyPrice=OpenMarketOrder(NextBuyLot,OP_BUY,IntegerToString(SumBuy)+"Buy");
            SellPrice=OpenMarketOrder(NextBuyLot,OP_SELL,IntegerToString(SumBuy)+"Buy");
            NextBuyLot=NextBuyLot*LotExponential;
           }
         if(CheckType()==0)
           {
            SumSell++;
            BuyPrice=OpenMarketOrder(NextSellLot,OP_BUY,IntegerToString(SumSell)+"Sell");
            SellPrice=OpenMarketOrder(NextSellLot,OP_SELL,IntegerToString(SumSell)+"Sell");
            NextSellLot=NextSellLot*LotExponential;
           }
        }
     }
   if(SumBuy>0 || SumSell>0)
     {
      if(SumBuy>SumSell)
        {
         Sum=SumBuy;
         Type="Buy";
        }
      else
        {
         Sum=SumSell;
         Type="Sell";
        }

      if(TotalOrderType(Sum,Type)==1)
        {
         if(Type=="Buy")
           {
            SumBuy++;
            BuyPrice=OpenMarketOrder(NextBuyLot,OP_BUY,IntegerToString(SumBuy)+"Buy");
            SellPrice=OpenMarketOrder(NextBuyLot,OP_SELL,IntegerToString(SumBuy)+"Buy");
            NextBuyLot=NextBuyLot*LotExponential;
           }
         if(Type=="Sell")
           {
            SumSell++;
            BuyPrice=OpenMarketOrder(NextSellLot,OP_BUY,IntegerToString(SumSell)+"Sell");
            SellPrice=OpenMarketOrder(NextSellLot,OP_SELL,IntegerToString(SumSell)+"Sell");
            NextSellLot=NextSellLot*LotExponential;
           }
        }
     }
  }
//+------------------------------------------------------------------+
//| Check TP Function                                                |
//+------------------------------------------------------------------+
void CheckTP()
  {
   int OpenBuy=1;
   int OpenSell= 1;
   int TypeBuy = -1;
   int TypeSell = -1;
   for( int cnt = OrdersTotal()-1; cnt >= 0; cnt-- )
      if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))
         if(OrderSymbol()==Symbol() && 
            OrderMagicNumber()==MagicNumber)
           {
            if(OrderType()<=1 && SumBuy>0)
              {
               if(StringFind(OrderComment(),"Buy",0)>=0 && NumberComment(OrderComment(),"Buy")==SumBuy)
                 {
                  TypeBuy=OrderType();
                  OpenBuy++;
                 }
              }
            if(OrderType()<=1 && SumSell>0)
              {
               if(StringFind(OrderComment(),"Sell",0)>=0 && NumberComment(OrderComment(),"Sell")==SumSell)
                 {
                  TypeSell=OrderType();
                  OpenSell++;
                 }
              }
           }
   }
//+------------------------------------------------------------------+
//| Create Display Function                                          |
//+------------------------------------------------------------------+
void CreateDisplay()
  {
   RectLabelCreate(lbl+"Rect",XValue-3,YValue-3,XSize*1+6,YSize*3+6);
   EditCreate(lbl+"Header",XValue,YValue,XSize,YSize,"Grid EA");
   ButtonCreate(lbl+"Trade",XValue,YValue+YSize,XSize,YSize,"Trade");
   ButtonCreate(lbl+"CloseTrade",XValue,YValue+YSize*2,XSize,YSize,"Close All Trade");
  }
//+------------------------------------------------------------------+
//| Create Edit object                                               |
//+------------------------------------------------------------------+
void EditCreate(const string           name        = "Edit",            // object name
                const int              x           = 0,                 // X coordinate
                const int              y           = 0,                 // Y coordinate
                const int              xsize       = 0,                 // X size
                const int              ysize       = 0,                 // Y size
                const string           text        = "Text")            // text
  {
   ObjectCreate(0,name,OBJ_EDIT,0,0,0);
   ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x);
   ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y);
   ObjectSetInteger(0,name,OBJPROP_XSIZE,xsize);
   ObjectSetInteger(0,name,OBJPROP_YSIZE,ysize);
   ObjectSetString(0,name,OBJPROP_TEXT,text);
   ObjectSetString(0,name,OBJPROP_FONT,Font);
   ObjectSetInteger(0,name,OBJPROP_FONTSIZE,FontSize);
   ObjectSetInteger(0,name,OBJPROP_ALIGN,TextAlign);
   ObjectSetInteger(0,name,OBJPROP_READONLY,true);
   ObjectSetInteger(0,name,OBJPROP_CORNER,ChartCorner);
   ObjectSetInteger(0,name,OBJPROP_COLOR,TextColor);
   ObjectSetInteger(0,name,OBJPROP_BGCOLOR,BackColor);
   ObjectSetInteger(0,name,OBJPROP_BORDER_COLOR,BorderColor);
   ObjectSetInteger(0,name,OBJPROP_BACK,false);
   ObjectSetInteger(0,name,OBJPROP_SELECTABLE,false);
   ObjectSetInteger(0,name,OBJPROP_SELECTED,false);
   ObjectSetInteger(0,name,OBJPROP_HIDDEN,true);
   ObjectSetInteger(0,name,OBJPROP_ZORDER,0);
  }
//+------------------------------------------------------------------+
//| Create the button                                                |
//+------------------------------------------------------------------+
void ButtonCreate(const string   name        = "Button",    // button name
                  const int      x           = 0,           // X coordinate
                  const int      y           = 0,           // Y coordinate
                  const int      width       = 50,          // button width
                  const int      height      = 18,          // button height
                  const string   text        = "Button")    // text
  {
   ObjectCreate(0,name,OBJ_BUTTON,0,0,0);
   ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x);
   ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y);
   ObjectSetInteger(0,name,OBJPROP_XSIZE,width);
   ObjectSetInteger(0,name,OBJPROP_YSIZE,height);
   ObjectSetInteger(0,name,OBJPROP_CORNER,ChartCorner);
   ObjectSetString(0,name,OBJPROP_TEXT,text);
   ObjectSetString(0,name,OBJPROP_FONT,Font);
   ObjectSetInteger(0,name,OBJPROP_FONTSIZE,FontSize);
   ObjectSetInteger(0,name,OBJPROP_COLOR,TextColor);
   ObjectSetInteger(0,name,OBJPROP_BGCOLOR,ButtonColor);
   ObjectSetInteger(0,name,OBJPROP_BORDER_COLOR,BorderColor);
   ObjectSetInteger(0,name,OBJPROP_BACK,false);
   ObjectSetInteger(0,name,OBJPROP_STATE,false);
   ObjectSetInteger(0,name,OBJPROP_SELECTABLE,false);
   ObjectSetInteger(0,name,OBJPROP_SELECTED,false);
   ObjectSetInteger(0,name,OBJPROP_HIDDEN,false);
   ObjectSetInteger(0,name,OBJPROP_ZORDER,0);
  }
//+------------------------------------------------------------------+
//| Create rectangle label                                           |
//+------------------------------------------------------------------+
bool RectLabelCreate(const string           name="RectLabel",         // label name
                     const int              x=0,                      // X coordinate
                     const int              y=0,                      // Y coordinate
                     const int              width=50,                 // width
                     const int              height=18)                // height
  {
   ObjectCreate(0,name,OBJ_RECTANGLE_LABEL,0,0,0);
   ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x);
   ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y);
   ObjectSetInteger(0,name,OBJPROP_XSIZE,width);
   ObjectSetInteger(0,name,OBJPROP_YSIZE,height);
   ObjectSetInteger(0,name,OBJPROP_BGCOLOR,BackColor);
   ObjectSetInteger(0,name,OBJPROP_FILL,true);
   ObjectSetInteger(0,name,OBJPROP_BORDER_TYPE,BORDER_FLAT);
   ObjectSetInteger(0,name,OBJPROP_CORNER,ChartCorner);
   ObjectSetInteger(0,name,OBJPROP_COLOR,RectangleColor);
   ObjectSetInteger(0,name,OBJPROP_STYLE,STYLE_SOLID);
   ObjectSetInteger(0,name,OBJPROP_WIDTH,3);
   ObjectSetInteger(0,name,OBJPROP_BACK,false);
   ObjectSetInteger(0,name,OBJPROP_SELECTABLE,false);
   ObjectSetInteger(0,name,OBJPROP_SELECTED,false);
   ObjectSetInteger(0,name,OBJPROP_HIDDEN,true);
   ObjectSetInteger(0,name,OBJPROP_ZORDER,0);
   return(true);
  }
//+------------------------------------------------------------------+
//| Remove object function                                           |
//+------------------------------------------------------------------+  
void RemoveObjects()
  {
   for(int i=ObjectsTotal()-1; i>=0; i--)
      if(StringFind(ObjectName(i),lbl)!=-1) ObjectDelete(ObjectName(i));
  }
//+------------------------------------------------------------------+
//| Open Market Order Function                                       |
//+------------------------------------------------------------------+
double OpenMarketOrder(double LotSize,int TypeOrder,string Comm)
  {
   double   OrderPrice     = 0;
   double   SLPrice        = 0;
   double   TPPrice        = 0;
   int      ticket         = 0;
   while(IsTradeContextBusy()) Sleep(100);
   if(TypeOrder==OP_BUY)
     {
      OrderPrice     = Ask;
      TPPrice        = OrderPrice + TakeProfit*DigitFactor*Point;
     }
   if(TypeOrder==OP_SELL)
     {
      OrderPrice     = Bid;
      TPPrice        = OrderPrice - TakeProfit*DigitFactor*Point;
     }

   LotSize=NormalizeDouble(LotSize,DigitLot);
   OrderPrice=NormalizeDouble(OrderPrice,Digits);
   SLPrice = NormalizeDouble(SLPrice,Digits);
   TPPrice = NormalizeDouble(TPPrice,Digits);

   ticket = OrderSend(Symbol(),      // Symbol
                      TypeOrder,     // Operation type
                      LotSize,       // Lot size
                      OrderPrice,    // Latest price for buy
                      Slippage,      // Slippage
                      SLPrice,       // Stop loss
                      TPPrice,       // Take profit
                      Comm,          // Comment
                      MagicNumber,   // Magic number
                      0,             // Expiration
                      clrNONE);
   if(ticket>0)
      if(OrderSelect(ticket,SELECT_BY_TICKET))
         if(OrderTakeProfit()==0 && TakeProfit>0)
           {
            if(OrderModify(OrderTicket(),
               OrderOpenPrice(),
               SLPrice,          // Stop loss
               TPPrice,          // Take profit
               0,                // Expiration
               clrNONE)) ticket=ticket;
            OrderPrice=OrderTakeProfit();
           }
   if(ticket<0) OrderPrice=0;
   return(OrderPrice);
  }
//+------------------------------------------------------------------+
//| Number Comment function                                          |
//+------------------------------------------------------------------+   
int NumberComment(string Text,string BuySell)
  {
   int Pos=StringFind(Text,BuySell,0);
   string Match=StringSubstr(Text,0,Pos);
   int Result=(int)StringToInteger(Match);
   return(Result);
  }
//+------------------------------------------------------------------+
 

Fórum de negociação, sistemas de negociação automatizados e testes de estratégias de negociação

Como pegar a data que a EA está rodando.

Rogerio Figurelli, 2019.07.22 00:06

Olá  LeandroCD, acredito que você está confundindo um pouco vários conceitos.

Por exemplo, em relação às funções relacionados ao tempo, você está partindo do tempo real e forçando um código com uma série de valores hard coded que provavelmente irão exigir você recompilar o programa constantemente.

Outro exemplo é que quando refere a variar as bandas, provavelmente o que você está querendo dizer é variar os seus gatilhos para os valores do indicador, afinal, quem varia as bandas é o mercado, dentro evidentemente do seu setup atual para o indicador.

Outro ponto relevante é que, independentemente de seu código estar sendo testado em conta demonstração, por backtesting ou conta real, não vejo lógica de que ele seja diferente ou engessado a uma condição ou ambiente operacional específico.

Dito isso, e agora em relação ao seu objetivo, problema e ponto principal, note que, apesar de ser possível, pode ser bem complexo você trabalhar com funções a partir da data atual, como a TimeCurrent(), com a última data do servidor, ou TimeLocal(), com a última data local, para fazer o que está buscando, que é analisar valores do indicador no passado, em determinadas faixas de tempo.

Recomendo para isso estudares a função CopyTime() em https://www.mql5.com/pt/docs/series/copytime , que me parece a mais apropriada para você fazer essa análise baseada em dados passados, cruzando valores do indicador com o tempo preciso, com um código que irá funcionar em qualquer período ou ambiente de testes (backtesting, demo ou real).

Se desejares estudar melhor esses conceitos, não apenas para melhorar seu código, deixando ele mais parametrizável, mas também futuros desenvolvimentos, recomendo também o artigo abaixo, que analisa várias funções relacionadas à gestão do tempo no MQL.

FUNDAMENTOS BÁSICOS DA PROGRAMAÇÃO MQL5: TEMPO
https://www.mql5.com/pt/articles/599

Espero ter ajudado, mas qualquer dificuldade a mais é só avisar.

Sds.,
Rogério Figurelli

 

Fórum de negociação, sistemas de negociação automatizados e testes de estratégias de negociação

Indicadores não aparecem na tela após serem carregados..

Rodolpho Nogueira De Sousa, 2019.07.22 23:18

Olá Pessoal, estou com o seguinte problema:

No backtest carrega os indicadores na tela normalmente (conforme abaixo), porém ao inserir o EA no gráfico e após habilitar o LiveTrading, não aparecem. Nem mesmo, na lista de indicadores.

Não aparece nenhuma mensagem de erro de falha de carregamento dos mesmos e ainda assim o EA opera normalmente.

Estou carregando alguns indicadores customizados e outros da biblioteca MT5, conforme abaixo:



//Resources

#resource "\\Indicators\\ATRMA.ex5"
#resource "\\Indicators\\Phibo_PCPV.ex5"
.
.
.
.
int OnInit()
{

   ResetLastError();
   
   //Essenciais:
   smaHandle = iMA(_Symbol,MA1TF,MA1Period,MA1Shift,MA1Method,MA1Price);
   rsiHandle = iRSI(_Symbol,RSITF,RSIPeriod,RSIPrice);
   adxHandle = iADX(_Symbol,ADXTF,ADXPeriod);          
   PhiboHandle=iCustom(_Symbol,0,"::Indicators\\Phibo_PCPV.ex5",PhPeriodPC1PV1,PhPeriodPC2PV2,PhPeriodPC3PV3);
   ATRHandle = iCustom(_Symbol,ATRTF,"::Indicators\\ATRMA.ex5",ATRPeriod,EMAPeriod);
   
   if (PhiboHandle==INVALID_HANDLE || smaHandle==INVALID_HANDLE || rsiHandle==INVALID_HANDLE || adxHandle==INVALID_HANDLE || ATRHandle==INVALID_HANDLE)
   {
      Alert("Falha ao carregar o indicador, favor rever as configurações do mesmo.");
      ExpertRemove();
      return INIT_FAILED;
   }

Janela de BackTeste:

Carregam normalmente.


Já no live chart, mostra que carregaram, porém não estão aparecendo.


Algum palpite pessoal?


Razão: