RobotFX curates the best open-source MetaTrader code to inspire your trading automation.
VR Rsi Robot is an expert advisor for MetaTrader 5, built on the classic RSI (Relative Strength Index) indicator but utilizing a multi-timeframe approach. The core idea is to filter signals received from the faster timeframe (H1) with confirmation from the higher timeframe (D1). This approach reduces the number of false entries and increases the probability of following a sustained trend. The expert opens positions only when both timeframes present a consistent picture: the RSI exiting overbought or oversold zones accompanied by dynamic confirmation (the indicator rising or falling). 
The conditions for entering a trade are strictly formalized. For a buy, it requires that on H1 and D1, the RSI value (based on the completed candle) is above the oversold level (default 20) and that the current RSI value is greater than the previous one, indicating an upward impulse. For a sell, similarly: the RSI on both timeframes must be below the overbought level (80) and the current value must be less than the previous one, signaling a downward movement. Using completed bars eliminates the redrawing effect, as the signal is formed after the candle finishes forming.
Smooth out market noise with the Heiken Ashi Expert Advisor for MT4 and MT5. Reliable trend-following automation. Details here.
Position management is implemented on a "one position per instrument" basis. The expert monitors for open orders with its magic number. If a buy signal appears while a sell is open, the sell is closed, and a buy is opened. The same logic applies for a sell signal. Thus, the robot is always either out of the market or in a position whose direction aligns with the most recently generated signal.
An important feature is the automatic adjustment of the trading volume according to the broker's requirements. During initialization, the robot rounds the specified lot to the nearest allowable volume step and checks that it is not less than the minimum allowed. This ensures correct operation on any account. Overall, the strategy represents a simple and clear approach to RSI trading, based on confirming signals with a higher timeframe.
Build better strategies with RobotFX professional tools – check them out.
70467