Author: Copyright (c) 2005, Sergey Iljukhin, Novosibirsk
MIR

This digital filter is designed as a sophisticated technical analysis tool for MetaTrader, engineered to provide a clearer picture of market trends by refining the raw price data. In the world of trading, price movements are often cluttered with "noise"—minor, erratic fluctuations that can make it difficult to identify the actual direction of the market. This script acts as a specialized lens to smooth out those distractions.

How the Logic Works

The core mechanism relies on a Digital Filter Method. Rather than simply looking at the most recent price or using a standard moving average, this tool performs a complex mathematical evaluation of the last 30 candles (data points) on your chart.

Here is a breakdown of how it processes that information:

  • Weighted Analysis: The script assigns a specific unique "weight" to each of the previous 30 price points. Not every candle is treated equally; some have a significant influence on the final result, while others have a much smaller impact or even a slight negative correction.
  • Dynamic Calculation: By combining these 30 different values using precise coefficients, the tool calculates a "response" value. This response represents a smoothed version of the price action that is intended to follow the underlying trend more closely than a raw line would.
  • Noise Reduction: The primary goal of this specific mathematical arrangement is to eliminate market "jitter." By filtering out the insignificant spikes and dips, the tool helps traders see the "true" path of the price.
  • Responsiveness: Unlike some filters that are so smooth they become "laggy" (showing you where the price was rather than where it is going), this logic is specifically tuned to be instant and reliable. It aims to maintain a tight connection to current price action while still providing the benefits of a filtered, cleaner visual.

Summary for the User

Think of this indicator as a high-quality stabilizer. It takes the chaotic "vibrations" of the market and flattens them into a smooth, readable line. This allows you to identify the primary direction of the market with greater clarity, helping you distinguish between a meaningful trend shift and temporary market noise.

Miscellaneous
Implements a curve of type %1
12 Views
0 Downloads
0 Favorites
MIR
//+------------------------------------------------------------------+
//|                     This filter created by Digital filter Method |
//|             Software(Copyright (c) Sergey Iljukhin, Novosibirsk. |
//|                     email sergey[at]tibet.ru http://fx.qrz.ru/). |
//|                Designing and special parameters are designed and |
//|                tested to remove more noise  and follow the price |
//|                instantly and reliably. This source code is free. |
//|                Designer: Saeid Mohammadi Jazi, saeid169@yahoo.com|    
//+------------------------------------------------------------------+
#property copyright "Copyright (c) 2005, Sergey Iljukhin, Novosibirsk"
#property link      "http://fx.qrz.ru/"

// --- Parameters: P1=20, D1=12, A1=40
// --- P2=36, D2=12, A2=40, Ripple=0.08, Delay=0
// --- Order [Auto]=30, Calculate method=2

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
#define FilterOrder 30

//---- buffers
double FilterBuffer[];

//+------------------------------------------------------------------+
//| Digital filter indicator initialization function                 |
//+------------------------------------------------------------------+
int init()
{
//---- indicator line
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,FilterBuffer);
SetIndexDrawBegin(0,30);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Digital filter main function                                     |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted();
double response;
//----
if(Bars<=30) return(0);
//----
i=Bars-30-1;
if(counted_bars>=30) i=Bars-counted_bars-1;
while(i>=0)
{
response=
 0.2674159617898*Close[i]
 +0.2513802565774*Close[i+1]
 +0.2211333753570*Close[i+2]
 +0.1800616410930*Close[i+3]
 +0.1326480423408*Close[i+4]
 +0.0838587718677*Close[i+5]
 +0.0384533194950*Close[i+6]
 +0.000361380408010*Close[i+7]
 -0.02763961135328*Close[i+8]
 -0.0443785558740*Close[i+9]
 -0.0501417866008*Close[i+10]
 -0.0465638452107*Close[i+11]
 -0.0362043470551*Close[i+12]
 -0.02209069455035*Close[i+13]
 -0.00720956629679*Close[i+14]
 +0.00589037910713*Close[i+15]
 +0.01544079199829*Close[i+16]
 +0.02055957526714*Close[i+17]
 +0.02126036163880*Close[i+18]
 +0.01828930006698*Close[i+19]
 +0.01286478623414*Close[i+20]
 +0.00638761812864*Close[i+21]
 +0.0001646100607892*Close[i+22]
 -0.00480278407473*Close[i+23]
 -0.00796418634567*Close[i+24]
 -0.00925425730208*Close[i+25]
 -0.00909425465110*Close[i+26]
 -0.00839501788430*Close[i+27]
 -0.00872393363958*Close[i+28]
 +0.00629266940806*Close[i+29];
FilterBuffer[i]=response;

i--;
}
return(0);
}

Comments