Sem MACD+RVI

Download script
Author: ������� ������� (�) 2007
Sem MACD+RVI

This technical indicator is designed to provide visual market analysis by combining two distinct momentum-based mathematical models into a single, easy-to-read histogram. Instead of forcing traders to look at multiple separate windows, this script consolidates the data to highlight the relationship between trend strength and price momentum.

Core Logic and Methodology

The tool operates by pulling data from two primary sources: the MACD (Moving Average Convergence Divergence) and the RVI (Relative Vigor Index).

  1. MACD Component: This tracks the relationship between two different moving averages (a fast one and a slow one). It helps identify whether the short-term price direction is accelerating faster than the long-term trend, essentially showing "momentum."
  2. RVI Component: This acts as a secondary filter that measures the "vigor" or strength of price movement. It evaluates how much power is behind a price move by looking at the relationship between the highs and lows of the candles.

How it Visualizes Information

The script processes these two indicators simultaneously for every point on the chart and categorizes the market's behavior into four specific scenarios based on whether the signals are in agreement or in conflict:

  • Strong Bearish Alignment: When both the MACD and the RVI indicate downward momentum, the indicator highlights a clear bearish trend.
  • Bearish Momentum with Bullish Vigor: When the MACD shows a downward trend but the RVI suggests underlying strength (or vice versa), the indicator identifies a potential conflict or transition in the market sentiment.
  • Strong Bullish Alignment: When both indicators confirm upward momentum, the indicator signals a strong bullish environment.
  • Bullish Momentum with Bearish Vigor: Similar to the second scenario, this identifies moments where the price might be moving up, but the underlying "vigor" of the move is weakening or showing signs of reversal.

Practical Use for the User

The final result is a four-bar histogram. By observing which bar is active at any given moment, a trader can quickly determine if the current market movement is being supported by both indicators (confluence) or if there is a divergence between momentum and strength. This allows for a more nuanced view of the market, helping to identify potential trend continuations or early warning signs of exhaustion.

Indicators Used
MACD HistogramRelative Vigor index
Miscellaneous
Implements a curve of type %1
13 Views
0 Downloads
0 Favorites
Sem MACD+RVI
//+------------------------------------------------------------------+
//|                                  Áîëüøàÿ Êîëëåêöèÿ Ñåìàôîðîâ.mq4 |
//+------------------------------------------------------------------+
#property copyright "Ñåðãååâ Àëåêñåé (ñ) 2007"

#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 1
#property indicator_buffers 4
#property indicator_color1 Crimson
#property indicator_color2 Crimson
#property indicator_color3 LimeGreen
#property indicator_color4 LimeGreen
#property indicator_width1 2
#property indicator_width2 1
#property indicator_width3 2
#property indicator_width4 1
#property indicator_style1 STYLE_SOLID
#property indicator_style2 STYLE_SOLID
#property indicator_style3 STYLE_SOLID
#property indicator_style4 STYLE_SOLID

extern int       FastEMA=8;
extern int       SlowEMA=12;
extern int       SignalMA=3;
extern int       Price=PRICE_CLOSE;//0-close, 1-open, 2-high, 3-low, 4-median, 5-typic, 6-wieight

double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];

int init()
{
  SetIndexStyle(0,DRAW_HISTOGRAM); SetIndexBuffer(0,ExtMapBuffer1);
  SetIndexStyle(1,DRAW_HISTOGRAM); SetIndexBuffer(1,ExtMapBuffer2);
  SetIndexStyle(2,DRAW_HISTOGRAM); SetIndexBuffer(2,ExtMapBuffer3);
  SetIndexStyle(3,DRAW_HISTOGRAM); SetIndexBuffer(3,ExtMapBuffer4);
	IndicatorShortName("MACD+RVI");
	return(0);
}

int deinit(){   return(0);  }

int start()
{
	int i;
	double macdS, macdM, rviM, rviS;
 	for ( i=0; i<=Bars-1; i++ )
	{
   	ExtMapBuffer1[i]=0; ExtMapBuffer2[i]=0; ExtMapBuffer3[i]=0; ExtMapBuffer4[i]=0;
   
		macdM=iMACD(NULL,0, FastEMA, SlowEMA, SignalMA, Price, MODE_MAIN, i);
		macdS=iMACD(NULL,0, FastEMA, SlowEMA, SignalMA, Price, MODE_SIGNAL, i);
   
   	rviM = iRVI(NULL,0,10,MODE_MAIN,i);
   	rviS = iRVI(NULL,0,10,MODE_SIGNAL,i);
   
   	if (macdM<macdS && rviM<rviS) ExtMapBuffer1[i] = 1;
   	if (macdM<macdS && rviM>rviS) ExtMapBuffer2[i] = 1;
   	if (macdM>macdS && rviM>rviS) ExtMapBuffer3[i] = 1;
   	if (macdM>macdS && rviM<rviS) ExtMapBuffer4[i] = 1;
   }
	return(0);
}
//+------------------------------------------------------------------+

Comments