Moving Average and RSI Entry Conditions - Independent Settings

 
Hei, MQL5 Community

I would appreciate your assistance and knowledge regarding an entry condition comprised of two moving averages and the RSI.

A set of conditions must be met by the RSI, such as when set to true and then apply a predefined set of requirements as shown in the code below:

To clarify, I need to add the RSI check to this piece -

if(Close[1] > MABuy || !MAFilter || !RSIFilter


if(oversold && (rsi>OversoldLevel) && (direction>0))

Regards,
   bool MABuy = FastMACurrent > SlowMACurrent && FastMAPrevious < SlowMAPrevious;
   bool MASell = FastMACurrent < SlowMACurrent && FastMAPrevious > SlowMAPrevious;

   double rsi = iRSI(Symbol(), Period(), RSIPeriod, RSIPrice, 1);
   // Direction of last bar
   double direction = iClose(Symbol(), Period(), 1)-iOpen(Symbol(), Period(), 1);

//-----------------------------------------
// RSI Above 50
//-----------------------------------------
if (rsi>50)
{
oversold = false;
} else

//-----------------------------------------
// RSI below 50
//-----------------------------------------
if (rsi<50)
{
overbought = false;
}

// check flags and maintain state.
if (rsi>
) overbought = true;
if (rsi<OversoldLevel) oversold = true;
---------------------------------------------------------------------------------

         if(Open[0] < Open[StartHour] - MinPipLimit*MyPoint) //v3.0
           {
            //check ma
            if(Close[1] > MABuy || MAFilter == false) //v3.0
              {
               ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, vSlippage, Bid - StopLoss * vPoint, Bid + TakeProfit * vPoint, "Set by SimpleSystem", Magic);
               if(ticket < 0)
Reason: