Candle MA Short_

Download script
Author: 2008 candlexu
Candle MA Short_

This tool is designed to enhance your trading charts by providing a visual representation of price momentum through a specialized moving average system. Instead of showing you just one line, it creates a multi-layered view of the market's short-term trends, allowing you to see how different price averages interact with one another in real time.

Core Functionality

The logic operates by calculating three distinct "Exponential Moving Averages" (EMA). These are smoothed versions of the market price that prioritize more recent data over older data, making them highly responsive to current market fluctuations. By using three specific periods (10, 13, and 15), the tool captures a very tight cluster of short-term activity.

How it Visualizes Trends

The script does more than just draw lines; it filters the information to highlight "active" movement:

  • Trend Identification: It tracks three primary moving average lines. These serve as the foundation for identifying whether the price is currently trending upwards or downwards.
  • Dynamic Filtering: The tool includes a logic layer that distinguishes between rising and falling trends. It specifically monitors the direction of the averages: if an average is currently climbing higher than it was in the previous period, the line remains visible.
  • Visual Clarity: By applying this filter, the tool helps to "clean up" the chart. It focuses on showing you active price growth, helping traders distinguish between a sustained upward push and periods where the momentum is flat or declining.

Practical Use

For a trader, this means the visual output emphasizes the strongest active movements. When these multiple lines move in harmony and show upward progression, it provides a clearer picture of short-term bullish momentum. The use of alternating colors helps you quickly distinguish between the different time layers (10, 13, and 15), making it easier to spot when the market is accelerating or consolidating.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
11 Views
0 Downloads
0 Favorites
Candle MA Short_
//+------------------------------------------------------------------+
//|                  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_10=  10;
extern int short_13=  13;
extern int short_15=  15;

//---- 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_10,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer2[i]=iMA(NULL,0,short_13,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer3[i]=iMA(NULL,0,short_15,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