I want add trade panel to my ea but i get errors can someone help me pls!!!

 
//+------------------------------------------------------------------+
//|                                                     OxygenTR.mq5 |
//|                             Copyright 2025, Hüseyin Avni Ekmekçi |
//|                                            haekmekci@hotmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, Hüseyin Avni Ekmekçi"
#property link      "haekmekci@hotmail.com"
#property version   "1.00"

#include <Trade/Trade.mqh>
#include <Controls/Panel.mqh>
#include <Controls/Button.mqh>


CTrade trade;
CPanel panel;
CButton buttonOpenBuy;
CButton buttonOpenSell;
CButton buttonCloseAll;

input double RiskPercent = 10.0;        // Risk per trade (%)
input double MaxSpread = 10.0;          // Max spread in pips
input int Slippage = 3;                // Max slippage in points
input double MaxDrawdown = 20.0;       // Max drawdown (%)
input int TP_Pips = 100;               // Take profit in pips
input int SL_Pips = 50;                // Stop loss in pips
input int TrailingStart = 20;          // Trailing start in pips
input int TrailingStep = 10;           // Trailing step in pips

double peakEquity = 0.0;

//+------------------------------------------------------------------+
int OnInit() {
    peakEquity = ACCOUNT_EQUITY;

    // Initialize panel
    panel.Create(0, "TradePanel", 0, 10, 10, 200, 150);
    panel.ColorBackground(clrWhite);
    panel.ColorBorder(clrBlack);
    panel.FontSize(10);
    panel.Caption("Trade Panel");

    // Initialize buttons
    buttonOpenBuy.Create(0, "OpenBuy", 0, 10, 30, 180, 50);
    buttonOpenBuy.Text("Open Buy");
    buttonOpenBuy.ColorBackground(clrGreen);
    buttonOpenBuy.ColorBorder(clrBlack);
    buttonOpenBuy.ColorText(clrWhite);

    buttonOpenSell.Create(0, "OpenSell", 0, 10, 70, 180, 50);
    buttonOpenSell.Text("Open Sell");
    buttonOpenSell.ColorBackground(clrRed);
    buttonOpenSell.ColorBorder(clrBlack);
    buttonOpenSell.ColorText(clrWhite);

    buttonCloseAll.Create(0, "CloseAll", 0, 10, 110, 180, 50);
    buttonCloseAll.Text("Close All");
    buttonCloseAll.ColorBackground(clrBlue);
    buttonCloseAll.ColorBorder(clrBlack);
    buttonCloseAll.ColorText(clrWhite);

    // Add buttons to panel
    panel.Add(buttonOpenBuy);
    panel.Add(buttonOpenSell);
    panel.Add(buttonCloseAll);

    return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
void OnDeinit(const int reason) {
    panel.Destroy();
}

//+------------------------------------------------------------------+
void OnTick() {
    double currentEquity = ACCOUNT_EQUITY;
    peakEquity = MathMax(peakEquity, currentEquity);
    double drawdown = (peakEquity - currentEquity) / peakEquity * 100;

    if(drawdown > MaxDrawdown) {
        CloseAllTrades();
        return;
    }

    long spread = SymbolInfoInteger(_Symbol, SYMBOL_SPREAD) / 10;
    if(spread > MaxSpread) return;

    if(!PositionSelect(_Symbol)) {
        // No automatic trade opening in this example
    } else {
        ManageTrailingStop();
    }
}

//+------------------------------------------------------------------+
void OnChartEvent(const int id, const long& lparam, const double& dparam, const string& sparam) {
    if(id == CHARTEVENT_OBJECT_CLICK) {
        if(sparam == "OpenBuy") {
            OpenTrade(POSITION_TYPE_BUY);
        } else if(sparam == "OpenSell") {
            OpenTrade(POSITION_TYPE_SELL);
        } else if(sparam == "CloseAll") {
            CloseAllTrades();
        }
    }
}

//+------------------------------------------------------------------+
double CalculateLotSize(double riskPercent, double stopLossPips) {
    double equity = ACCOUNT_EQUITY;
    double pipValue = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE);
    double lotSize = (equity * riskPercent / 100) / (stopLossPips * pipValue);
    return NormalizeDouble(lotSize, 2);
}

//+------------------------------------------------------------------+
void ManageTrailingStop() {
    for(int i = PositionsTotal() - 1; i >= 0; i--) {
        if(PositionGetSymbol(i) == _Symbol) {
            double profitPips = PositionGetDouble(POSITION_PROFIT) / Point();
            if(profitPips >= TrailingStart) {
                double sl = PositionGetDouble(POSITION_SL);
                double currentPrice = PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY ? SymbolInfoDouble(_Symbol, SYMBOL_BID) : SymbolInfoDouble(_Symbol, SYMBOL_ASK);
                double newSL = currentPrice - TrailingStep * Point();
                if(newSL > sl) {
                    trade.PositionModify(PositionGetTicket(i), newSL, PositionGetDouble(POSITION_TP));
                }
            }
        }
    }
}

//+------------------------------------------------------------------+
void OpenTrade(ENUM_POSITION_TYPE type) {
    double lotSize = CalculateLotSize(RiskPercent, SL_Pips);
    double price = (type == POSITION_TYPE_BUY) ? SymbolInfoDouble(_Symbol, SYMBOL_ASK) : SymbolInfoDouble(_Symbol, SYMBOL_BID);
    double sl = (type == POSITION_TYPE_BUY) ? price - SL_Pips * Point() : price + SL_Pips * Point();
    double tp = (type == POSITION_TYPE_BUY) ? price + TP_Pips * Point() : price - TP_Pips * Point();

    trade.PositionOpen(_Symbol, ORDER_TYPE_BUY, lotSize, price, sl, tp, "Trade from Panel");
}

//+------------------------------------------------------------------+
void CloseAllTrades() {
    for(int i = PositionsTotal() - 1; i >= 0; i--) {
        trade.PositionClose(PositionGetTicket(i));
    }
}
Files:
errors.png  209 kb