Elliott_Wave_Oscillator_v1

Download script
Author: tonyc2a@yahoo.com
Elliott_Wave_Oscillator_v1

This tool is designed to provide a visual representation of market momentum by highlighting the relationship between short-term price trends and long-term price averages. It functions as a specialized oscillator, appearing in a separate window beneath your main trading chart, making it easier to monitor market cycles without cluttering your primary price view.

How the Logic Works

The script operates by comparing two different types of moving averages simultaneously:

  • The Fast Component: It tracks a very short-term average (based on 5 periods). This represents what the price is doing in the immediate moment.
  • The Slow Component: It tracks a longer-term average (based on 35 periods). This represents the broader, established trend of the market.

By calculating the difference between these two values—subtracting the long-term average from the short-term average—the script produces a numerical "gap."

Visual Representation

The result is displayed as a solid histogram. Here is how to interpret the visual output:

  • Positive Movement: When the histogram rises above the zero line, it indicates that the short-term price momentum is moving faster than the long-term trend (often associated with upward strength).
  • Negative Movement: When the histogram falls below the zero line, it indicates that the short-term price is dropping faster than the long-term average (often associated with downward pressure).
  • Trend Momentum: The height and direction of the histogram bars show you how aggressively the price is deviating from its historical average.

In essence, this tool acts as a "momentum gauge." It helps traders see the speed at which the market is moving relative to its recent history, providing a clearer picture of whether the current price action is accelerating or slowing down.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
10 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