Linear regression channel - page 10

 
Dmitry Fedoseev:

Show me and I'll disappear for a month. I'll take responsibility for my words, which I can't say about you. And just to believe it, even after one lie, I'm sorry...

after what one lie. There hasn't been a single lie on my part here.
And the fact that you don't believe the truth is your problem.
So we have an agreement that if I break the cycle when calculating the BB on every bar except the first, then you will disappear from the forum for a month?
And if I don't fail, what should I do? Also disappear for a month? Or for a year?

 
Nikolai Semko:

After what one lie. There wasn't one lie on my part.
And if you don't believe the truth, that's your problem.
I.e. we agreed that if I fail the cycle in calculating the BB on every bar except the first, then you will disappear from the forum for a month.
And if I don't fail, what am I supposed to do? Also disappear for a month? Or for a year?

There was a suggestion to download the demo and make sure that the channel width equals sko multiplied by 1.41. I downloaded, checked, it turned out not to be so.

 
Dmitry Fedoseev:

Which one exactly?

I rely on your taste.) Not a trial, of course.
Give me your channel-building code. I'll redo it. The cycle will be only on the history. All next values of the channel will be counted without the cycle.
 
Nikolai Semko:

...
So it's agreed that if I go out of cycle when calculating the BB on every bar except the first, then you will disappear from the forum for a month?
And if I don't fail, what should I do? Also disappear for a month? Or for a year?

What does this have to do with breaking the cycle? And now don't try to make up conditions and then sort of prove that they have been met. It's already clear to everyone what the conversation is about (naively I hope so, but I'm beginning to doubt it).

I don't need anything. This magic algorithm will be enough.

 
Yuriy Asaulenko:
Relying on your taste). Not a sampler, of course.
Give me your channel-building code. I will redo it. The cycle will be only on the history. All subsequent values of the channel will be counted without the cycle.

Nah, this kind of drinking is beyond my tastes.

 
Dmitry Fedoseev:

Nah, that kind of drinking is beyond my tastes.

Don't worry, you weren't invited to drink. I'll be drinking.)
So will there be an SCO channel code?
 
And you don't have to complicate it, you don't have to channel it. Just std and that's it.
 
Yuriy Asaulenko:
Don't worry, you weren't invited to drink. I'll be drinking).
So will there be an SCO channel code?

You don't need a channel. Enough std to match the example from the terminal

 
Dmitry Fedoseev:

You don't need a channel. Just enough std to match the example from the terminal.

So, will there be a Hennessy?
Then, link to the example from the terminal please.
Better to put the code here, as a file, so that it is publicly available.
Hennesy is a serious matter).
 
Yuriy Asaulenko:
So Hennessy will be?
Then, a link to an example from the terminal please.

I will.

The example from the terminal is a bit complicated, I am attaching my indicator. It calculates exactly the same as the example from the terminal, the code is written clearly.

Here is its start function:

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); 
      }
      Label1Buffer[i]=MathSqrt(sm/period);
   }

   return(rates_total);
  }

The task is to do the same without internal loop"for(int j=i-period+1;j<=i;j++){", similar to how MA is calculated in it.

Files:
stdX.mq5  6 kb