The perfect filter - page 4

 

If that's the case, check out my turkey, small and smooth as a baby's bottom)))))

On a principle so simple it's scary...

Files:
vaMA.ex5  8 kb
 
J.B:

On such a simple principle it's scary...

Interesting indicator, maybe even not inferior to JJMA, as it seemed to me at first sight, period settings are too disproportionate, but if you pick it up you can get quite similar picture, and in some places one is faster in other. But you' ve mixed up the file most likely, so that people could estimate the quality of the scary principle:) You need a *.mql5 file.

Документация по MQL5: Файловые операции / FileMove
Документация по MQL5: Файловые операции / FileMove
  • www.mql5.com
Файловые операции / FileMove - Документация по MQL5
 
EvMir:

so people can assess the quality of the scary principle:) I need a *.mql5 file.

Yes, I'm a bit shy... they'll laugh at a newcomer, they'll get pissed off(((

 
J.B:

I'm a little shy... they'll make fun of a newcomer, make me feel bad(((

They shouldn't, it's too low a fall to allow themselves to be embarrassed by a novice scholar.
 
server:
They shouldn't, it's too low a fall to allow themselves to be disgraced as a novice scholar.

Okay, I'll take my chances. The code is small, it's not like there's anything to be ashamed of.

//+------------------------------------------------------------------+
//|                                                              vaMA|
//|                                              Copyright 2013,  J.B|
//+------------------------------------------------------------------+
#property copyright "Copyright © 2013, J.B"

#property version   "1.00"

#include <MovingAverages.mqh>

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots   1

#property indicator_type1   DRAW_LINE
#property indicator_color1  Blue

input int vaMA_period=15;
input bool use_double_smooth=1;

double vaMA_buffer[],EMA[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+  
void OnInit()
  {
   SetIndexBuffer(0,vaMA_buffer,INDICATOR_DATA);
   SetIndexBuffer(1,EMA,INDICATOR_CALCULATIONS);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,const int prev_calculated,const int begin,const double &price[])
  {

   int first,bar;
   double vel,acc,aaa;

   ExponentialMAOnBuffer(rates_total,prev_calculated,begin,vaMA_period,price,EMA);                                   //Сгененрировать EMA c прайса

   if(rates_total<vaMA_period-1)return(0);                                                                            //
   if(prev_calculated==0)first=vaMA_period-1+begin;                                                                  //Проверка количества данных для цикла                                                                                      //
   else first=prev_calculated-1;                                                                                     //

   for(bar=first; bar<rates_total; bar++)                                                                            //Цикл по массиву баров
     {
      vel = EMA[bar]-EMA[bar-vaMA_period/4];                                                                         //Приращение между барами
      acc = EMA[bar]-2*EMA[bar-vaMA_period/4]+EMA[bar-vaMA_period/8];                                                //Приращение приращения между барами
      aaa = EMA[bar]-3*EMA[bar-vaMA_period/4]+3*EMA[bar-vaMA_period/8]-EMA[bar-vaMA_period/12];                      //Приращение приращения приращения...                                                                                         
      vaMA_buffer[bar] = EMA[bar]+vel+acc/2+aaa/6;                                                                   //Алхимический микс
     }
     
   if(use_double_smooth)  
   ExponentialMAOnBuffer(rates_total,prev_calculated,begin,vaMA_period/4,vaMA_buffer,vaMA_buffer);                   //Повторное EMA сглаживание


   return(rates_total);
  }
 
J.B:

I'm a little shy... they'll make fun of a newcomer, make me feel bad(((

I don't think so. They can get a lot of constructive criticism, yeah. It's for the best. Coda.
 

I wanted to do this as a function from an array a la"ExponentialMAOnBuffer" in a separate library file, but it wasn't that easy for me(((

 

The idea is to offset the EMA by "derivatives" with coefficients ala Taylor decomposition... Technically simple, but quite plausible relative to the non-trivial JJMA, which is considered the best.

 

Colour version.


Files:
vaMAColor.mq5  5 kb
 

Good filter, I approve. The idea is concise and effective. Just shifting by momentum is a well-known topic, but on higher order increments, I haven't seen.

But anyway one should (adaptively) in flat areas, increase smoothing period there to avoid many wrong signals. That is, you will not be able to avoid it so easily:) Do ZZ by points where the colour changes and you will see how a simple TS would work with such a filter.

Reason: