on running:

//+------------------------------------------------------------------+
//|                                                      SupportResistanceEA.mq5 |
//|                        Copyright 2023, MetaQuotes Software Corp. |
//|                                             https://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright 2023, MetaQuotes Software Corp."
#property link      "https://www.metaquotes.net/"
#property version   "1.00"

// Input parameters
input int      InpOrder = 5;          // Order for extrema detection
input double   InpPrecision = 0.0005; // Precision for clustering levels
input bool     InpUseSmoothing = true; // Use smoothing
input int      InpSmoothingWindow = 5; // Smoothing window

// Global variables
double supportLevels[];
double resistanceLevels[];
double prices[];

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
   // Initialize arrays
   ArrayResize(supportLevels, 0);
   ArrayResize(resistanceLevels, 0);
   ArrayResize(prices, 0);

   return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
   // Clean up
   ArrayFree(supportLevels);
   ArrayFree(resistanceLevels);
   ArrayFree(prices);
}

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{
   // Collect prices
   int bars = iBars(_Symbol, _Period);
   ArrayResize(prices, bars);
   for (int i = 0; i < bars; i++)
   {
      prices[i] = iClose(_Symbol, _Period, i);
   }

   // Smooth prices if needed
   if (InpUseSmoothing)
   {
      smoothPrices(prices, InpSmoothingWindow);
   }

   // Find support and resistance levels
   findSupportResistance(prices, InpOrder, InpPrecision);

   // Draw support and resistance lines
   drawSupportResistanceLines();

   // Determine trade signals
   determineTradeSignals();
}

//+------------------------------------------------------------------+
//| Smooth prices using rolling mean                                 |
//+------------------------------------------------------------------+
void smoothPrices(double &arr[], int window)
{
   double smoothed[];
   ArrayResize(smoothed, ArraySize(arr));

   for (int i = 0; i < ArraySize(arr); i++)
   {
      double sum = 0;
      int count = 0;

      for (int j = i - window; j <= i + window; j++)
      {
         if (j >= 0 && j < ArraySize(arr))
         {
            sum += arr[j];
            count++;
         }
      }

      smoothed[i] = sum / count;
   }

   ArrayCopy(arr, smoothed);
}

//+------------------------------------------------------------------+
//| Find support and resistance levels                               |
//+------------------------------------------------------------------+
void findSupportResistance(double &arr[], int order, double precision)
{
   // Clear previous levels
   ArrayFree(supportLevels);
   ArrayFree(resistanceLevels);

   // Find local extrema
   int supportIdx[], resistanceIdx[];
   ArrayResize(supportIdx, 0);
   ArrayResize(resistanceIdx, 0);
   findLocalExtrema(arr, order, supportIdx, resistanceIdx);

   // Cluster levels
   supportLevels = clusterLevels(arr, supportIdx, precision);
   resistanceLevels = clusterLevels(arr, resistanceIdx, precision);
}

//+------------------------------------------------------------------+
//| Find local extrema                                               |
//+------------------------------------------------------------------+
void findLocalExtrema(double &arr[], int order, int &supportIdx[], int &resistanceIdx[])
{
   // Placeholder for extrema detection logic
   // You need to implement this logic based on your requirements
}

//+------------------------------------------------------------------+
//| Cluster levels                                                   |
//+------------------------------------------------------------------+
void clusterLevels(double &arr[], int &idx[], double precision, double &clustered[])
{
   ArrayResize(clustered, 0);

   // Implement clustering logic here
   // This is a placeholder for the actual implementation
}

//+------------------------------------------------------------------+
//| Draw support and resistance lines                               |
//+------------------------------------------------------------------+
void drawSupportResistanceLines()
{
   // Clear previous drawings
   ObjectsDeleteAll(0, "Support_");
   ObjectsDeleteAll(0, "Resistance_");

   // Draw support lines
   for (int i = 0; i < ArraySize(supportLevels); i++)
   {
      string name = "Support_" + IntegerToString(i);
      ObjectCreate(0, name, OBJ_HLINE, 0, 0, supportLevels[i]);
      ObjectSetInteger(0, name, OBJPROP_COLOR, clrGreen);
      ObjectSetInteger(0, name, OBJPROP_STYLE, STYLE_DOT);
      ObjectSetInteger(0, name, OBJPROP_WIDTH, 1);
   }

   // Draw resistance lines
   for (int i = 0; i < ArraySize(resistanceLevels); i++)
   {
      string name = "Resistance_" + IntegerToString(i);
      ObjectCreate(0, name, OBJ_HLINE, 0, 0, resistanceLevels[i]);
      ObjectSetInteger(0, name, OBJPROP_COLOR, clrRed);
      ObjectSetInteger(0, name, OBJPROP_STYLE, STYLE_DOT);
      ObjectSetInteger(0, name, OBJPROP_WIDTH, 1);
   }
}

//+------------------------------------------------------------------+
//| Determine trade signals                                          |
//+------------------------------------------------------------------+
void determineTradeSignals()
{
   double currentPrice = iClose(_Symbol, _Period, 0);

   for (int i = 0; i < ArraySize(supportLevels); i++)
   {
      if (currentPrice > supportLevels[i] && currentPrice < resistanceLevels[i])
      {
         // Buy signal
         Print("Buy Signal at ", supportLevels[i]);
         // Add buy indicator on the chart
         string name = "Buy_" + IntegerToString(i);
         ObjectCreate(0, name, OBJ_ARROW_UP, 0, TimeCurrent(), supportLevels[i]);
         ObjectSetInteger(0, name, OBJPROP_COLOR, clrBlue);
      }
   }

   for (int i = 0; i < ArraySize(resistanceLevels); i++)
   {
      if (currentPrice < resistanceLevels[i] && currentPrice > supportLevels[i])
      {
         // Sell signal
         Print("Sell Signal at ", resistanceLevels[i]);
         // Add sell indicator on the chart
         string name = "Sell_" + IntegerToString(i);
         ObjectCreate(0, name, OBJ_ARROW_DOWN, 0, TimeCurrent(), resistanceLevels[i]);
         ObjectSetInteger(0, name, OBJPROP_COLOR, clrRed);
      }
   }
}
//+------------------------------------------------------------------+


i get compiiation error:
'suportBuySell.mq5'			1
'clusterLevels' - wrong parameters count	suportBuySell.mq5	118	20
   void clusterLevels(double&[],int&[],double,double&[])	suportBuySell.mq5	134	6
'supportLevels' - invalid array access	suportBuySell.mq5	118	4
'clusterLevels' - wrong parameters count	suportBuySell.mq5	119	23
   void clusterLevels(double&[],int&[],double,double&[])	suportBuySell.mq5	134	6
'resistanceLevels' - invalid array access	suportBuySell.mq5	119	4
4 errors, 0 warnings		5	1