//+------------------------------------------------------------------+
//| Expert initialization                                             |
//+------------------------------------------------------------------+
#property strict
input int MACD_FastEMA = 10; // Configuração ajustada conforme imagem
input int MACD_SlowEMA = 21;
input int MACD_SignalSMA = 1;
input double RenkoFilter = 21.0; // Tamanho do bloco Renko ajustado para 21 (conforme "MaPeriod")

// Handles for indicators
int handleEMA8;
int handleEMA21;
int handleMACD;
double EMA8[], EMA21[];
double MACD_Main[], MACD_Signal[];

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
   // Criação das EMAs
   handleEMA8 = iMA(NULL, PERIOD_H1, 8, 0, MODE_EMA, PRICE_CLOSE);
   handleEMA21 = iMA(NULL, PERIOD_H1, 21, 0, MODE_EMA, PRICE_CLOSE);

   // Criação do MACD
   handleMACD = iMACD(NULL, PERIOD_H1, MACD_FastEMA, MACD_SlowEMA, MACD_SignalSMA, PRICE_CLOSE);

   if (handleEMA8 < 0 || handleEMA21 < 0 || handleMACD < 0)
   {
      Print("Erro ao criar indicadores.");
      return INIT_FAILED;
   }

   return INIT_SUCCEEDED;
}

//+------------------------------------------------------------------+
//| Expert deinit function                                           |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
   IndicatorRelease(handleEMA8);
   IndicatorRelease(handleEMA21);
   IndicatorRelease(handleMACD);
}

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{
   // Verificar se temos dados suficientes
   if (BarsCalculated(handleEMA8) < 2 || BarsCalculated(handleEMA21) < 2 || BarsCalculated(handleMACD) < 2)
      return;

   // Copiar dados das EMAs
   CopyBuffer(handleEMA8, 0, 0, 2, EMA8);
   CopyBuffer(handleEMA21, 0, 0, 2, EMA21);

   // Copiar dados do MACD
   CopyBuffer(handleMACD, 0, 0, 1, MACD_Main);
   CopyBuffer(handleMACD, 1, 0, 1, MACD_Signal);

   // Confirmar sinal de cruzamento das EMAs
   bool buySignal = (EMA8[1] < EMA21[1] && EMA8[0] > EMA21[0]);
   bool sellSignal = (EMA8[1] > EMA21[1] && EMA8[0] < EMA21[0]);

   // Confirmar com o MACD
   bool macdConfirmation = (MACD_Main[0] > MACD_Signal[0] && buySignal) ||
                            (MACD_Main[0] < MACD_Signal[0] && sellSignal);

   // Aplicar filtro Renko
   double renkoBlockSize = RenkoFilter * Point;
   double renkoCurrent = NormalizeDouble(iClose(NULL, PERIOD_H1, 0) / renkoBlockSize, 0) * renkoBlockSize;

   static double lastRenko = 0;
   bool renkoValid = (renkoCurrent != lastRenko);

   if (renkoValid)
      lastRenko = renkoCurrent;

   // Abertura de ordens
   if (buySignal && macdConfirmation && renkoValid)
      PlaceOrder(ORDER_TYPE_BUY);
   else if (sellSignal && macdConfirmation && renkoValid)
      PlaceOrder(ORDER_TYPE_SELL);
}

//+------------------------------------------------------------------+
//| Função para abrir ordens                                         |
//+------------------------------------------------------------------+
void PlaceOrder(int type)
{
   double lotSize = 0.1; // Tamanho do lote
   double slippage = 3;  // Slippage permitido
   double stopLoss = 50 * Point;
   double takeProfit = 100 * Point;

   double price = (type == ORDER_TYPE_BUY) ? SymbolInfoDouble(_Symbol, SYMBOL_ASK) : SymbolInfoDouble(_Symbol, SYMBOL_BID);
   double sl = (type == ORDER_TYPE_BUY) ? price - stopLoss : price + stopLoss;
   double tp = (type == ORDER_TYPE_BUY) ? price + takeProfit : price - takeProfit;

   int ticket = OrderSend(_Symbol, type, lotSize, price, slippage, sl, tp, "Signal", 0, 0, clrBlue);
   if (ticket < 0)
      Print("Erro ao abrir ordem: ", GetLastError());
   else
      Print("Ordem aberta com sucesso: ", ticket);
}



erros:



';' - open parenthesis expected	Trend_002.mq5	74	47
';' - open parenthesis expected	Trend_002.mq5	97	32
';' - open parenthesis expected	Trend_002.mq5	98	35
'OrderSend' - wrong parameters count	Trend_002.mq5	104	17
   built-in: bool OrderSend(const MqlTradeRequest&,MqlTradeResult&)	Trend_002.mq5	104	17



corrija e me entregue completo