Author: Copyright � 2005, Finware Technologies Ltd
FATL_v4

This tool is designed as a custom technical indicator for the MetaTrader 4 platform. Its primary purpose is to generate a specific visual trend line on your trading chart based on historical price action.

How the Logic Works

The script operates by analyzing the closing prices of previous candles over a specific timeframe. Rather than simply moving with the most recent price, it uses a sophisticated mathematical weighting system to calculate its position.

Key aspects of this logic include:

  • Historical Data Window: The indicator looks back at a significant number of previous bars (defined by the user) to ensure the resulting line is smooth and representative of broader market movement.
  • Weighted Calculation: Instead of giving equal importance to every price point, the script applies unique multipliers to 38 different historical data points. Some prices are weighted positively to influence the line upward, while others are weighted negatively to temper the movement or identify specific price pressures.
  • Smoothing Effect: By combining these various weighted values into a single calculation for each point on the chart, the tool creates a refined "map" of the price action. This helps filter out minor market noise, allowing traders to see a clearer representation of the underlying trend.
  • Visual Output: The final result is displayed as a red line directly on your main chart window, providing a continuous visual guide for price movement.
Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
FATL_v4
//+------------------------------------------------------------------+
//|                                                         FATL.mq4 |
//|                       Copyright © 2005, Finware Technologies Ltd |
//|                                            http://www.finware.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Finware Technologies Ltd"
#property link      "http://www.finware.ru"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- input parameters
extern int       CountBars=300;
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int i,AccountedBars,shift;
//---- TODO: add your code here

AccountedBars = Bars-CountBars;
   
   for(i=AccountedBars;i<=Bars-1;i++) 
   {
   
   shift = Bars - 1 - i;
   ExtMapBuffer1[shift]=+0.4360409450*Close[shift+0]
   
+0.3658689069*Close[shift+1]
+0.2460452079*Close[shift+2]
+0.1104506886*Close[shift+3]
-0.0054034585*Close[shift+4]
-0.0760367731*Close[shift+5]
-0.0933058722*Close[shift+6]
-0.0670110374*Close[shift+7]
-0.0190795053*Close[shift+8]
+0.0259609206*Close[shift+9]
+0.0502044896*Close[shift+10]
+0.0477818607*Close[shift+11]
+0.0249252327*Close[shift+12]
-0.0047706151*Close[shift+13]
-0.0272432537*Close[shift+14]
-0.0338917071*Close[shift+15]
-0.0244141482*Close[shift+16]
-0.0055774838*Close[shift+17]
+0.0128149838*Close[shift+18]
+0.0226522218*Close[shift+19]
+0.0208778257*Close[shift+20]
+0.0100299086*Close[shift+21]
-0.0036771622*Close[shift+22]
-0.0136744850*Close[shift+23]
-0.0160483392*Close[shift+24]
-0.0108597376*Close[shift+25]
-0.0016060704*Close[shift+26]
+0.0069480557*Close[shift+27]
+0.0110573605*Close[shift+28]
+0.0095711419*Close[shift+29]
+0.0040444064*Close[shift+30]
-0.0023824623*Close[shift+31]
-0.0067093714*Close[shift+32]
-0.0072003400*Close[shift+33]
-0.0047717710*Close[shift+34]
+0.0005541115*Close[shift+35]
+0.0007860160*Close[shift+36]
+0.0130129076*Close[shift+37]
+0.0040364019*Close[shift+38];

}


//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments