wrong parameter error in opposite positions EA, for risk managment

 

I coded this EA to open opposite position for each position opend by another EA, as a risk managment hedgin strategy.

now I can't solve 1 error in it
" 'OrderSend' - wrong parameters count 3242342.mq5 53 14
                         built-in: bool OrderSend(const MqlTradeRequest&,MqlTradeResult&) 3242342.mq5 53 14

Thnakfull for any of your guidance.

// Input parameters
input double LotSize = 0.01;

// Global variables
int ticket = -1;

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
    return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{

}

//+------------------------------------------------------------------+
//| Expert start function                                            |
//+------------------------------------------------------------------+
void OnTick()
{
    // Check if there are any open positions
    if (PositionsTotal() == 0)
    {
        Print("No open positions found!");
        return;
    }
    
    // Get the symbol of the first open position
    string symbol = PositionGetSymbol(0);
    
    // Get the type of the first open position
    ENUM_POSITION_TYPE positionType = PositionGetInteger(POSITION_TYPE);
    
    // Determine the opposite position type
    ENUM_ORDER_TYPE oppositeType = (positionType == POSITION_TYPE_BUY) ? ORDER_TYPE_SELL : ORDER_TYPE_BUY;
    
    // Open the opposite position
    ticket = OrderSend(symbol, oppositeType, LotSize, 0, 0, 0, 0, "Opposite Trade", 0, 0, CLR_NONE);
    
    if (ticket > 0)
    {
        Print("Opposite trade opened successfully! Ticket:", ticket);
    }
    else
    {
        Print("Failed to open opposite trade. Error:", GetLastError());
    }
}

 

Stop using ChatGPT! It mixes MQL5 and MQL4 code. It is useless.

Please take some time to learn to code properly, or hire someone "human" to code it for you.