The-Wave
Download scriptThis tool is designed to provide a visual representation of market trends by smoothing out the "noise" of price fluctuations. Instead of looking at every individual tick or candle, it calculates three distinct moving averages to help traders identify the underlying direction and momentum of the market.
How the Logic Works
The script functions by calculating three separate data streams based on a user-defined period (defaulting to 34). It processes these streams simultaneously to create a comprehensive view of the price action:
- High Price Tracking: One layer follows the highest point reached during each period. This helps in identifying the upper boundaries of current market movement.
- Close Price Tracking: The central layer follows the actual closing price of the candles. This is often used to identify the "fair" value or the consensus price at which the market settled.
- Low Price Tracking: The final layer follows the lowest point reached during each period, helping to define the lower boundaries of the market's range.
Key Features
- Customizable Sensitivity: Users can adjust the "WavePeriod" to change how many previous bars are taken into account. A larger period will result in smoother, slower-moving lines (ideal for long-term trends), while a smaller period will react more quickly to sudden price changes.
- Method Versatility: The script allows for different calculation methods (such as Simple or Exponential smoothing) to determine how much weight is given to recent data versus older data.
- Multi-Timeframe Analysis: While it primarily operates on the current chart, the logic is structured to allow for consistent data processing across various timeframes.
Summary for Traders
By plotting these three specific lines—High, Close, and Low—the indicator creates a visual "envelope" or "wave." When these lines move in unison, they indicate strong trend direction. The distance between the High and Low lines provides a quick visual reference for market volatility, while the position of the Close line relative to the others helps show where the current price strength is leaning.
//+------------------------------------------------------------------+
//| The-Wave.mq4 |
//| "The Wave" indicator :) |
//| Copyright c 2008 codobro |
//+------------------------------------------------------------------+
#property copyright "Copyright c 2008, codobro"
#property link "http://www.metaquotes.net"
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Aqua
#property indicator_color2 Aqua
#property indicator_color3 Aqua
extern int WavePeriod = 34;
extern int Method = 1;
extern int TimeFrame = 0;
double W1[];
double W2[];
double W3[];
//+-----
int init()
{
//---- indicators
IndicatorBuffers(3);
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(0,W1);
SetIndexBuffer(1,W2);
SetIndexBuffer(2,W3);
//---
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit,i;
int counted_bars=IndicatorCounted();
//--last bar will be recounted;
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(i=0; i<limit; i++)
W1[i]=iMA(NULL,TimeFrame,WavePeriod,0,Method,PRICE_HIGH,i);
for(i=0; i<limit; i++)
W2[i]=iMA(NULL,TimeFrame,WavePeriod,0,Method,PRICE_CLOSE,i);
for(i=0; i<limit; i++)
W3[i]=iMA(NULL,TimeFrame,WavePeriod,0,Method,PRICE_LOW,i);
//----
return(0);
}
//+------------------------------------------------------------------+
Comments