#_i_FFT_separate_Speed_WABSV2_buy

Download script
Author: Copyright � 2006, klot.
#_i_FFT_separate_Speed_WABSV2_buy

This tool functions as a specialized visual analyzer designed to extract and isolate specific patterns from price movement data. Rather than looking at the raw "noise" of the market, it uses mathematical decomposition to identify the underlying rhythms and cycles driving the asset's price.

How the Logic Works

The script operates through a three-step process to refine market data into a cleaner, more readable format:

1. Data Collection and Preparation The tool begins by gathering a specific sequence of historical price data points. It specifically looks at "Speed" values—essentially measuring the velocity of price changes—rather than just looking at the price itself. This helps the tool focus on how fast the market is moving, which is often more indicative of momentum than simple price levels.

2. Frequency Transformation (The "Spectrum" Analysis) Once it has collected this data, the script applies a mathematical process called a Fourier Transform. In simple terms, this converts the data from the "Time Domain" (what we see on a standard chart where price moves over minutes or hours) into the "Frequency Domain."

Think of this like taking a complex musical chord and breaking it down into its individual notes. By doing this, the tool can identify which specific "notes" (cycles) are making up the current market movement.

3. Filtering and Reconstruction This is where the "Analysis" part of the name comes from. The script allows for specific boundaries to be set:

  • Filtering: It ignores very high-frequency noise (tiny, insignificant fluctuations) and very low-frequency trends that might be too broad to be useful.
  • Isolation: By zeroing out everything outside of your preferred frequency range, it "mutes" the irrelevant market noise and keeps only the specific cycles you are interested in monitoring.
  • Reconstruction: Finally, it converts those isolated notes back into a visible line on your chart.

The Final Result

The output is a smoothed representation of price movement that has been stripped of "market jitter." By focusing only on the frequencies you choose to keep, the tool provides a clearer view of the underlying cycles, helping traders see the core structure of the market trend without being distracted by minor price fluctuations.

Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
#_i_FFT_separate_Speed_WABSV2_buy
//+------------------------------------------------------------------+
//|                                            #_i_SpecktrAnalis.mq4 |
//|                                          Copyright © 2006, klot. |
//|                                                     klot@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, klot."
#property link      "klot@mail.ru"



#import "#_lib_FFT.ex4"
void realfastfouriertransform(double& a[], int tnn, bool inversefft);
#import

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue
//#property indicator_color2 Blue
#property indicator_level1 0.0
//---- buffers
double Buffer1[];
//double Buffer2[];
//---
extern int n=7; // Äëèíà ðÿäà
extern int Fmin=2; // Ãðíèöà Ôèëüòðà ïî Í×.
extern int Fmax=30;//128; // Ãðàíèöà Ôèëüòðà ïî Â×.
//extern string sym="GBPUSD";
//extern string sym="EURUSD";

double aa[];
int N;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,Buffer1);
//SetIndexStyle(1,DRAW_LINE);
//SetIndexBuffer(1,Buffer2);
//---
   N=MathPow(2,n);
   ArrayResize(aa,N);

if( Fmax>=N ) Fmax=N;
if( Fmin<=2 ) Fmin=2;

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {

   if( Bars<N) return(0);
   
   //---
   for(int i=N-1; i>=0; i--) { aa[i]=iCustom(Symbol(),0,"Speed_WABSV2",true,0,0,i); }
   //---
   realfastfouriertransform(aa, N, false);
   //---
   N=ArraySize(aa);
   //Comment("n= ",N);
   //---
   for( i=0; i<=N-1; i++) 
   { 
      if( i<Fmin || i>Fmax) { aa[i]=0.0; }
   }
   //---
   realfastfouriertransform(aa, N, true);
   //---
   SetIndexDrawBegin(0,Bars-N);
   //---
   for( i=0; i<=N-1; i++)
   {
      Buffer1[i]=aa[i];
   }
   //----
   return(0);
  }
//-------------------------------------------------------------------+

Comments