t3_Aroon_Horn_Osc
Download scriptThis tool is a custom technical analysis indicator designed to help traders visualize market momentum and trend strength by combining two sophisticated mathematical concepts: the Aroon Horn and the T3 Moving Average.
How it Works
The core logic of this script functions by layering different types of data processing to create a smoother, more responsive visual representation of price movement. Here is the breakdown of how it processes information:
1. Data Sourcing (Aroon Horn) The indicator begins by pulling data from the "Aroon Horn" metric. This specific type of analysis looks at the time elapsed since the price last hit a high or a low, helping to identify whether the market is trending or moving sideways. The script specifically calculates the difference between two consecutive readings of this data to capture the most recent "pulse" of the market's direction.
2. Signal Smoothing (The T3 Filter) Raw market data can often be "noisy," meaning it may jump around erratically. To combat this, the script applies a T3 smoothing logic. Unlike standard moving averages that can be slow to react or too sensitive to small price changes, the T3 algorithm uses a series of complex weighted calculations. It passes the market pulse through six consecutive layers of mathematical filtering. Each layer reduces noise while attempting to maintain the integrity of the original trend.
3. Final Output Calculation Once the data has been smoothed through these filters, the script applies a final set of coefficients (fixed multipliers) to normalize the result. The final value is then scaled by a factor of 1,000 to ensure that the resulting line on your chart is clear and easy to read visually.
Summary for the User
In simple terms, this indicator takes the raw momentum signals from an Aroon Horn calculation and "polishes" them using a high-end smoothing filter. The result is a visual line that attempts to show you the underlying strength of a trend while filtering out the minor fluctuations that often trick inexperienced traders into seeing patterns where none exist.
//+-------------------------------------------------------------------------+
//| t3_Aroon_Horn_Osc.mq4 |
//| Copyright © 2005, |
//| http://finance.groups.yahoo.com/group/MetaTrader_Experts_and_Indicators/|
//+-------------------------------------------------------------------------+
#property copyright "Copyright © 2005,"
#property link "http://finance.groups.yahoo.com/group/MetaTrader_Experts_and_Indicators/"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
#property indicator_level1 0
extern double Aroon_Horn_Period = 5.0;
extern double T3_Period = 5.0;
extern double b = 0.500;
extern int CountBars=200;
double MapBuffer[];
double e1,e2,e3,e4,e5,e6;
double c1,c2,c3,c4;
double n,w1,w2,b2,b3;
double m1,m2,med;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators setting
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1,DodgerBlue);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
IndicatorShortName("t3_Aroon_Horn_Osc "+T3_Period);
SetIndexBuffer(0,MapBuffer);
//---- variable reset
e1=0; e2=0; e3=0; e4=0; e5=0; e6=0;
c1=0; c2=0; c3=0; c4=0;
n=0;
w1=0; w2=0;
b2=0; b3=0;
b2=b*b;
b3=b2*b;
c1=-b3;
c2=(3*(b2+b3));
c3=-3*(2*b2+b+b3);
c4=(1+3*b+b3+3*b2);
n=T3_Period;
if (n<1) n=1;
n = 1 + (0.5*(n-1));
w1 = 2 / (n + 1);
w2 = 1 - w1;
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit=500;
//---- indicator calculation
for(int i=limit; i>=0; i--)
{
m1=(iCustom(Symbol(), 0, "Aroon_Horn",Aroon_Horn_Period,0,i));
m2=(iCustom(Symbol(), 0, "Aroon_Horn",Aroon_Horn_Period,1,i));
//m1=(High[i]-Low[i]);
//m2=(High[i+1]-Low[i+1]);
med=m1-m2;
e1 = ((w1*med) + w2*e1);
e2 = ((w1*e1) + w2*e2);
e3 = ((w1*e2) + w2*e3);
e4 = ((w1*e3) + w2*e4);
e5 = ((w1*e4) + w2*e5);
e6 = ((w1*e5) + w2*e6);
MapBuffer[i]=((((c1*e6) + c2*e5) + c3*e4) + c4*e3)*1000;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments