Author: Copyright � 2005-2006, David W. Thomas
EWO

This tool is designed to provide traders with a visual representation of momentum and trend direction by analyzing the relationship between short-term and long-term price movements. Instead of looking at raw price data, which can often be "noisy" and distracting, this indicator simplifies market behavior into a single moving line.

How the Logic Works

The core functionality of the script relies on comparing two different types of "moving averages"—mathematical calculations that smooth out price fluctuations to reveal underlying trends:

  • Short-Term Trend: The script tracks a very fast-moving average (covering the last 5 periods). This represents the immediate, current direction of the market.
  • Long-Term Trend: The script tracks a much slower-moving average (covering the last 35 periods). This represents the broader, established trend of the market.

Interpreting the Results

The indicator calculates the mathematical difference between these two averages and displays it in a separate window on your chart. Here is how to read the logic:

  • Positive Values (Above the Zero Line): When the indicator shows a positive value, it means the short-term price momentum is higher than the long-term average. This suggests that the market is currently experiencing upward pressure or a bullish trend.
  • Negative Values (Below the Zero Line): When the indicator shows a negative value, it means the short-term price momentum has fallen below the long-term average. This suggests that the market is experiencing downward pressure or a bearish trend.

Summary for Traders

By using this logic, you can quickly identify whether the current "pulse" of the market is moving faster than its historical pace. It helps filter out minor fluctuations so you can see if the immediate price action is aligning with or diverging from the broader market direction.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
21 Views
0 Downloads
0 Favorites
EWO
//+------------------------------------------------------------------+
//|                                                          EWO.mq4 |
//|                                Copyright © 2005-2006, David W. Thomas |
//|                                           http://www.davidwt.com |
//+------------------------------------------------------------------+
// Elliott Wave Oscillator
#property copyright "Copyright © 2005-2006, David W. Thomas"
#property link      "http://www.davidwt.com"

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Sienna

//---- buffers
double EWOBuffer[];

//---- variables
int indexbegin = 0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
	SetIndexStyle(0, DRAW_LINE);
	SetIndexBuffer(0, EWOBuffer);
	SetIndexLabel(0, "EWO");
//----
   IndicatorShortName("EWO");

	indexbegin = Bars - 35;
	if (indexbegin < 0)
		indexbegin = 0;

	return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
{
	return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
   int i;
	int counted_bars = IndicatorCounted();

	//---- check for possible errors
	if (counted_bars < 0) counted_bars = 0;
	//---- last counted bar will be recounted
	if (counted_bars > 0) counted_bars--;
	if (counted_bars > indexbegin) counted_bars = indexbegin;

	for (i = 0; i < indexbegin-counted_bars; i++)
	{
		//! compute EWO for the current bar.  If EWO is > 0, then the 5SMA is above
		//! the 35SMA.  If EWO < 0, then the 5SMA is below the 35SMA.
		EWOBuffer[i] = iMA(NULL, 0, 5, 0, MODE_SMA, PRICE_MEDIAN, i) - iMA(NULL, 0, 35, 0, MODE_SMA, PRICE_MEDIAN, i);
	}
	
	return(0);
}
//+------------------------------------------------------------------+

Comments