[i]2RSIXover_v03_v1
Download scriptThis tool is designed as a visual trading assistant for the MetaTrader platform. Its primary purpose is to simplify market analysis by automatically identifying specific momentum shifts and displaying them directly on your price chart as clear visual signals.
Core Logic and Mechanism
The indicator operates by monitoring two different types of Relative Strength Index (RSI) values simultaneously. The RSI is a common technical tool used to measure the speed and change of price movements; essentially, it helps traders understand whether a market is "overbought" or "oversold."
To generate signals, the script compares two distinct speeds of this calculation:
- A Fast Calculation: This reacts quickly to recent price changes.
- A Slow Calculation: This provides a broader perspective on the overall trend.
The logic focuses on the "Crossover" effect. Instead of just looking at one value, the script watches for the moment the Fast RSI line crosses over the Slow RSI line.
How the Signals Work
The tool looks for specific directional shifts to tell you when the momentum is changing:
- Buy Signals (Upward Momentum): When the Fast RSI was previously below the Slow RSI but then moves above it, the script identifies a potential upward surge. It automatically places a white arrow below the price candle to notify you of this shift.
- Sell Signals (Downward Momentum): Conversely, when the Fast RSI was previously above the Slow RSI but then drops below it, the script identifies a potential downward turn. It automatically places a red arrow above the price candle to alert you of this move.
User Experience
For the trader, this means you don't have to manually plot and watch multiple lines on a sub-window. The script does the heavy lifting by calculating these intersections in the background and translating them into immediate visual cues on your main chart. By highlighting these crossovers, the tool helps you spot potential entry or exit points where short-term momentum is beginning to break away from the longer-term trend.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+------------------------------------------------------------------+
//| 5 Min RSI cross-over INDICATOR |
//+------------------------------------------------------------------+
#property copyright "Ron Thompson"
#property link "http://www.lightpatch.com"
#property indicator_chart_window
#property indicator_buffers 2
// buy sell indicators
#property indicator_color1 White
#property indicator_color2 Red
//---- buffers
double Buffer1[]; //White
double Buffer2[]; //Red
extern int RSISlow=14;
extern int RSIFast=7;
extern int RSIType=1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//|------------------------------------------------------------------|
int init()
{
// 233 up arrow
// 234 down arrow
// 159 big dot
SetIndexStyle(0,DRAW_ARROW);
SetIndexBuffer(0, Buffer1);
SetIndexArrow(0,233); //white up
SetIndexStyle(1,DRAW_ARROW);
SetIndexBuffer(1, Buffer2);
SetIndexArrow(1,234); // red down
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
int i;
for( i=0; i<Bars; i++ ) Buffer1[i]=0;
for( i=0; i<Bars; i++ ) Buffer2[i]=0;
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int pos=Bars-100; // leave room for moving average periods
int ctr=0;
double p=Point();
double pRSI4=0, RSI4=0;
double pRSI7=0, RSI7=0;
while(pos>=1)
{
// RSI for Crossover
if(RSIType==1)
{
RSI4=iRSI(Symbol(),0,RSIFast,RSIType,pos+0);
pRSI4=iRSI(Symbol(),0,RSIFast,RSIType,pos+1);
RSI7=iRSI(Symbol(),0,RSISlow,RSIType,pos+0);
pRSI7=iRSI(Symbol(),0,RSISlow,RSIType,pos+1);
}
else
{
RSI4=iRSI(Symbol(),0,RSIFast,RSIType,pos+1);
pRSI4=iRSI(Symbol(),0,RSIFast,RSIType,pos+2);
RSI7=iRSI(Symbol(),0,RSISlow,RSIType,pos+1);
pRSI7=iRSI(Symbol(),0,RSISlow,RSIType,pos+2);
}
// Determine if there was a cross
if(pRSI4<pRSI7 && RSI4>RSI7) {Buffer1[pos]= Low[pos]-(2*p);} // up arrow on bottom
if(pRSI4>pRSI7 && RSI4<RSI7) {Buffer2[pos]=High[pos]+(2*p);} // down arrow on top
pos--;
}
return(0);
}
//+------------------------------------------------------------------+
Comments