Linear regression channel - page 5

 
Dmitry Fedoseev:

Here's an accelerated STD. But it only looks like an STD, not an STD.

Thank you! Trying to figure out what's being calculated in the source.

 
Dmitry Fedoseev:

1. To get this speed, it is sufficient to limit the calculations to a visible window. I don't see the miracle.

2. I don't even know which is better, being cheated or not being understood.

3. I still do not understand about x and y not being straight lines?

Think what you like, Thomas the Unbeliever.

I don't care.

y=f(x) is a straight line - that's clear
but x and y are straight lines - that's ....
I'd be surprised if anyone besides you understood that.

 
fxsaber:

Thanks for the animation. Unfortunately, I don't know what is used as a test channel.

RMS deviation multiplied by 1.41. I give a guarantee. If someone disproves it (it's easy to do if it's not), I'll post the code.
more precisely the root of the RMS deviation multiplied by the channel width coefficient ( 1.41 in this gif).

 
fxsaber:

Thank you! Trying to work out what is being calculated in the source.

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {

   int start;
   if(prev_calculated==0){
      start=period;
      double ms=0;
      for(int i=0;i<period;i++){
         ms+=close[i];
      }
      ma[period-1]=ms/period;
   }
   else{
      start=prev_calculated-1;
   }

   for(int i=start;i<rates_total;i++){
      
      ma[i]=ma[i-1]+(-close[i-period]+close[i])/period;
      
      double sm=0;
      for(int j=i-period+1;j<=i;j++){
         sm+=MathPow(close[j]-ma[i],2); // вот это правильная стд, ее не ускорить, а если ma[i] заменить на ma[j], то можно ускорить, что и сделано
      }
      Label1Buffer[i]=MathSqrt(sm/period);
   }

   return(rates_total);
  }
 
Nikolai Semko:

RMS deviation multiplied by 1.41. I guarantee it. If someone refutes it (it's easy to do if it's not), I'll post the code.
More precisely the root of the RMS deviation multiplied by the channel width coefficient ( 1.41 in this gif).

Took the standard object channel, and it's giving out some wrong widths.


 
Dmitry Fedoseev:

Got the idea, thanks! Now we have to analyse how this method of width calculation will affect the result.

 
Nikolai Semko:

Standard deviation multiplied by 1.41. I guarantee it. If anyone disproves it (easy to do if it doesn't), I'll post the code.
more precisely the root of the RMS deviation multiplied by the channel width factor ( 1.41 in this gif).

"More precisely the root of the RMS" - i.e. std indicator? Quite simply and without any tricks - should the channel width be equal to the value of the std indicator multiplied by 1.41?

I do not see it that way. It looks more like my wrong std calculation.

Give me an exact step by step algorithm on how to check and make sure. So far, even this, an unconvincing way to prove, doesn't work.

 

I don't get it. The middle of the LR is supposed to be the same as the MA. In MT5 there is no such coincidence even with the standard LR.

And the tested indicator does not coincide with the MA as well.

 
fxsaber:

I don't get it. The middle of the LR is supposed to be the same as the MA. In MT5 there is no such coincidence even with the standard LR.

And the tested indicator does not coincide with the MA either.

It should not coincide with a standard MA.

 
Dmitry Fedoseev:

It must not coincide with the normal MA.

The point which is exactly in the middle of the LR segment is the average of the original points. This follows from the definition of LR.