Sem MACross

Download script
Author: ������� ������� (�) 2007
Sem MACross

This technical indicator is designed to provide a visual representation of market momentum by tracking the relationship between two moving averages. Its primary goal is to identify shifts in trend direction, making it easier for traders to see when the "mood" of the market might be changing from bullish (rising) to bearish (falling), or vice versa.

How it Works

The logic operates by calculating two different types of averages simultaneously:

  1. A Fast Moving Average: This reacts quickly to recent price changes.
  2. A Slow Moving Average: This tracks the broader price trend over a longer period, smoothing out temporary fluctuations.

By comparing these two lines, the script determines the overall direction of the price movement. Because the "Fast" average is more sensitive, it will often lead the "Slow" average in its movements.

Visual Logic and Signals

Instead of drawing complex lines on your main price chart, this tool creates a dedicated historical histogram in a separate window. It translates the relationship between the two averages into two distinct colors:

  • Bearish Signal (Crimson): When the Fast Moving Average drops below the Slow Moving Average, it suggests that downward pressure is increasing. The script highlights these sections in Crimson to signal a potential sell environment or a weakening trend.
  • Bullish Signal (Lime Green): When the Fast Moving Average rises above the Slow Moving Average, it indicates upward momentum. The script highlights these sections in Lime Green to signal a potential buy environment or a strengthening trend.

Customization Options

The tool is designed with flexibility in mind, allowing you to adjust several key factors to match your specific trading style:

  • Averages Period: You can change the speed of the "Fast" and "Slow" calculations to make the indicator more sensitive (reacting to small price moves) or more conservative (filtering out minor noise).
  • Calculation Mode: You can choose different mathematical methods for the averages (such as Simple, Exponential, Smoothed, or Linear Weighted), which changes how much weight is given to the most recent prices.
  • Price Basis: You can decide whether the indicator should calculate its data based on the closing price, opening price, highs, lows, or a median of these values.

In summary, this script acts as a trend-tracking compass. It simplifies complex price action into a clear, color-coded visual history, helping you identify which way the market is currently leaning at a glance.

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

#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 1
#property indicator_buffers 2
#property indicator_width1 2
#property indicator_width2 2
#property indicator_color1 Crimson
#property indicator_color2 LimeGreen
#property indicator_style1 STYLE_SOLID
#property indicator_style2 STYLE_SOLID

extern int       SlowMA=7;
extern int       FastMA=5;
extern int       Mode=MODE_EMA;//0-sma, 1-ema, 2-smma, 3-lwma
extern int       Price=PRICE_CLOSE;//0-close, 1-open, 2-high, 3-low, 4-median, 5-typic, 6-wieight

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];

int init()
{
	SetIndexStyle(0,DRAW_HISTOGRAM);	SetIndexBuffer(0,ExtMapBuffer1);
	SetIndexStyle(1,DRAW_HISTOGRAM);	SetIndexBuffer(1,ExtMapBuffer2);
	IndicatorShortName("Cross MA ("+SlowMA+","+FastMA+")");
	return(0);
}
int deinit()  { return(0); }

int start()
{
	double s, f;

	for (int i = 0; i < Bars; i++)
	{
		ExtMapBuffer1[i]=0; ExtMapBuffer2[i]=0;
		s=iMA(NULL, 0, SlowMA, 0, Mode, Price, i);
		f=iMA(NULL, 0, FastMA, 0, Mode, Price, i);
		if (f<s) ExtMapBuffer1[i] = 1; //ïðîäàåì
		if (f>s) ExtMapBuffer2[i] = 1; //ïîêóïàåì
	}
	return(0);
}
//+------------------------------------------------------------------+

Comments