Difference calculus, examples. - page 3

 
Nikolai Semko:


That's not what I meant. I didn't say that"in interpolation it's a 'tracer', and not a regression at all."

Honestly, I don't even understand the meaning of that phrase.
I meant that all types of interpolation are redrawable ( and your version is redrawable too). And only the tracing trace from these interpolation functions is not redrawable, which I backed up my words with animated gifs. I advise to study them again carefully. In these gifs, the tracing trace is a two-color blue-violet line. But it is not an interpolation function. The blue color means that the interpolation function at this point is upward, and the purple one is downward.
If the polynomial degree is 0, this trace is a Moving Avarage


These buffers are not redrawn. The first one is interpolation, the second one is extrapolation. You can see from the code that every bar has the same value.

 
      a1_Buffer[i]=((open[i] - Znach)    +5061600*a1_Buffer[i+1 ]-7489800   *a1_Buffer[i+2 ]+4926624*a1_Buffer[i+3 ]-1215450*a1_Buffer[i+4 ])/1282975;

      a2_Buffer[i]=  3160*a1_Buffer[i]   -6240   *a1_Buffer[i+1 ]    +  3081*a1_Buffer[i+2 ];
 
Nikolai Semko:


That's not what I meant. I didn't say that"in interpolation it's a 'tracer', and not a regression at all."

Honestly, I don't even understand the meaning of that phrase.
I meant that all types of interpolation are redrawable ( and your version is redrawable too). And only the tracing trace from these interpolation functions is not redrawable, which I backed up my words with animated gifs. I advise to study them again carefully. In these gifs, the tracing trace is a two-color blue-violet line. But it is not an interpolation function. The blue color means that the interpolation function at this point is upward, and the purple one is downward.
If the polynomial degree is 0, this trace is a Moving Avarage


and with what and how did you shoot the video?
(eternally torturing question, because it is painfully painful for any "non-artist" to design software for the market :-) it's easier to write )
 

I added more redrawable construction lines: the first (red), second (gray) and third (green) degrees.

      a1_Buffer[i]=((open[i] - Znach)    +5061600*a1_Buffer[i+1 ]-7489800   *a1_Buffer[i+2 ]+4926624*a1_Buffer[i+3 ]-1215450*a1_Buffer[i+4 ])/1282975;

      a2_Buffer[i]=  2701*a1_Buffer[i]   -5328   *a1_Buffer[i+1 ]    +  2628 *a1_Buffer[i+2 ];

      a4_Buffer[i+92]=a1_Buffer[i];   if(i<=1) { for(z=92-1;z>=0;z--){        a4_Buffer[i+0+z]=  5*a4_Buffer[i+1+z]  -  10*a4_Buffer[i+2+z]   +   10* a4_Buffer[i+3+z]  -  5*a4_Buffer[i+4+z]  +  1*a4_Buffer[i+5+z];  }}

      a3_Buffer[i+92]=a1_Buffer[i];   if(i<=1) { for(z=92-1;z>=0;z--){        a3_Buffer[i+0+z]=  4*a3_Buffer[i+1+z]  -  6*a3_Buffer[i+2+z]   +   4*a3_Buffer[i+3+z]  -  1*a3_Buffer[i+4+z] ;  }}

      a5_Buffer[i+92]=a1_Buffer[i];   if(i<=1) { for(z=92-1;z>=0;z--){        a5_Buffer[i+0+z]=  3*a5_Buffer[i+1+z]  -  3*a5_Buffer[i+2+z]   +   1*a5_Buffer[i+3+z]   ;  }}

      a6_Buffer[i+92]=a1_Buffer[i];   if(i<=1) { for(z=92-1;z>=0;z--){        a6_Buffer[i+0+z]=  2*a6_Buffer[i+1+z]  -  1*a6_Buffer[i+2+z]     ;  }}

//----
   SetIndexShift(2,-72);
   SetIndexShift(5,20);
   SetIndexShift(4,20);
   SetIndexShift(0,20);
   SetIndexShift(1,20);

Got it:

The polynomial of the second degree (gray) touches the extrapolated line at the last point, as it should.

 
Aleksey Panfilov:

I propose to collect indicators and experts on the difference calculus in this branch in the open source code.

If there will be interest, we will eventually gather or draw something useful. :)

I rewrote the indicator in a clearer variant as an example:


Compare Julian and Gregorian calendars with the Chinese New Year.

 
Vladimir Zubov:

Compare the Julian and Gregorian calendars with the Chinese New Year.


I'm curious. Why? )))

Are you drawing a parallel with difference and differential calculus?

I think it is quite justified. )))

 
Yousufkhodja Sultonov:

Have you tried this formula?

Y = a0 + a1X + a2X^2 + a3X^3 + a4X^4


Try with this formula:

Y = a0 + a1X + a2X^3 + a3X^5

 
Petr Doroshenko:

Try this formula:

Y = a0 + a1X + a2X^3 + a3X^5

I can and Y = a0 + a1X + a2X^3 + a3X^5 + a4X^7, but, what is the point? How do you justify this particular approach?

Currently doing:

X5 = a0 + a1X1 + a2X2 + a3X3 + a4X4

I.e., I examine the dependence of the price of the last bar (X5) on the prices of the previous 4 bars (X1, X2, X3, X4) and look at the changes of a0, a1, a2, a3, a4. Interesting things are coming out and I will soon report the results.

 
Maxim Kuznetsov:
How did you shoot the video?
(this is always a painful question, because it is painfully painful for any "non-artist" to make a software for the Market :-) it's easier to write )

Capturing video from the screen and forming a gif-file from it was done with Camtasia 9. There is a lot of information on YouTube.

 
Aleksey Panfilov:

These buffers are not redrawn. The first is interpolation, the second is extrapolation. As you can see from the code, there is one value on every bar.


Yes, I was mistaken. I thought you were really using approximation. I took a closer look at your code and realized that it is not an approximation, but just a trivial averaging, albeit very unusual. After that you move the purple line and the red line 72 bars to the left and finish drawing the red tail of 92 bars, and it is redrawn with every new bar. The blue line is formed from the shifted purple line. And by the way, it is more correct to use the close price rather than the open one. If you change it to close, you can immediately see that the red tail of 92 bars jumps with every tick.

Shifting to the left of the moving averages has no usefulness and practical application. It only serves for beauty, fit and charm.

I need to understand the difference between approximation and smoothing. When approximating, coefficients of a function (polynomial, Fourier, Bezier, spline, etc.) are calculated on a given data interval, and as a rule, these coefficients all change when at least one data value changes, so the function is redrawn on the entire observed data interval. But when averaging, only one current point on the basis of previous data is considered, therefore averaging (smoothing) is not redrawn, but always lags behind the data unlike approximation.
And I do not understand what the polynomial of some degree and Newton's binomial have to do with it, if even there are no degrees in the code.

 

Hi there, Boys.

No, it's all interesting, of course. From the point of view of employment. But! Various tricks with transferring the result and drawing lines in the past period??? In your example { (Like)a4_Buffer[i+0+z]= 5*a4_Buffer [i+1+z] and TD. } What can this lead to? Correct! To getting the result on the last tick and the possibility to use it only on the chart. In the form of a completely amazing picture.

Reason: