Code Library / RSI Strategies
MQL4 RSI Pullback Entry
Trade RSI pullbacks to 50 level during a trend.
Language: MQL4 · Category: RSI Strategies · Tags: RSI, pullback, trend trading, MQL4, entry signal
Source code
int DetectPullback() {
double rsi0=iRSI(Symbol(),0,14,PRICE_CLOSE,0);
double rsi1=iRSI(Symbol(),0,14,PRICE_CLOSE,1);
double ma=iMA(Symbol(),0,50,0,MODE_EMA,PRICE_CLOSE,0);
if(Close[0]>ma&&rsi1<50&&rsi0>=50) return 1;
if(Close[0]<ma&&rsi1>50&&rsi0<=50) return -1;
return 0;
}How to use this snippet
This is a building block, not a finished trading system. Paste it into your own MQL4 project, compile it, and test it on a demo account with your broker's real spreads before relying on it. If MetaEditor reports errors, the compilation error fixer can help.