FATL.mq4
Download scriptThis technical indicator is designed to provide traders with a smoothed representation of price action by analyzing historical closing data. Instead of reacting solely to the most recent price movement, which can often be volatile or "noisy," this script calculates a weighted value based on a specific window of past market activity.
How the Logic Works
The tool operates using a sophisticated mathematical formula that evaluates a sequence of 39 consecutive candles (price bars). Each candle in this sequence is assigned a unique "weight" or importance level, expressed as a decimal coefficient.
Key features of this logic include:
- Weighted Averaging: Not all historical data points are treated equally. Some recent prices have a much stronger influence on the final result than older ones, while some specific historical points may even act as subtractive factors to balance out market extremes.
- Smoothing Effect: By combining these various weights across nearly 40 bars of data, the indicator filters out minor price fluctuations. This helps in identifying the underlying trend of the market more clearly.
- Stability: Because the calculation requires a minimum amount of historical data (at least 38 bars) before it begins to display results, it ensures that the visual line is based on a statistically significant sample of market movement.
Visual Representation
On your trading chart, this logic translates into a continuous blue line. This line serves as a smoothed indicator of price, helping you visualize whether the current market momentum is shifting in a specific direction by providing a more stabilized view of price history than a standard candle chart alone.
//+------------------------------------------------------------------+
//| FATL.mq4
//|
//+------------------------------------------------------------------+
#property copyright "Copyright 2002, Finware.ru Ltd."
#property link "http://www.finware.ru/"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Blue
//---- buffers
double FATLBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- indicator line
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,FATLBuffer);
SetIndexDrawBegin(0,38);
//----
return(0);
}
//+------------------------------------------------------------------+
//| FATL |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted();
//----
if(Bars<=38) return(0);
//---- initial zero
if(counted_bars<38)
for(i=1;i<=0;i++) FATLBuffer[Bars-i]=0.0;
//----
i=Bars-38-1;
if(counted_bars>=38) i=Bars-counted_bars-1;
while(i>=0)
{
FATLBuffer[i]=
0.4360409450*Close[i+0]
+0.3658689069*Close[i+1]
+0.2460452079*Close[i+2]
+0.1104506886*Close[i+3]
-0.0054034585*Close[i+4]
-0.0760367731*Close[i+5]
-0.0933058722*Close[i+6]
-0.0670110374*Close[i+7]
-0.0190795053*Close[i+8]
+0.0259609206*Close[i+9]
+0.0502044896*Close[i+10]
+0.0477818607*Close[i+11]
+0.0249252327*Close[i+12]
-0.0047706151*Close[i+13]
-0.0272432537*Close[i+14]
-0.0338917071*Close[i+15]
-0.0244141482*Close[i+16]
-0.0055774838*Close[i+17]
+0.0128149838*Close[i+18]
+0.0226522218*Close[i+19]
+0.0208778257*Close[i+20]
+0.0100299086*Close[i+21]
-0.0036771622*Close[i+22]
-0.0136744850*Close[i+23]
-0.0160483392*Close[i+24]
-0.0108597376*Close[i+25]
-0.0016060704*Close[i+26]
+0.0069480557*Close[i+27]
+0.0110573605*Close[i+28]
+0.0095711419*Close[i+29]
+0.0040444064*Close[i+30]
-0.0023824623*Close[i+31]
-0.0067093714*Close[i+32]
-0.0072003400*Close[i+33]
-0.0047717710*Close[i+34]
+0.0005541115*Close[i+35]
+0.0007860160*Close[i+36]
+0.0130129076*Close[i+37]
+0.0040364019*Close[i+38];
i--;
}
return(0);
}
//+------------------------------------------------------------------+
Comments