on compiling :

//+------------------------------------------------------------------+
//|                        MT5-Scalper-EA-v3.01.mq5                  |
//|  ATR TP/SL • Multi-Symbol Spread • Daily Equity Stop • Vol Filter |
//|  Partial Close / Break-Even • Retry Logic • Clean Logging        |
//+------------------------------------------------------------------+
#property copyright "2025"
#property version   "3.01"
#property description "Fixed iATR/iMA signatures – fully compilable."
#include <Trade\Trade.mqh>

// Enums & Structs
enum ENUM_LOG_LEVEL { LOG_ERROR, LOG_WARN, LOG_INFO };
struct TradeParams
{
   double lot;
   double sl;
   double tp;
   double atr;
};

// Inputs
input double RiskPercent = 1.0; // % of equity risked
input double LotSize = 0.1; // Default lot size
input int ATR_Period = 14;
input double ATR_SL_Mult = 1.5;
input double ATR_TP_Mult = 3.0;
input int MaxSpread_Points = 18;
input int Slippage = 3;
input int MagicNumber = 123456;
input int TradeHour = 0;
input int TradeMinute = 30;
input int TradesToOpen = 1;
input int TrailingStop_Points = 50;
input double MaxDailyLossPercent = 5.0;
input double BE_Trigger_Points = 50;
input double BE_Offset_Points = 10;
input double MinVolFactor = 0.7;

// Globals
CTrade trade;
datetime lastTradeDay = 0;
bool tradeExecutedToday = false;
bool buySLHitToday = false;
bool sellSLHitToday = false;
double dailyStartEquity = 0;

// Logging
void Log(ENUM_LOG_LEVEL level, string txt)
{
   string prefix;
   switch(level)
   {
      case LOG_ERROR: prefix = "ERR "; break;
      case LOG_WARN: prefix = "WARN"; break;
      default: prefix = "INFO";
   }
   Print(prefix, " | ", txt);
}

// Helpers
datetime DateOfDay(datetime t)
{
   MqlDateTime tmp; TimeToStruct(t, tmp);
   tmp.hour = tmp.min = tmp.sec = 0;
   return StructToTime(tmp);
}

// ATR-Based TP / SL
double GetATR(int period)
{
   return iATR(_Symbol, PERIOD_CURRENT, period);
}

TradeParams CalcTradeParams()
{
   TradeParams p;
   p.atr = GetATR(ATR_Period);
   p.sl = ATR_SL_Mult * p.atr;
   p.tp = ATR_TP_Mult * p.atr;
   p.lot = LotSize; // Use the input lot size

   // Ensure the lot size is within the broker's limits
   double minVol = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN); // broker minimum
   double maxVol = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX); // broker maximum
   p.lot = MathMax(p.lot, minVol); // never below minimum
   p.lot = MathMin(p.lot, maxVol); // never above maximum

   return p;
}

// Multi-Symbol Spread Check
bool IsAnySpreadTooWide()
{
   string symbols[] = { _Symbol }; // extend as needed
   for(int i = 0; i < ArraySize(symbols); i++)
   {
      double ask = SymbolInfoDouble(symbols[i], SYMBOL_ASK);
      double bid = SymbolInfoDouble(symbols[i], SYMBOL_BID);
      if(ask <= 0 || bid <= 0) continue;
      if((ask - bid) / _Point > MaxSpread_Points)
      {
         Log(LOG_WARN, "High spread on " + symbols[i]);
         return true;
      }
   }
   return false;
}

// Daily Equity Stop
bool IsDailyLossExceeded()
{
   return AccountInfoDouble(ACCOUNT_EQUITY) < dailyStartEquity * (1 - MaxDailyLossPercent / 100.0);
}

// Volatility Filter
bool VolatilityOK()
{
   double curRange = iHigh(_Symbol, PERIOD_CURRENT, 1) - iLow(_Symbol, PERIOD_CURRENT, 1);
   double avgRange = iMA(_Symbol, PERIOD_CURRENT, 20, 0, MODE_SMA, PRICE_HIGH) - iMA(_Symbol, PERIOD_CURRENT, 20, 0, MODE_SMA, PRICE_LOW);
   return (curRange >= avgRange * MinVolFactor);
}

// Partial Close & Break-Even
void ManagePartialClose()
{
   if(BE_Trigger_Points <= 0) return;
   double trigger = BE_Trigger_Points * _Point;
   double offset = BE_Offset_Points * _Point;
   for(int i = PositionsTotal() - 1; i >= 0; i--)
   {
      if(!PositionSelectByTicket(PositionGetTicket(i))) continue;
      if(PositionGetInteger(POSITION_MAGIC) != MagicNumber) continue;
      double openP = PositionGetDouble(POSITION_PRICE_OPEN);
      double vol = PositionGetDouble(POSITION_VOLUME);
      double curSL = PositionGetDouble(POSITION_SL);
      double profit;
      if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY)
         profit = SymbolInfoDouble(_Symbol, SYMBOL_BID) - openP;
      else
         profit = openP - SymbolInfoDouble(_Symbol, SYMBOL_ASK);
      if(profit >= trigger && MathAbs(curSL - openP) > offset)
      {
         trade.PositionClosePartial(PositionGetTicket(i), vol * 0.5);
         double newSL = (PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY) ? openP + offset : openP - offset;
         trade.PositionModify(PositionGetTicket(i), newSL, PositionGetDouble(POSITION_TP));
         Log(LOG_INFO, "Partial close & BE set");
      }
   }
}

// Robust Order Execution with Retry
bool SafeOrderSend(ENUM_ORDER_TYPE type, double lots, double price, double sl, double tp, int retries = 3)
{
   double currentPrice = (type == ORDER_TYPE_BUY) ? SymbolInfoDouble(_Symbol, SYMBOL_ASK) : SymbolInfoDouble(_Symbol, SYMBOL_BID);
   double minStopDistance = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_STOPS_LEVEL) * _Point;

   // Ensure SL and TP are at valid distances
   if (type == ORDER_TYPE_BUY)
   {
      if (price - sl < minStopDistance)
      {
         sl = price - minStopDistance;
         Log(LOG_WARN, "Adjusted SL for buy order to meet minimum distance requirement");
      }
      if (tp - price < minStopDistance)
      {
         tp = price + minStopDistance;
         Log(LOG_WARN, "Adjusted TP for buy order to meet minimum distance requirement");
      }
   }
   else
   {
      if (sl - price < minStopDistance)
      {
         sl = price + minStopDistance;
         Log(LOG_WARN, "Adjusted SL for sell order to meet minimum distance requirement");
      }
      if (price - tp < minStopDistance)
      {
         tp = price - minStopDistance;
         Log(LOG_WARN, "Adjusted TP for sell order to meet minimum distance requirement");
      }
   }

   for (int i = 0; i < retries; i++)
   {
      bool ok = false;
      if (type == ORDER_TYPE_BUY)
         ok = trade.Buy(lots, _Symbol, price, sl, tp, "Buy Order");
      else
         ok = trade.Sell(lots, _Symbol, price, sl, tp, "Sell Order");

      if (ok)
      {
         Log(LOG_INFO, "Order executed successfully");
         return true;
      }
      Sleep(100);
   }

   Log(LOG_ERROR, "Order send failed after retries");
   return false;
}

// Trailing Stop
void ManageTrailingStops()
{
   if(TrailingStop_Points <= 0) return;
   double dist = TrailingStop_Points * _Point;
   for(int i = PositionsTotal() - 1; i >= 0; i--)
   {
      if(!PositionSelectByTicket(PositionGetTicket(i))) continue;
      if(PositionGetInteger(POSITION_MAGIC) != MagicNumber) continue;
      double openP = PositionGetDouble(POSITION_PRICE_OPEN);
      double curSL = PositionGetDouble(POSITION_SL);
      double newSL;
      if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY)
      {
         double bid = SymbolInfoDouble(_Symbol, SYMBOL_BID);
         newSL = bid - dist;
         if(bid - openP > dist && (curSL == 0 || newSL > curSL + _Point * 0.5))
            trade.PositionModify(PositionGetTicket(i), newSL, PositionGetDouble(POSITION_TP));
      }
      else
      {
         double ask = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
         newSL = ask + dist;
         if(openP - ask > dist && (curSL == 0 || newSL < curSL - _Point * 0.5))
            trade.PositionModify(PositionGetTicket(i), newSL, PositionGetDouble(POSITION_TP));
      }
   }
}

// Detect Stop-Loss Hits
void CheckStopLossHits()
{
   HistorySelect(0, TimeCurrent());
   for(int i = 0; i < HistoryDealsTotal(); i++)
   {
      ulong ticket = HistoryDealGetTicket(i);
      if(HistoryDealGetInteger(ticket, DEAL_MAGIC) != MagicNumber) continue;
      if(HistoryDealGetInteger(ticket, DEAL_ENTRY) != DEAL_ENTRY_OUT) continue;
      if(HistoryDealGetInteger(ticket, DEAL_REASON) != DEAL_REASON_SL) continue;
      long type = HistoryDealGetInteger(ticket, DEAL_TYPE);
      if(type == DEAL_TYPE_BUY) buySLHitToday = true;
      if(type == DEAL_TYPE_SELL) sellSLHitToday = true;
   }
}

// Init / Deinit
int OnInit()
{
   trade.SetExpertMagicNumber(MagicNumber);
   trade.SetDeviationInPoints(Slippage);
   lastTradeDay = DateOfDay(TimeCurrent());
   dailyStartEquity = AccountInfoDouble(ACCOUNT_EQUITY);
   tradeExecutedToday = false;
   buySLHitToday = false;
   sellSLHitToday = false;
   Log(LOG_INFO, "EA started");
   return(INIT_SUCCEEDED);
}

void OnDeinit(const int reason)
{
   Log(LOG_INFO, "EA stopped");
}

// Main Tick
void OnTick()
{
   datetime currentDay = DateOfDay(TimeCurrent());
   if(lastTradeDay != currentDay)
   {
      lastTradeDay = currentDay;
      dailyStartEquity = AccountInfoDouble(ACCOUNT_EQUITY);
      tradeExecutedToday = false;
      buySLHitToday = false;
      sellSLHitToday = false;
      Log(LOG_INFO, "New trading day");
   }
   CheckStopLossHits();
   ManageTrailingStops();
   ManagePartialClose();
   if(IsDailyLossExceeded())
   {
      Log(LOG_WARN, "Daily loss limit reached – no new trades");
      return;
   }

   // Scheduled trade window
   MqlDateTime tm;
   TimeToStruct(TimeCurrent(), tm);
   tm.hour = TradeHour; tm.min = TradeMinute; tm.sec = 0;
   datetime tradeTime = StructToTime(tm);
   int window = 5 * 60;
   bool inWindow = (TimeCurrent() >= tradeTime - window) && (TimeCurrent() <= tradeTime + window);
   if(!inWindow) return;
   if(IsAnySpreadTooWide() || !VolatilityOK())
      return;

   // Direction & send orders
   TradeParams p = CalcTradeParams();
   bool buy = false;
   bool sell = false;
   if(!tradeExecutedToday)
   {
      int dir = GetPrevDayDirection();
      if(dir == 0) buy = true;
      if(dir == 1) sell = true;
   }
   else
   {
      if(buySLHitToday && !sellSLHitToday) sell = true;
      if(sellSLHitToday && !buySLHitToday) buy = true;
   }
   for(int i = 0; i < TradesToOpen; i++)
   {
      if(buy)
         SafeOrderSend(ORDER_TYPE_BUY, p.lot, SymbolInfoDouble(_Symbol, SYMBOL_ASK), p.sl, p.tp);
      if(sell)
         SafeOrderSend(ORDER_TYPE_SELL, p.lot, SymbolInfoDouble(_Symbol, SYMBOL_BID), p.sl, p.tp);
   }
   tradeExecutedToday = true;
}

// Previous Day Direction
int GetPrevDayDirection()
{
   datetime yesterdayEnd = DateOfDay(TimeCurrent()) - PeriodSeconds(PERIOD_D1);
   datetime yesterdayStart = yesterdayEnd - PeriodSeconds(PERIOD_D1);
   double open = iOpen(_Symbol, PERIOD_D1, iBarShift(_Symbol, PERIOD_D1, yesterdayStart, false));
   double close = iClose(_Symbol, PERIOD_D1, iBarShift(_Symbol, PERIOD_D1, yesterdayEnd, false));
   if(close > open) return 0;
   if(close < open) return 1;
   return -1;
}


i get :

'MT5-Scalper-EA-KIMI-K2-TRY.mq5'			0
Trade.mqh			
Object.mqh			
StdLibErr.mqh			
OrderInfo.mqh			
HistoryOrderInfo.mqh			
PositionInfo.mqh			
DealInfo.mqh			
'SymbolInfoDouble' - no one of the overloads can be applied to the function call	MT5-Scalper-EA-KIMI-K2-TRY.mq5	155	29
could be one of 2 function(s)	MT5-Scalper-EA-KIMI-K2-TRY.mq5	155	29
   built-in: double SymbolInfoDouble(const string,ENUM_SYMBOL_INFO_DOUBLE)	MT5-Scalper-EA-KIMI-K2-TRY.mq5	155	29
   built-in: bool SymbolInfoDouble(const string,ENUM_SYMBOL_INFO_DOUBLE,double&)	MT5-Scalper-EA-KIMI-K2-TRY.mq5	155	29
1 errors, 0 warnings		1	0