Candle MA Short
Download scriptThis tool is designed for the MetaTrader trading platform to help visual market trends by identifying short-term price momentum. It utilizes a variation of the "Guppy Multiple Moving Average" concept, specifically tuned to track very fast price movements.
Core Functionality
The script analyzes the market by calculating three distinct Exponential Moving Averages (EMAs). Unlike simple averages, these "exponential" versions give more importance to recent price data, allowing the indicator to react quickly to sudden changes in the market. The three specific periods monitored are:
- 3-period average (Ultra-fast)
- 5-period average (Fast)
- 8-period average (Short-term trend)
Visual Logic and Dynamics
The indicator does not just display a static line for these averages. Instead, it employs a "directional" logic to clean up the visual chart and highlight active movement:
- Trend Validation: The script continuously compares the current value of each average against its previous value.
- Dynamic Visibility: A line will only appear on your chart if the moving average is currently trending upward (moving from a lower value to a higher one).
- Momentum Filtering: If the moving average plateaus or begins to move downward, the corresponding line disappears from the chart.
How to Interpret the Results
Because the lines only show when they are ascending, they act as a visual "green light" for upward momentum. By observing these three lines simultaneously:
- Confluence: When all three lines are visible at once, it suggests strong, synchronized upward momentum across different time scales.
- Trend Strength: The presence of the shortest line (3-period) indicates immediate price action, while the 8-period line confirms the broader short-term trend.
- Visual Clarity: By hiding the lines when they turn downward, the tool helps remove "noise" from your chart, allowing you to focus exclusively on active price climbs.
//+------------------------------------------------------------------+
//| Guppy Mulitple Moving Average (Short double).mq4|
//| candlexu@163.Com|
//| |
//+------------------------------------------------------------------+
#property copyright "2008 candlexu"
#property indicator_chart_window
//#property indicator_separate_window
#property indicator_buffers 6
#property indicator_color1 Yellow//Magenta
#property indicator_color2 Magenta
#property indicator_color3 Yellow
#property indicator_color4 Magenta
#property indicator_color5 Yellow
#property indicator_color6 Magenta
extern int short_3= 3;
extern int short_5= 5;
extern int short_8= 8;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer1_1[];
double ExtMapBuffer2[];
double ExtMapBuffer2_2[];
double ExtMapBuffer3[];
double ExtMapBuffer3_3[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer1_1);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,ExtMapBuffer2);
SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(3,ExtMapBuffer2_2);
SetIndexStyle(4,DRAW_LINE);
SetIndexBuffer(4,ExtMapBuffer3);
SetIndexStyle(5,DRAW_LINE);
SetIndexBuffer(5,ExtMapBuffer3_3);
//----
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,short_3,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer2[i]=iMA(NULL,0,short_5,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer3[i]=iMA(NULL,0,short_8,0,MODE_EMA,PRICE_CLOSE,i);
}
for(j = Bars-counted_bars-1;j>=0;j--)
{
if(ExtMapBuffer1[j]>ExtMapBuffer1[j+1]) ExtMapBuffer1_1[j]=ExtMapBuffer1[j]; else ExtMapBuffer1_1[j]=EMPTY_VALUE;
if(ExtMapBuffer2[j]>ExtMapBuffer2[j+1]) ExtMapBuffer2_2[j]=ExtMapBuffer2[j]; else ExtMapBuffer2_2[j]=EMPTY_VALUE;
if(ExtMapBuffer3[j]>ExtMapBuffer3[j+1]) ExtMapBuffer3_3[j]=ExtMapBuffer3[j]; else ExtMapBuffer3_3[j]=EMPTY_VALUE;
}
return(0);
}
//+------------------------------------------------------------------+
Comments