t3_Aroon_Horn_v1
Download scriptThis indicator is designed to provide traders with a smoothed, more refined perspective on market momentum and trend direction. It achieves this by combining two distinct types of mathematical processing: the Aroon Horn logic and the T3 Moving Average methodology.
The Core Logic Breakdown
1. Data Source: The Aroon Horn The script begins by pulling data from an underlying component called the "Aroon Horn." In trading terms, Aroon-based indicators typically measure how long ago the price reached a new high or low within a specific timeframe. It helps identify whether a market is trending strongly or moving sideways.
2. The Smoothing Engine: T3 Methodology Rather than displaying the raw, often "jittery" data from the Aroon Horn, this script passes that information through a T3 filter. The T3 is a sophisticated moving average known for its ability to balance two competing needs:
- Responsiveness: It reacts quickly enough to significant price changes so the trader isn't left behind.
- Stability: It filters out minor "noise" and market fluctuations that often cause standard indicators to give false signals.
3. Multi-Layered Processing The script doesn't just apply one layer of smoothing; it performs a sequential calculation (a series of weighted averages). By layering the data through multiple stages, the indicator creates a very fluid line on your chart. This multi-step process ensures that the resulting curves are polished and steady.
Visual Representation
The script produces two distinct lines on a separate window below your price chart:
- Blue Line: Represents the primary processed trend of the data.
- Red Line: Represents a secondary, parallel processing of the same data.
How to Interpret the Logic
Because this script uses the T3 logic to filter the Aroon Horn, it is intended to highlight the "true" underlying trend of the market. When these lines move smoothly in one direction, it suggests sustained momentum. By smoothing out the erratic movements of the base indicator, it allows a user to see the broader "flow" of the market more clearly, making it easier to distinguish between a temporary price spike and a genuine shift in trend.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+-------------------------------------------------------------------------+
//| t3_Aroon_Horn.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 2
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_level1 0
extern int AroonHornPeriod = 5.0;
extern int T3_Period = 5.0;
extern double b = 0.500;
double MapBuffer[];
double e1,e2,e3,e4,e5,e6;
double c1,c2,c3,c4;
double n,w1,w2,b2,b3;
double MapBuffer1[];
double ae1,ae2,ae3,ae4,ae5,ae6;
double ac1,ac2,ac3,ac4;
double an,aw1,aw2,ab2,ab3;
double sub1,sub2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators setting
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1,Blue);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1,Red);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
IndicatorShortName("t3_Aroon_Horn "+T3_Period);
SetIndexBuffer(0,MapBuffer);
SetIndexBuffer(1,MapBuffer1);
//---- 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;
ae1=0; ae2=0; ae3=0; ae4=0; ae5=0; ae6=0;
ac1=0; ac2=0; ac3=0; ac4=0;
an=0;
aw1=0; aw2=0;
ab2=0; ab3=0;
ab2=b*b;
ab3=ab2*b;
ac1=-ab3;
ac2=(3*(ab2+ab3));
ac3=-3*(2*ab2+b+ab3);
ac4=(1+3*b+ab3+3*ab2);
an=T3_Period;
if (an<1) an=1;
an = 1 + (0.5*(an-1));
aw1 = 2 / (an + 1);
aw2 = 1 - aw1;
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit=500;
//---- indicator calculation
for(int i=limit; i>=0; i--)
{
sub1=iCustom(Symbol(), 0, "Aroon_Horn",AroonHornPeriod,0,i);
e1 = ((w1*sub1) + 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;
sub2=iCustom(Symbol(), 0, "Aroon_Horn",AroonHornPeriod,1,i);
ae1 = (aw1*sub2) + (aw2*ae1);
ae2 = (aw1*ae1) + (aw2*ae2);
ae3 = (aw1*ae2) + (aw2*ae3);
ae4 = (aw1*ae3) + (aw2*ae4);
ae5 = (aw1*ae4) + (aw2*ae5);
ae6 = (aw1*ae5) + (aw2*ae6);
MapBuffer1[i]=((((ac1*ae6) + ac2*ae5) + ac3*ae4) + ac4*ae3)*1000;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments