10$ for upgrading the indicator - page 6

 
Svinozavr >>:
Ну набросал я индикатор по SMA. Вообще-то, что весовая часть дробной части приходится на старший бар, логично. Отсчитываем-то назад, в историю.
Вот картинка. красный - SMA(4), синий - SMA(3.5), зеленый - SMA(4.5):

Индюк прикреплен, и вот код:

That's great!
And not 200 lines of code...
;)

 
By the way, have been watching the SMAs with periods of 1.1, 1.2 etc. It's funny.
In short, it's a lot of fun. I think it has - IMHO - no practical application, but as an actualization of the oxymoron "a simple slip with a fractional period"))) will do. There is something of Zen fables in it ("Clap one palm" etc. ))))
===
Alexey should put this topic into the non-trade-related tasks branch initially.)))
 
And the door was open...
 
grell >>:
А ларчик просто открывался...

Yes... That's not the point. It's just that as a purely practical person, it never occurred to me to open this chest. I have enough boxes of my own, I would even say Pandora's boxes)).
===
Shall I put it in the base? Or is it still better not to embarrass yourself with trinkets?)))

 
//+------------------------------------------------------------------+
//|                                                          kMa.mq4 |
//|                                                            Grell |
//|                                                dwgrell@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Grell"
#property link      "dwgrell@gmail.com"
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Red
#property indicator_color2 Yellow
#property indicator_color3 Green
extern int    per1=3;
extern double perk=3.7;
extern int    per2=4;
double Buffer1[];
double Bufferk[];
double Buffer2[];
int init()
  {
  SetIndexStyle(0,DRAW_LINE);
  SetIndexBuffer(0,Buffer1);
  SetIndexStyle(1,DRAW_LINE);
  SetIndexBuffer(1,Bufferk);
  SetIndexStyle(2,DRAW_LINE);
  SetIndexBuffer(2,Buffer2);
  return(0);
  }
int deinit()
  {
  return(0);
  }
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   double a1=perk-MathFloor(perk);
   double a2=MathCeil(perk)-perk;
   for(int i=0; i<limit; i++)
     {
     Buffer1[i]=iMA(NULL,0,per1,0,0,0,i);
     Buffer2[i]=iMA(NULL,0,per2,0,0,0,i);
     Bufferk[i]=a1*iMA(NULL,0,per2,0,0,0,i)+a2*iMA(NULL,0,per1,0,0,0,i);
     }
   return(0);
  }
//+------------------------------------------------------------------+
 
The head works, but not in the right way.
 
grell >>:
Голова работает, но не в том ключе.

Then let's get on with it. ;)

Remaining are.

2. for linearly weighted
3. for exponential?
 
Sit down "5" - the fuck-up is defended. There is still option 4, but it's the same as the previous two.
 
grell >>:
Садись "5" - подъеб защитан. Остался 4 вариант, но решается также как и предыдущие 2.
A linear combination for an exponent?
:о)
 
avatara >>:

Тогда продолжим. ;)

Остались -

Why for an exponential? It has a "fractional" period from the start, which it doesn't have - it only has feedback coefficients. That's how MT made it so that EMA is not fractional. As it is, it has always had a fractional parameter. Recalculate this coefficient from fractional period and it's done. k=2.0/(1+period);
Well, the rest of the standard ones are elementary already done.