//+------------------------------------------------------------------+
//| Expert initialization                                            |
//+------------------------------------------------------------------+
input int TrailingStopPoints = 20;         // Tamanho do trailing stop em pontos
input double Lots = 0.1;                  // Tamanho do lote
input int Slippage = 3;                   // Slippage permitido
input int Stochastic_PeriodK = 5;         // Período %K do Estocástico
input int Stochastic_PeriodD = 3;         // Período %D do Estocástico
input int Stochastic_Slowing = 3;         // Slowing do Estocástico
input ENUM_TIMEFRAMES Ichimoku_Timeframe = PERIOD_CURRENT; // Timeframe do Ichimoku
input ENUM_TIMEFRAMES SMA_Timeframe = PERIOD_CURRENT;      // Timeframe da SMA

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
   Print("Expert Advisor iniciado!");
   return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
   Print("Expert Advisor finalizado!");
}

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{
   double priceBid = SymbolInfoDouble(_Symbol, SYMBOL_BID);
   double priceAsk = SymbolInfoDouble(_Symbol, SYMBOL_ASK);

   // Verificar condições de entrada
   if (CheckBuyCondition())
      OpenOrder(ORDER_TYPE_BUY, priceAsk);
   else if (CheckSellCondition())
      OpenOrder(ORDER_TYPE_SELL, priceBid);

   // Aplicar trailing stop
   ApplyTrailingStop();
}

//+------------------------------------------------------------------+
//| Verifica condições de compra                                     |
//+------------------------------------------------------------------+
bool CheckBuyCondition()
{
   double SMA200 = iMA(_Symbol, SMA_Timeframe, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
   double Tenkan = iIchimoku(_Symbol, Ichimoku_Timeframe, 9, 26, 52, MODE_TENKANSEN, 0);
   double Kijun = iIchimoku(_Symbol, Ichimoku_Timeframe, 9, 26, 52, MODE_KIJUNSEN, 0);
   double K = iStochastic(_Symbol, PERIOD_CURRENT, Stochastic_PeriodK, Stochastic_PeriodD, Stochastic_Slowing, MODE_MAIN, 0);
   double D = iStochastic(_Symbol, PERIOD_CURRENT, Stochastic_PeriodK, Stochastic_PeriodD, Stochastic_Slowing, MODE_SIGNAL, 0);

   if (Tenkan > Kijun && K < 20 && K > D && SMA200 < SymbolInfoDouble(_Symbol, SYMBOL_BID))
      return true;

   return false;
}

//+------------------------------------------------------------------+
//| Verifica condições de venda                                      |
//+------------------------------------------------------------------+
bool CheckSellCondition()
{
   double SMA200 = iMA(_Symbol, SMA_Timeframe, 200, 0, MODE_SMA, PRICE_CLOSE, 0);
   double Tenkan = iIchimoku(_Symbol, Ichimoku_Timeframe, 9, 26, 52, MODE_TENKANSEN, 0);
   double Kijun = iIchimoku(_Symbol, Ichimoku_Timeframe, 9, 26, 52, MODE_KIJUNSEN, 0);
   double K = iStochastic(_Symbol, PERIOD_CURRENT, Stochastic_PeriodK, Stochastic_PeriodD, Stochastic_Slowing, MODE_MAIN, 0);
   double D = iStochastic(_Symbol, PERIOD_CURRENT, Stochastic_PeriodK, Stochastic_PeriodD, Stochastic_Slowing, MODE_SIGNAL, 0);

   if (Tenkan < Kijun && K > 80 && K < D && SMA200 > SymbolInfoDouble(_Symbol, SYMBOL_BID))
      return true;

   return false;
}

//+------------------------------------------------------------------+
//| Abre uma ordem de mercado                                        |
//+------------------------------------------------------------------+
void OpenOrder(ENUM_ORDER_TYPE type, double price)
{
   MqlTradeRequest request;
   MqlTradeResult result;
   ZeroMemory(request);
   ZeroMemory(result);

   request.action = TRADE_ACTION_DEAL;
   request.symbol = _Symbol;
   request.volume = Lots;
   request.type = type;
   request.price = price;
   request.slippage = Slippage;
   request.deviation = 10; // Ajuste do desvio para execução.

   if (!OrderSend(request, result))
      Print("Erro ao enviar ordem: ", result.comment);
}

//+------------------------------------------------------------------+
//| Aplica o trailing stop                                           |
//+------------------------------------------------------------------+
void ApplyTrailingStop()
{
   for (int i = 0; i < PositionsTotal(); i++)
   {
      if (PositionSelectByIndex(i))
      {
         string symbol = PositionGetString(POSITION_SYMBOL);
         double currentStop = PositionGetDouble(POSITION_SL);
         double openPrice = PositionGetDouble(POSITION_PRICE_OPEN);
         ENUM_POSITION_TYPE type = (ENUM_POSITION_TYPE)PositionGetInteger(POSITION_TYPE);
         double newStop;

         if (type == POSITION_TYPE_BUY)
         {
            newStop = SymbolInfoDouble(symbol, SYMBOL_BID) - TrailingStopPoints * _Point;
            if (newStop > currentStop)
               PositionModify(PositionGetTicket(), newStop);
         }
         else if (type == POSITION_TYPE_SELL)
         {
            newStop = SymbolInfoDouble(symbol, SYMBOL_ASK) + TrailingStopPoints * _Point;
            if (newStop < currentStop)
               PositionModify(PositionGetTicket(), newStop);
         }
      }
   }
}

errors:

'iMA' - wrong parameters count	Stocastico.mq5	53	20
   built-in: int iMA(const string,ENUM_TIMEFRAMES,int,int,ENUM_MA_METHOD,int)	Stocastico.mq5	53	20
'MODE_TENKANSEN' - undeclared identifier	Stocastico.mq5	54	70
'iIchimoku' - wrong parameters count	Stocastico.mq5	54	20
   built-in: int iIchimoku(const string,ENUM_TIMEFRAMES,int,int,int)	Stocastico.mq5	54	20
'MODE_KIJUNSEN' - undeclared identifier	Stocastico.mq5	55	69
'iIchimoku' - wrong parameters count	Stocastico.mq5	55	19
   built-in: int iIchimoku(const string,ENUM_TIMEFRAMES,int,int,int)	Stocastico.mq5	55	19
'MODE_MAIN' - undeclared identifier	Stocastico.mq5	56	112
'MODE_MAIN' - cannot convert enum	Stocastico.mq5	56	112
   built-in: int iStochastic(const string,ENUM_TIMEFRAMES,int,int,int,ENUM_MA_METHOD,ENUM_STO_PRICE)	Stocastico.mq5	56	112
'MODE_SIGNAL' - undeclared identifier	Stocastico.mq5	57	112
'MODE_SIGNAL' - cannot convert enum	Stocastico.mq5	57	112
   built-in: int iStochastic(const string,ENUM_TIMEFRAMES,int,int,int,ENUM_MA_METHOD,ENUM_STO_PRICE)	Stocastico.mq5	57	112
'iMA' - wrong parameters count	Stocastico.mq5	70	20
   built-in: int iMA(const string,ENUM_TIMEFRAMES,int,int,ENUM_MA_METHOD,int)	Stocastico.mq5	70	20
'MODE_TENKANSEN' - undeclared identifier	Stocastico.mq5	71	70
'iIchimoku' - wrong parameters count	Stocastico.mq5	71	20
   built-in: int iIchimoku(const string,ENUM_TIMEFRAMES,int,int,int)	Stocastico.mq5	71	20
'MODE_KIJUNSEN' - undeclared identifier	Stocastico.mq5	72	69
'iIchimoku' - wrong parameters count	Stocastico.mq5	72	19
   built-in: int iIchimoku(const string,ENUM_TIMEFRAMES,int,int,int)	Stocastico.mq5	72	19
'MODE_MAIN' - undeclared identifier	Stocastico.mq5	73	112
'MODE_MAIN' - cannot convert enum	Stocastico.mq5	73	112
   built-in: int iStochastic(const string,ENUM_TIMEFRAMES,int,int,int,ENUM_MA_METHOD,ENUM_STO_PRICE)	Stocastico.mq5	73	112
'MODE_SIGNAL' - undeclared identifier	Stocastico.mq5	74	112
'MODE_SIGNAL' - cannot convert enum	Stocastico.mq5	74	112
   built-in: int iStochastic(const string,ENUM_TIMEFRAMES,int,int,int,ENUM_MA_METHOD,ENUM_STO_PRICE)	Stocastico.mq5	74	112
'slippage' - undeclared identifier	Stocastico.mq5	97	12
'PositionSelectByIndex' - undeclared identifier	Stocastico.mq5	111	11
'i' - some operator expected	Stocastico.mq5	111	33
'PositionModify' - undeclared identifier	Stocastico.mq5	123	16
'PositionGetTicket' - wrong parameters count	Stocastico.mq5	123	31
   built-in: ulong PositionGetTicket(uint)	Stocastico.mq5	123	31
',' - unexpected token	Stocastico.mq5	123	50
'PositionGetTicket' - some operator expected	Stocastico.mq5	123	31
')' - unexpected token	Stocastico.mq5	123	59
'PositionModify' - undeclared identifier	Stocastico.mq5	129	16
'PositionGetTicket' - wrong parameters count	Stocastico.mq5	129	31
   built-in: ulong PositionGetTicket(uint)	Stocastico.mq5	129	31
',' - unexpected token	Stocastico.mq5	129	50
'PositionGetTicket' - some operator expected	Stocastico.mq5	129	31
')' - unexpected token	Stocastico.mq5	129	59

corrija e me entregue o codigo completo