Can RSI Alone Make You Profit? A Simple Yet Powerful EA [Code + Backtest Included]

 

Hey traders! 👋

Lately, I’ve been exploring the idea of building trading systems based on pure simplicity. The goal? To test whether a single indicator—no filters, no magic—can still deliver results in today’s markets.

So I built a basic RSI-based Expert Advisor (EA) in MQL5. And to my surprise, the backtest came out better than expected! 💡


💡 Strategy Logic:

  • Buy when RSI < 30

  • Sell when RSI > 70

  • Fixed lot size

  • Fixed Stop Loss & Take Profit (30 pips each)

  • Only one open position at a time                                          


📜 Code (MQL5 - MetaTrader 5 Compatible): 


// RSI_EA.mq5 - Simple RSI Expert Advisor
#property strict
input int RSI_Period = 14;
input double RSI_Buy_Level = 30.0;
input double RSI_Sell_Level = 70.0;
input double LotSize = 0.1;
input int StopLoss = 300;
input int TakeProfit = 300;
input ENUM_TIMEFRAMES TimeFrame = PERIOD_M15;

int rsi_handle;
#include <Trade\Trade.mqh>
CTrade trade;

int OnInit()
{
   rsi_handle = iRSI(_Symbol, TimeFrame, RSI_Period, PRICE_CLOSE);
   if (rsi_handle == INVALID_HANDLE)
   {
      Print("Failed to get RSI handle");
      return INIT_FAILED;
   }
   return INIT_SUCCEEDED;
}

void OnTick()
{
   double rsi_value[];
   if (CopyBuffer(rsi_handle, 0, 0, 1, rsi_value) <= 0)
   {
      Print("Failed to get RSI value");
      return;
   }

   if (PositionSelect(_Symbol)) return;

   double ask = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
   double bid = SymbolInfoDouble(_Symbol, SYMBOL_BID);

   if (rsi_value[0] < RSI_Buy_Level)
      trade.Buy(LotSize, _Symbol, ask, ask - StopLoss * _Point, ask + TakeProfit * _Point);
   else if (rsi_value[0] > RSI_Sell_Level)
      trade.Sell(LotSize, _Symbol, bid, bid + StopLoss * _Point, bid - TakeProfit * _Point);
}

📊 Backtest Results:

Symbol: EURUSD

Timeframe: M15

Date Range: Jan 1, 2024 – Apr 1, 2024

Initial Deposit: $10,000    


Metric Result
Net Profit +$427.50
Total Trades 38
Winning Trades 68.4%
Max Drawdown 5.2%
Avg. Profit per Trades $22.4


💬 Let’s Collaborate!

This EA is far from perfect—but it’s a great starting point. I’m curious:

  • What filters or conditions would you add to improve its consistency?

  • Could dynamic SL/TP or trend filters make it more robust?

  • Anyone willing to share optimization results?

Let’s build something smarter—together 🚀
Looking forward to your feedback!

 

 
I guess you're a beginner? Sorry this is not a recommended way of trading with RSI, you will kill your account with this. You should read about trusted RSI strategies in the article section.
 
Conor Mcnamara #:
I guess you're a beginner? Sorry this is not a recommended way of trading with RSI, you will kill your account with this. You should read about trusted RSI strategies in the article section.

Hey, thanks for the feedback!
I’m definitely still learning — that’s why I wanted to post something simple and transparent to get real input from experienced traders like yourself.

I’m aware this RSI-only approach has limitations, and I'm not using it on a live account. The goal here was more of a starting point to explore:

  • How RSI behaves without filters

  • What kind of improvements or safety layers could be added (trend confirmation, ATR filters, etc.)

If you know of any trusted RSI strategies or articles you recommend, I’d really appreciate it if you could link them here. I’m definitely open to learning and iterating based on real-world experience.

 


Ramazan Erdogan #:


Thank you I will execute & back test it. 

Brilliant One!

🔥 Can RSI Alone Make You Profit? A Simple Yet Powerful EA [Code + Backtest Included]
🔥 Can RSI Alone Make You Profit? A Simple Yet Powerful EA [Code + Backtest Included]
  • 2025.04.15
  • Ramazan Erdogan
  • www.mql5.com
Hey traders! 👋 Lately, I’ve been exploring the idea of building trading systems based on pure simplicity . The goal...
 
Ramazan Erdogan #:

Hey, thanks for the feedback!
I’m definitely still learning — that’s why I wanted to post something simple and transparent to get real input from experienced traders like yourself.

I’m aware this RSI-only approach has limitations, and I'm not using it on a live account. The goal here was more of a starting point to explore:

  • How RSI behaves without filters

  • What kind of improvements or safety layers could be added (trend confirmation, ATR filters, etc.)

If you know of any trusted RSI strategies or articles you recommend, I’d really appreciate it if you could link them here. I’m definitely open to learning and iterating based on real-world experience.

Here's a good primer on the RSI indicator: 

Relative Strength Index (RSI) Indicator Explained With Formula

FYI... The way that you're using it (30/70) assumes that price is always ranging. With a reliable trend filter, you can just as well take a bounce off the 50. The first thing that comes to mind is a plain old 200 SMA.

Also, you might try adding to the definitions of your trading conditions, e.g., if bar open is => 70 and bar close is < 70 then sell. In this way, at least you'll know you have a one bar level crossover in your direction.

And keep in mind that one indicator provides a wealth of data. You can evaluate the slope (up, down, or flat - I don't mean the angle) over the last 2 indicator bars or so, the span (distance) between bars a, b, and/or c and a level, etc.

Overall, I totally respect your desire to adhere to the KISS principle (Keep It Simple Stupid).👍

Relative Strength Index (RSI) Indicator Explained With Formula
Relative Strength Index (RSI) Indicator Explained With Formula
  • www.investopedia.com
The relative strength index (RSI) is a momentum indicator used in technical analysis. RSI measures the speed and magnitude of a security's recent price changes to detect overbought or oversold conditions in the price of that security. The RSI is displayed as an oscillator (a line graph) on a scale of zero to 100. The indicator was developed by...
[Deleted]  
Ramazan Erdogan:


Metric Result
Net Profit +$427.50
Total Trades 38
Winning Trades 68.4%
Max Drawdown 5.2%
Avg. Profit per Trades $22.4



Interesting. Keep updated about your performance.


You can combine RSI + BB (or) RSI + MA. but if RSI alone giving you great profit, then no need to combine with any

[Deleted]  
Ntsiki Ncoco #:
Thank you I will execute & back test it. 
Have you backtested?
 
I believe the RSI filter you are using is a good one. But trying to backtest it for a longer period of time you will realize that market behaviour changes and maybe 30pips as SL/TP could not work always. In fact the choice of SL/TP can put you in an overfit condition which works only for the backtesting period. Generally my take is whatever strategy you use you should use your own insight as a major filter to be applied to all entries that are suggested by the trading system.
 
Ryan L Johnson #:

Here's a good primer on the RSI indicator: 

Relative Strength Index (RSI) Indicator Explained With Formula

FYI... The way that you're using it (30/70) assumes that price is always ranging. With a reliable trend filter, you can just as well take a bounce off the 50. The first thing that comes to mind is a plain old 200 SMA.

Also, you might try adding to the definitions of your trading conditions, e.g., if bar open is => 70 and bar close is < 70 then sell. In this way, at least you'll know you have a one bar level crossover in your direction.

And keep in mind that one indicator provides a wealth of data. You can evaluate the slope (up, down, or flat - I don't mean the angle) over the last 2 indicator bars or so, the span (distance) between bars a, b, and/or c and a level, etc.

Overall, I totally respect your desire to adhere to the KISS principle (Keep It Simple Stupid).👍

Hey, I really appreciate the thoughtful feedback 🙏
You're absolutely right — using 30/70 RSI levels does assume ranging conditions, and it's something I’ve been thinking more about after seeing how the strategy performs during strong trends (it doesn't 😅).

I love the idea of using a 200 SMA for filtering trend direction and treating RSI differently in trending vs ranging environments. That kind of logic makes way more sense for adapting to market context.

Also, that bar crossover trick (open above, close below) — brilliant. It adds structure without making things overly complicated. I’ll try implementing that next.

And yeah, slope and spacing between RSI bars? That’s next-level — hadn’t really explored it yet, but now I’m curious. Might even write a function to quantify slope over N bars.

Thanks again — feedback like this is exactly why I posted. If you have any example strategies or articles that expand on what you mentioned, I’d love to check them out.
Respect for the respectful tone, by the way 🙌

 
Yashar Seyyedin #:
I believe the RSI filter you are using is a good one. But trying to backtest it for a longer period of time you will realize that market behaviour changes and maybe 30pips as SL/TP could not work always. In fact the choice of SL/TP can put you in an overfit condition which works only for the backtesting period. Generally my take is whatever strategy you use you should use your own insight as a major filter to be applied to all entries that are suggested by the trading system.

Thanks so much for the insight — really appreciated.

You're absolutely right about market behavior changing over time. I’ve already noticed how a strategy that looks decent on one slice of historical data can completely fall apart when extended to a different year or volatility regime.

The point about fixed SL/TP potentially causing overfitting really hits home. I’ll definitely explore more adaptive approaches — maybe based on ATR or even volatility bands to set more dynamic risk/reward levels.

Also, I completely agree about applying personal insight and discretion. I’m starting with automation, but I don’t intend to blindly trust it. I see the algo more as a suggestion engine — something that alerts me to opportunity, and I decide whether to act.

I’m curious — do you personally use any method to help your system "adapt" over time? Or do you rely mainly on experience and screen time to override signals?

 
Ramazan Erdogan #:
I’m curious — do you personally use any method to help your system "adapt" over time? Or do you rely mainly on experience and screen time to override signals?
Not really. The insight is all I can talk about. I mean the trader owns the edge and not the system. 
The alerting system can use many adaptive underlying tools anyway. I cannot name anything as there are too many of them available to talk about. One has to do their own research and test every single one. You cannot really know before you test personally.