Elliott Wave Oscillator_v1

Download script
Author: tonyc2a@yahoo.com
Elliott Wave Oscillator_v1

This tool is designed as a visual aid for traders who want to identify momentum shifts and price trends through an oscillator. Rather than plotting directly on the main price chart, it appears in a separate window at the bottom of your screen, providing a simplified view of market "energy."

How the Logic Works

The script operates by comparing two different types of moving averages simultaneously to calculate a difference in momentum. Here is the step-by-step breakdown of that logic:

  • Short-Term Momentum (The 5-Period Average): The script tracks a very fast-moving average that covers only the last 5 price bars. This represents the immediate, short-term direction of the market.
  • Long-Term Trend (The 35-Period Average): Simultaneously, it tracks a much slower moving average covering 35 price bars. This represents the broader, underlying trend of the market.
  • The Calculation: The tool subtracts the long-term average from the short-term average at every point on the chart.

What the Visual Representation Means

The resulting data is displayed as a histogram (a series of vertical bars). Because it represents the difference between these two averages, the behavior of the bars tells a story:

  1. Positive Values: When the histogram bars are above the zero line, it indicates that the short-term price momentum is currently stronger than the long-term trend (often suggesting bullish strength).
  2. Negative Values: When the bars drop below the zero line, it indicates that the short-term price is lagging behind or falling away from the long-term average (often suggesting bearish pressure).
  3. Trend Strength: The height of the bars illustrates the "gap" between the immediate price action and the broader trend. Expanding bars suggest accelerating momentum, while shrinking bars toward the zero line suggest that the current move may be losing steam.

In essence, this script acts as a "speedometer" for the market, highlighting whether the current price movement is gaining strength or beginning to exhaust itself relative to its recent history.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
14 Views
0 Downloads
0 Favorites
Elliott Wave Oscillator_v1
//+------------------------------------------------------------------+
//|                                      Elliott Wave Oscillator.mq4 |
//|                                                tonyc2a@yahoo.com |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "tonyc2a@yahoo.com"
#property link      ""

#property indicator_separate_window
#property indicator_color1 DarkKhaki

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

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexBuffer(0,Buffer1);
   SetIndexLabel(0,"EWO");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   double MA5,MA35;
//---- TODO: add your code here
   for(int i=Bars;i>=0;i--){
      MA5=iMA(NULL,0,5,0,MODE_SMA,PRICE_MEDIAN,i);
      MA35=iMA(NULL,0,35,0,MODE_SMA,PRICE_MEDIAN,i);
      
      Buffer1[i]=MA5-MA35;
      }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments