This script functions as a visual analysis tool designed to help traders identify long-term market trends by layering multiple price averages onto a single chart. Instead of relying on a single moving average, which can sometimes provide a misleading view of market momentum, this tool utilizes a "bundle" of six different averages to create a clearer picture of the prevailing sentiment.
How the Logic Works
The core logic of this script is based on calculating Exponential Moving Averages (EMAs) across six specific timeframes simultaneously. Unlike simple averages, these exponential calculations give more weight to recent price action, allowing the tool to react more fluidly to new market information while still maintaining a connection to historical data.
The script processes the following six specific intervals:
- 30 periods
- 35 periods
- 40 periods
- 45 periods
- 50 periods
- 60 periods
Visual Interpretation
By plotting these six averages as distinct lines on your chart, the script allows you to observe the "flow" of the market:
- Trend Identification: When these lines move in a synchronized direction (all sloping upward or all sloping downward), it signals a strong, established trend.
- Momentum Analysis: Because the periods are clustered closely together (ranging from 30 to 60), the proximity of the lines indicates the strength of the trend. When the lines are tightly grouped and moving in unison, it suggests high confidence in the current price direction.
- Support and Resistance: These averages act as dynamic "floors" or "ceilings." In a healthy uptrend, these lines often serve as zones where the price may bounce upward; in a downtrend, they can act as barriers that the price struggles to break through.
Summary for the User
Essentially, this tool acts as a multi-layered filter for market noise. By viewing all six of these calculated averages at once, you can better distinguish between minor price fluctuations and significant shifts in the overarching market direction, helping you identify "Long" opportunities where the collective trend shows clear upward momentum.
//+------------------------------------------------------------------+
//| Guppy Mulitple Moving Average (Long).mq4 |
//| Code written by - Matt Trigwell |
//| |
//+------------------------------------------------------------------+
// ***** INSTRUCTIONS *****
// Add the GMMA Short indicator and the GMMA Long indicator to your charts.
// This is the GMMA Long indicator
// ***** For information on how to use this fantastic indicator *****
// http://www.guppytraders.com/
// http://www.market-analyst.com/kb/article.php/Guppy_Multiple_Moving_Average
// http://tradermike.net/2004/05/another_look_at_multiple_moving_averages
#property copyright "Code written by - Matt Trigwell"
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 Blue
#property indicator_color2 Blue
#property indicator_color3 Blue
#property indicator_color4 Blue
#property indicator_color5 Blue
#property indicator_color6 Blue
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
double ExtMapBuffer6[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexStyle(4,DRAW_LINE);
SetIndexBuffer(4,ExtMapBuffer5);
SetIndexStyle(5,DRAW_LINE);
SetIndexBuffer(5,ExtMapBuffer6);
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int i,j,limit,counted_bars=IndicatorCounted();
//----
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//----
for(i=0; i<limit; i++)
{
ExtMapBuffer1[i]=iMA(NULL,0,30,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer2[i]=iMA(NULL,0,35,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer3[i]=iMA(NULL,0,40,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer4[i]=iMA(NULL,0,45,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer5[i]=iMA(NULL,0,50,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer6[i]=iMA(NULL,0,60,0,MODE_EMA,PRICE_CLOSE,i);
}
return(0);
}
//+------------------------------------------------------------------+
Comments