TrendRSI_v1

Download script
Author: Copyright � 2005, TrendLaboratory Ltd.
TrendRSI_v1

The TrendRSI tool is a specialized visual aid designed to help traders identify momentum and the prevailing direction of a market trend by combining three distinct layers of data into a single window. Rather than looking at raw price action alone, this script smooths out market "noise" to provide a clearer picture of whether the market is gaining strength or losing steam.

How the Logic Works

The tool functions by creating a multi-layered analysis based on three primary components:

1. The Core Momentum (RSI) At its foundation, the tool tracks the Relative Strength Index (RSI). This is a standard financial metric used to measure the speed and change of price movements. It helps identify whether an asset is being bought or sold aggressively. In this script, it serves as the "raw material" from which all other data is derived.

2. The Fast Trend Filter (MARSI Fast) To make the momentum data more readable, the script applies a "Moving Average" to the RSI itself. By using a fast-moving average, the tool calculates a responsive line that follows the immediate changes in market sentiment. This allows traders to see short-term shifts in momentum quickly, smoothing out minor fluctuations while still reacting to recent price action.

3. The Slow Trend Filter (MARSI Slow) In addition to the fast filter, the script applies a second, much slower moving average to the RSI data. This creates a broader trend line that represents the "big picture" sentiment. By comparing this slow line against the fast line and the base RSI, traders can better distinguish between a temporary price spike and a sustained long-term trend change.

Summary of Visual Output

When you view this indicator on your chart, you are seeing three lines working in harmony:

  • The Base Line: The fundamental strength of the market movement.
  • The Fast Line: A smoothed version reflecting recent momentum.
  • The Slow Line: A long-term trend line used to identify major shifts in direction.

By observing where these three lines intersect and how they move in relation to one another, traders can more easily spot potential trend reversals and confirm the strength of current market movements without being distracted by insignificant price "wiggles."

Indicators Used
Relative strength indexMoving average indicator
Miscellaneous
Implements a curve of type %1
12 Views
0 Downloads
0 Favorites
TrendRSI_v1
//+------------------------------------------------------------------+
//|                                                   TrendRSI_v1.mq4 |
//|                           Copyright © 2005, TrendLaboratory Ltd. |
//|                                       E-mail: igorad2004@list.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, TrendLaboratory Ltd."
#property link      "E-mail: igorad2004@list.ru"

#property indicator_separate_window
#property indicator_minimum 20
#property indicator_maximum 80
#property indicator_buffers 3
#property indicator_color1 Orange
#property indicator_color2 SkyBlue
#property indicator_color3 Magenta
//---- input parameters
extern int PeriodRSI    = 14;
extern int PeriodMAFast =  9;
extern int PeriodMASlow = 45;
//---- indicator buffers
double Line1Buffer[];
double Line2Buffer[];
double Line3Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
   string short_name;

   //---- indicator line
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1);
   SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,1);
   SetIndexBuffer(0,Line1Buffer);
   SetIndexBuffer(1,Line2Buffer);
   SetIndexBuffer(2,Line3Buffer);
   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));

   //---- name for DataWindow and indicator subwindow label
   short_name="TrendRSI("+PeriodRSI+","+PeriodMAFast+","+PeriodMASlow+")";
   IndicatorShortName(short_name);
   SetIndexLabel(0,"RSI");
   SetIndexLabel(1,"MARSI fast");
   SetIndexLabel(2,"MARSI slow");

   //----
   SetIndexDrawBegin(0,PeriodRSI);
   SetIndexDrawBegin(1,PeriodMAFast);
   SetIndexDrawBegin(2,PeriodMASlow);

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

//+------------------------------------------------------------------+
//| TrendRSI_v1                                                         |
//+------------------------------------------------------------------+
int start()
{
   int shift;

   for (shift = 0; shift < Bars; shift++)
   {
      Line1Buffer[shift] = iRSI(NULL, 0, PeriodRSI, PRICE_CLOSE, shift);
   }

   for (shift = 0; shift <= Bars - PeriodMASlow; shift++)
   {
      Line2Buffer[shift] = iMAOnArray(Line1Buffer, 0, PeriodMAFast, 0, MODE_SMA, shift);
      Line3Buffer[shift] = iMAOnArray(Line1Buffer, 0, PeriodMASlow, 0, MODE_EMA, shift);
   }
   return(0);
}

Comments