Help with order open indicator value

 
hello everyone, today I'm asking someone for help in identifying the value of an indicator as soon as a buy/sell stop opens, in order to calculate the difference in present value compared to the value of the indicator when the order was opened.
so what i need is, as soon as a buy/sell stop opens the trade the ea has to register the value of the rsi, let's pretend it's 70, and since there if the rsi value has a decrease of 8 point, in case of a buy, i close the trade, so as soon as it reaches, by example, 62, it closes the trade.

struct TradeData {
    int ticket;
    double entryRSI;
};
TradeData trades[100]; // Aumenta la dimensione se prevedi più di 100 operazioni contemporaneamente
int tradeCount = 0;
void CheckRSIAndCloseTrades() {
    double currentRSI = iRSI(NULL, 0, 14, PRICE_CLOSE, 0);
    for (int i = 0; i < tradeCount; i++) {
        if (OrderSelect(trades[i].ticket, SELECT_BY_TICKET)) {
            if (OrderType() == OP_BUY && trades[i].entryRSI - currentRSI >= 8) {
                OrderClose(trades[i].ticket, OrderLots(), Bid, 3, clrRed);
                // Rimuovi l'elemento dall'array se necessario o segnalo come non attivo
            }
        }
    }
}
void StoreTradeData(int ticket, double rsiValue) {
    trades[tradeCount].ticket = ticket;
    trades[tradeCount].entryRSI = rsiValue;
    tradeCount++;
}
I tried with this one but it doesn't work at all, returns a value of 0 when the trade opens...
can someone help pls?

thanks in advance.