[i]2RSIXover_v1

Download script
Author: Ron Thompson
[i]2RSIXover_v1

This tool is designed to help traders identify potential turning points in the market by analyzing momentum through a technique called a "Relative Strength Index (RSI) Crossover." Rather than looking at raw price action alone, this script evaluates the speed and change of price movements to pinpoint specific moments where the market sentiment may be shifting.

How the Logic Works

The script operates by monitoring two different versions of the RSI—a "fast" version and a "slow" version—simultaneously. By comparing these two indicators, the tool looks for specific intersection points:

  • The Fast Indicator: This reacts more quickly to recent price changes, making it sensitive to immediate market shifts.
  • The Slow Indicator: This tracks broader price trends over a slightly longer period, providing a smoother view of the overall momentum.

Identifying Market Signals

The primary goal of the script is to detect when these two indicators cross paths on your chart. These "cross-overs" serve as visual cues for potential trend reversals:

  • Bullish Signals (Upward Momentum): When the fast indicator moves from below the slow indicator to above it, the script places a white upward arrow on the chart. This suggests that short-term momentum is accelerating faster than the broader trend, potentially indicating a move toward higher prices.
  • Bearish Signals (Downward Momentum): Conversely, when the fast indicator drops from above the slow indicator to below it, the script places a red downward arrow. This suggests that short-term momentum is weakening relative to the broader trend, potentially signaling a move toward lower prices.

Visual Presentation

To keep your trading workspace clean and actionable, the script automatically places these signals directly on your price candles:

  • Upward Arrows: Positioned slightly above the high of a candle to signal a potential buy opportunity.
  • Downward Arrows: Positioned slightly below the low of a candle to signal a potential sell opportunity.

By automating this comparison, the script allows you to filter out market noise and focus on the specific moments where momentum shifts are most likely to occur.

Price Data Components
Indicators Used
Relative strength index
Miscellaneous
Implements a curve of type %1
8 Views
0 Downloads
0 Favorites
[i]2RSIXover_v1
/*-----------------------------+
|			       |
| 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

#property indicator_color1 White
#property indicator_color2 Red

//---- buffers
double Buffer1[];
double Buffer2[];

extern int    RSISlow=4;
extern int    RSIFast=7;
extern int    RSIType=6;



//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//|------------------------------------------------------------------|

int init()
  {

   // 233 up arrow
   // 234 down arrow
   // 159 big dot
   // 158 little dot
   // 168 open square
   // 120 box with X
   
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexBuffer(0, Buffer1);
   SetIndexArrow(0,233);  //white up
   
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexBuffer(1, Buffer2);
   SetIndexArrow(1,234);  // red down

   return(0);
  }


//+------------------------------------------------------------------+
//| 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;

   return(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)
     {
      // 2-period moving average on Bar[2]
       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]=High[pos]+(2*p);}
      if(pRSI4>pRSI7 && RSI4<RSI7) {Buffer2[pos]=Low[pos] -(2*p);}
   
 	   pos--;
     }

   return(0);
  }
//+------------------------------------------------------------------+

Comments