I want to make a bot with AI but in compiling have lots of error

 

Actually I dont know about coding so I use AI for my strategy and coding with Ai but have lost of error can everyone help me?

#property strict
input double riskPercentage = 0.5; // Risk percentage per trade
int OnInit()
  {
   return INIT_SUCCEEDED;
  }
void OnDeinit(const int reason)
  {
   
  }
void OnTick()
  {
   // Get the size of the last candle
   double candleSize = MathAbs((iClose(_Symbol, PERIOD_CURRENT, 1) - iOpen(_Symbol, PERIOD_CURRENT, 1)) / _Point);
   
   // Calculate risk per trade based on account balance
   double riskAmount = AccountBalance() * riskPercentage / 100;

   // Calculate lot size based on risk
   double lotSize = riskAmount / (candleSize * MarketInfo(_Symbol, MODE_MARGINREQUIRED));

   // Place orders based on candle type
   if (iClose(_Symbol, PERIOD_CURRENT, 1) > iOpen(_Symbol, PERIOD_CURRENT, 1)) // Bullish candle
     {
      double entryPrice = High[1];
      double stopLoss = Low[1];
      double takeProfit = entryPrice + candleSize * _Point;

      // Place buy stop order
      OrderSend(_Symbol, OP_BUYSTOP, lotSize, entryPrice, 3, stopLoss, takeProfit, "Bullish Candle", 0, 0, clrNONE);
     }
   else if (iClose(_Symbol, PERIOD_CURRENT, 1) < iOpen(_Symbol, PERIOD_CURRENT, 1)) // Bearish candle
     {
      double entryPrice = Low[1];
      double stopLoss = High[1];
      double takeProfit = entryPrice - candleSize * _Point;

      // Place sell stop order
      OrderSend(_Symbol, OP_SELLSTOP, lotSize, entryPrice, 3, stopLoss, takeProfit, "Bearish Candle", 0, 0, clrNONE);
     }
  }
 

Please, don't request help for ChatGPT (or other A.I.) generated code. It generates horrible code, mixing MQL4 and MQL5. Please use the Freelance section for such requests — https://www.mql5.com/en/job 

More in details: post

Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • 2024.05.11
  • www.mql5.com
The largest freelance service with MQL5 application developers
 
  1. Don't double post! You already had this thread open.
              General rules and best pratices of the Forum. - General - MQL5 programming forum #6 (2017)

  2. Your posted code is for MT4.

    Stop using ChatGPT/Copilot.
              Help needed to debug and fix an AI EA - Trading Systems - MQL5 programming forum #2 (2023)