MTFPI-sub2
Download scriptThis tool is a custom financial indicator designed for the MetaTrader platform to help traders identify specific momentum shifts in the market. It functions as a specialized variation of the Moving Average Convergence Divergence (MACD), providing a unique way to visualize price velocity.
How it Works
The logic behind this script involves three distinct layers of data processing:
- Trend Analysis: The tool first looks at two different types of moving averages—a "Fast" average and a "Slow" average. These represent the short-term and long-term trends of the market price, respectively. By comparing these two, the script determines the overall direction and strength of the price movement.
- Momentum Calculation: It calculates the difference between these two averages to create a standard MACD value. This represents the "momentum" of the asset.
- Rate of Change (The Unique Logic): Unlike a standard MACD, which simply shows the distance between moving averages, this specific script calculates the change in momentum from one candle to the next. It subtracts the previous bar's momentum value from the current bar's momentum value.
What This Means for the Trader
Instead of showing you where the price is relative to its average, this indicator highlights the acceleration.
By looking at the resulting values, a trader can see not just if the market is moving up or down, but whether that movement is speeding up, slowing down, or reversing. It acts as a "speedometer" for market trends, making it easier to spot the exact moment when a trend begins to lose steam or gain significant power before the price actually makes a major turn.
//KurlFX 2009.01.31
//+------------------------------------------------------------------+
//| *** MTFPI-sub2 *** dMACD |
//+------------------------------------------------------------------+
#property copyright "Copyright (c) 2009,Kurl FX"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue
#property indicator_level1 0.0
double dMACD[];
extern int FastEMA = 5;
extern int SlowEMA = 100;
extern int SignalSMA = 3;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0,dMACD);
string label="dMACD("+FastEMA+","+SlowEMA+","+SignalSMA+")";
IndicatorShortName(label);
SetIndexLabel(0,"dMACD");
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bar=IndicatorCounted();
int limit=Bars-counted_bar;
if(counted_bar==0)limit-=SlowEMA+SignalSMA-1;
for(int i=limit-1; i>=0; i--)
{
dMACD[i]=iMACD(NULL,0,FastEMA,SlowEMA,SignalSMA,PRICE_CLOSE,MODE_MAIN,i)
-iMACD(NULL,0,FastEMA,SlowEMA,SignalSMA,PRICE_CLOSE,MODE_MAIN,i+1);
}
return(0);
}
//+------------------------------------------------------------------+
Comments