10$ for upgrading the indicator - page 5

 
Yeah, for about a year and a half now. And the whole thing is about non-integer periods :)
 
Mathemat >>:
grell предложил формулу, показывающую, как можно непрерывно трансформировать мувинг от периода 3 к периоду 4. При этом изменяются мувинги целиком, а не их отдельные коэффициенты: все к-ты варианта grell'a отличаются от предложенных раньше.
>> so kudos to him! >> I wrote.

avatara wrote >>
What else can you suggest? A simple interpolation would be in order?
---
Mathemat >>:
avatara, don't be stingy, offer your geometric version.

Not everyone has spoken yet. ;)

>> Progger ignores it :(

 
grell >>:
Пока мы тут лясы точим, Unknow там капусту рубит:)))

State even posted.

;)

 
Let's put the question another way. What does a period of 3.333333 mean?

1. Does the calculation use 3 full bars and a third of the fourth bar? Then which bar to take?
2. The calculation uses some kind of "average" between 3 and 4 periods. What is such an average?
3. When calculating, do we take a little from each bar? How much?
4. When calculating we transform the TF. How?
etc.
 
By the way, transforming the TF is also an option. We're getting into a bit of a rut here...
I wonder if anyone knows how this is implemented in platforms offering non-integer periods?
 
Not an option on short timeframes, but starting at H1 or H4 you can think about it.
 
Shit, men, just give me the finger! Five pages is not the limit.
 
granit77 >>:
Блин, мужики, вам только палец покажи! Пять страниц не предел.

Do you know the solution?

Or not interested?

 
So I sketched out an indicator using the SMA. Actually, it makes sense that the weighting of the fractional part is on the higher bar. We are counting back to the history.
Here's the picture. Red - SMA(4), blue - SMA(3.5), green - SMA(4.5):

The turkey is attached, and here's the code:
#property indicator_chart_window // в окне инструмента
#property indicator_buffers 1
#property indicator_color1 Blue  

// входные параметры
extern double MAperiod=3; // 
 int History=0; // 0- все бары

double   SMA[]; // массив буфера
double rt; // дробная часть периода
int per; // целая часть периода

void init() {// инициализация
   per=MathFloor(MAperiod);
   rt=MAperiod-per;
   SetIndexBuffer(0,SMA); // индикатор
   SetIndexStyle(0,DRAW_LINE);
   SetIndexLabel(0,"SMA("+DoubleToStr(MAperiod,2)+")");
  }

void start() {
   int limit=Bars-IndicatorCounted()-1; 
   if(History!=0 && limit>History) limit=History-1; // кол-во пересчетов по истории

   for(int i=limit; i>=0; i--) { // цикл пересчета по ВСЕМ барам
      int j=i+per;
      double ma=rt*Close[j];
      j--;
      for(; j>=i; j--) ma+=Close[j];
      ma/=MAperiod;
      SMA[i]=ma;
     }   
  }
Files:
rsma.mq4  1 kb
 
Also sketched (SMA) Red 2, Yellow 3, SteelBlue 2.5

Files:
drobma.mq4  1 kb
Reason: