can someone fix my code

 
#include <Trade/Trade.mqh>

// Variáveis ​​globais
int fastPeriod = 12;
int período lento = 26;
int rsiPeríodo = 14;
int smaPeríodo = 20;
int obvPeríodo = 30;
dupla resistência, suporte;

//Função de inicialização
void OnInit()
{
  // Inicializar a variável aqui
  resistência = iHigh(NULL, 0, iHighest(NULL, 0, MODE_HIGH, obvPeriod, 0));
  suporte = iLow(NULL, 0, iLowest(NULL, 0, MODE_LOW, obvPeriod, 0));
}

//Função de iteração de barra
void OnBar()
{
  double sma = iMA(NULL, 0, smaPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
  duplo rsi = iRSI(NULL, 0, rsiPeriod, PRICE_CLOSE, 0);
  double obv = iOBV(NULL, 0, PRICE_CLOSE, PRICE_VOLUME);
  
  if(Fechar[0] > sma && rsi > 50 && obv > obv[1]){
    if(Fechar[0] > resistência)
      resistência = Fechar[0];
    if(Fechar[0] <suporte)
      suporte = Fechar[0];
    if(Fechar[0] > resistência)
      Comprar();
    if(Fechar[0] <suporte)
      Vender();
  }
  else if(Close[0] < sma && rsi < 50 && obv < obv[1]){
    if(Fechar[0] > resistência)
      resistência = Fechar[0];
    if(Fechar[0] <suporte)
      suporte = Fechar[0];
    if(Fechar[0] > resistência)
      Vender();
    if(Fechar[0] <suporte)
      Comprar();
  }
}

 
Rafael Nascimento Cerqueira: can someone fix my code
  1. Please post only in English on this part of the forums. Use the automatic translation tool if needed. Use simple language structure when using mechanical translation. (2013)

    Or use the Português forum.


  2. Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
              Messages Editor

  3. You only defined OnInit. EA will not run without a OnTick.

 

Is it supposed to be MQL4 or MQL5?

You are mixing functionality of the two types.

Also, no matter how much we try to fix it, it's incomplete and missing a lot of functionality. It will never compile with so many undeclared functions and variables.

Don't tell me this is another ChatGPT rendering, is it?