Tipama

This technical tool is designed to help traders visualize market momentum and identify potential trends by analyzing the relationship between two different moving averages. Instead of looking at raw price action, this script processes the data to highlight the "speed" and "direction" of the market's movement.

Core Logic and Components

The indicator operates using three distinct layers of calculation:

1. The Primary Momentum (MACD Line) The tool begins by tracking two different types of moving averages—one that reacts quickly to price changes (Fast EMA) and one that follows the broader trend more slowly (Slow EMA). By subtracting the slow average from the fast average, the script calculates the "gap" between them. This gap represents the current momentum: if the fast average is significantly higher than the slow one, it suggests upward strength; if it falls below, it suggests downward pressure.

2. The Smoothing Filter (Signal Line) To prevent traders from reacting to minor, insignificant price flickers, the script takes the result of the first calculation and applies a second layer of smoothing (a Simple Moving Average). This "Signal Line" acts as a stabilizer, showing the average direction of the momentum over a specific period. It helps in identifying whether the current momentum is accelerating or decelerating.

3. The Visual Momentum Tracker (Histogram) The final component is the Histogram, which provides a clear visual representation of the difference between the Primary Momentum and the Smoothing Filter.

  • When the histogram bars move above the zero line, it indicates that upward momentum is currently stronger than the smoothed average.
  • When the bars dip below the zero line, it suggests that downward momentum is taking precedence.

Summary for the Trader

Essentially, this script translates complex price movements into a simplified visual guide. It allows you to see not just where the price is going, but how fast and with what intensity it is moving there. By observing the relationship between these three elements, users can better identify trend shifts, potential overextended movements, and periods of market consolidation.

Indicators Used
Moving average indicatorMoving average indicator
Miscellaneous
Implements a curve of type %1
14 Views
0 Downloads
0 Favorites
Tipama
//---- indicator settings
#property  indicator_separate_window
#property  indicator_buffers 3
#property  indicator_color1  Silver
#property  indicator_color2  Red
#property  indicator_color3  Blue
#property  indicator_width1  2
//---- indicator parameters
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
//---- indicator buffers
double     MacdBuffer[];
double     SignalBuffer[];
double     HistoBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- drawing settings
   SetIndexStyle(0,DRAW_NONE);
   SetIndexStyle(1,DRAW_NONE);
   SetIndexStyle(2,DRAW_HISTOGRAM,EMPTY,3);
   SetIndexDrawBegin(1,SignalSMA);
   IndicatorDigits(Digits+1);
//---- indicator buffers mapping
   SetIndexBuffer(0,MacdBuffer);
   SetIndexBuffer(1,SignalBuffer);
   SetIndexBuffer(2,HistoBuffer);
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("MACD("+FastEMA+","+SlowEMA+","+SignalSMA+")    !! :)");
   SetIndexLabel(0,"MACD YO");
   SetIndexLabel(1,"Signal YO");
   SetIndexLabel(2,"H I S T O :):)");
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence                           |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//---- macd counted in the 1-st buffer
   for(int i=0; i<limit; i++)
      MacdBuffer[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
//---- signal line counted in the 2-nd buffer
   for(i=0; i<limit; i++)
      SignalBuffer[i]=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,i);
//---- histogram line counted in the 3-nd buffer
   for(i=0; i<limit; i++)
      HistoBuffer[i]=MacdBuffer[i]-SignalBuffer[i];
//---- done
   return(0);
  }
//+------------------------------------------------------------------+

Comments