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

This script is designed as a sophisticated technical analysis tool for trading platforms, specifically engineered to clean up market data. Its primary objective is to separate meaningful price trends from the "noise"—the random, minor fluctuations that can often mislead traders and trigger false signals.

Core Logic Overview

The logic operates through a multi-stage refinement process. Instead of simply averaging past prices (like a standard moving average), it uses a digital filtering technique that mimics high-quality signal processing used in other engineering fields.

Here is how the process works step-by-step:

1. The Primary Filter (Data Smoothing) The script looks at a specific window of recent price data (30 data points). It applies a complex mathematical formula to these prices, giving different weights to each point in time. By doing this, it generates a "smoothed" version of the price action. This first pass removes the jittery movements while attempting to keep the line as close to the actual price as possible.

2. The Secondary Filter (Refined Smoothing) The script then takes the output of the first filter and runs it through a second, identical mathematical process. By filtering the filtered data, the tool becomes even more resistant to outliers and erratic market spikes. This double-layer approach ensures that the resulting line represents a very high-integrity trend.

3. Derivative Analysis (Trend & Slope) Beyond just showing smoothed price lines, the script performs "differential" calculations. It calculates the difference between various stages of the filter:

  • Momentum/Velocity: It compares the current filtered value against previous values to determine how fast the price is moving.
  • Slope Tracking: It identifies the rate of change (the "steepness") of both the primary and secondary filters.

Visual Output for the Trader

Because it performs these complex calculations behind the scenes, it provides several distinct visual components:

  • Main Filter Lines: These represent the smoothed price paths, allowing you to see the "true" direction of the market clearly.
  • Slope Indicators: These help a trader visualize the strength and acceleration of the move. By tracking the difference between these lines, the script essentially highlights whether the current trend is gaining momentum, losing steam, or potentially reversing.

Summary of Benefits

By using this digital filter logic rather than standard indicators, the tool aims to provide:

  • Reduced Lag: It is designed to follow price movement instantly without the heavy "delay" often found in traditional smoothers.
  • Noise Suppression: It filters out the "fake" movements caused by low liquidity or minor market fluctuations.
  • Trend Clarity: It provides a much cleaner view of the underlying market structure, making it easier to identify high-probability entries and exits.
Miscellaneous
Implements a curve of type %1
14 Views
0 Downloads
0 Favorites
MIR_osc3sl
//+------------------------------------------------------------------+
//|                     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_separate_window
#property indicator_buffers 3
#property indicator_color1 DodgerBlue
#property indicator_color2 Red
#property indicator_color3 Gray
#define FilterOrder 30

//---- buffers
double FilterBuffer[];
double FilterBuffer2[];
double FilterBuffer3[];
double FilterBuffer4[];
double FilterBuffer5[];

//+------------------------------------------------------------------+
//| Digital filter indicator initialization function                 |
//+------------------------------------------------------------------+
int init()
{
//---- indicator line
    IndicatorBuffers(5);

SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,FilterBuffer3);
SetIndexDrawBegin(0,61);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,FilterBuffer4);
SetIndexDrawBegin(1,61);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,FilterBuffer5);
SetIndexDrawBegin(2,61);
SetIndexBuffer(3,FilterBuffer);
SetIndexBuffer(4,FilterBuffer2);
SetIndexLabel(0,"mirCD");
SetIndexLabel(1,"CDslope");
SetIndexLabel(2,"mir2slope");
SetIndexLabel(3,"mir");
SetIndexLabel(4,"mir2");
//----
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--;
}
i=Bars-30-1;
if(counted_bars>=30) i=Bars-counted_bars-1;
while(i>=0)
{
double response2=
 0.2674159617898*FilterBuffer[i]
 +0.2513802565774*FilterBuffer[i+1]
 +0.2211333753570*FilterBuffer[i+2]
 +0.1800616410930*FilterBuffer[i+3]
 +0.1326480423408*FilterBuffer[i+4]
 +0.0838587718677*FilterBuffer[i+5]
 +0.0384533194950*FilterBuffer[i+6]
 +0.000361380408010*FilterBuffer[i+7]
 -0.02763961135328*FilterBuffer[i+8]
 -0.0443785558740*FilterBuffer[i+9]
 -0.0501417866008*FilterBuffer[i+10]
 -0.0465638452107*FilterBuffer[i+11]
 -0.0362043470551*FilterBuffer[i+12]
 -0.02209069455035*FilterBuffer[i+13]
 -0.00720956629679*FilterBuffer[i+14]
 +0.00589037910713*FilterBuffer[i+15]
 +0.01544079199829*FilterBuffer[i+16]
 +0.02055957526714*FilterBuffer[i+17]
 +0.02126036163880*FilterBuffer[i+18]
 +0.01828930006698*FilterBuffer[i+19]
 +0.01286478623414*FilterBuffer[i+20]
 +0.00638761812864*FilterBuffer[i+21]
 +0.0001646100607892*FilterBuffer[i+22]
 -0.00480278407473*FilterBuffer[i+23]
 -0.00796418634567*FilterBuffer[i+24]
 -0.00925425730208*FilterBuffer[i+25]
 -0.00909425465110*FilterBuffer[i+26]
 -0.00839501788430*FilterBuffer[i+27]
 -0.00872393363958*FilterBuffer[i+28]
 +0.00629266940806*FilterBuffer[i+29];
FilterBuffer2[i]=response2;
FilterBuffer3[i]=FilterBuffer[i]-FilterBuffer2[i];
FilterBuffer4[i]=FilterBuffer3[i]-FilterBuffer3[i+1];
FilterBuffer5[i]=FilterBuffer2[i]-FilterBuffer2[i+1];


i--;
}


return(0);
}

Comments