Login / Register
Add a review
Log in
Sign UP
[bws_google_captcha]

At the very least, this indicator is able to entertain you. It builds a sliding line based on interpolation by a polynomial of 1-4 degrees and / or a function composed of the sum of 1-5 sinusoids. Combinations are possible, for example, the sum of three sinusoids near a second-degree parabola. The constructed line can be extrapolated to any of the specified functions and to a different distance, both as a single point at each step of the indicator (the line is not changed), and as a section of the specified function (redrawn) to visualize the construction.

The indicator uses four lines. Each subsequent line of the indicator is based on the results of the previous one. Each line except the first one can be either averaging or extrapolating, depending on the specified direction: (-1) – averaging or (1) – extrapolation.

It is known that it is minimally necessary to draw two points to draw a straight line, three points to draw a square parabola, four points to draw a cubic parabola, etc.

A straight line is an arithmetic progression to get the third point after the first two:

Y3 = (Y2-Y1) Y2 = 2*Y2 – Y1 is a difference equation of the first degree for equidistant points (similar to the equation after reducing all the coefficients of the Lagrange equation).

[spoiler title=”Read More…”]

We use the formula of the sine of the double angle: Sin 2a = 2 * Cos a * Sin a. Geometrically, we can prove its validity in the form of Sin 2a = 2 * Cos a * Sin a-0 and, accordingly, Sin 3a = 2 * Cos a * Sin 2a – Sin a and so on, where Cos a is the cosine of the angle of one step, and Sin, in fact, the corresponding value of the graph. Then the difference equation of the first degree for a sinusoid near zero looks like: Y3 = 2 * Cos a * Y2 – Y1. We see a complete analogy with the equation for a straight line. In the indicator, the transition from trigonometric equations to linear ones is provided by assigning a period equal to one. Cos 360 is equal to 1, then the equation degenerates into a linear one.

  • line_1_power =12-the degree of the interpolating line. For a trigonometric function, a power of 2 corresponds to a single sinusoid near the constant. A power of 3 corresponds to a single sinusoid near an oblique straight line. A power of 4 corresponds to either one sinusoid near the square parabola, or two sinusoids near the constant, and so on. In this case, the 12 degree at the six periods assigned below corresponds to a function composed of 6 sinusoids near the constant.
  • line_1_leverage =10-the interpolation arm. Analogous to the averaging period. In particular, the first-degree interpolation line is fully consistent with the classical EMA with a period twice as long.
  • line_1_interval =1 – the interval between the neighboring points involved in the calculation. Not to be confused with the shoulder. In particular, a straight line connects three points, two of them are adjacent and one is removed by the shoulder distance.
  • line_1_period_1=6 – the period of the sinusoid, if the function is trigonometric. If the function is linear, the value is set to 1.
  • line_1_period_2=7.5
  • line_1_period_3=10
  • line_1_period_4=20
  • line_1_period_5=60
  • line_1_period_6=240
  • line_1_shift =0 – the shift of the indicator line. Positive values are shifted to the right, negative values are shifted to the left. By default, lines are drawn with the shoulder padding taken into account.
  • XXXXXXXXXXXXXXXXXXXXXXXX1=2-separator for parameters of different lines, for clarity.
  • line_2_trend =1 – the direction of the line calculation: (-1) – averaging, (1) – extrapolation.
  • line_2_power =10-the degree of the interpolating line. If the other parameters are the same as the averaging, then the second line will pass through the opening point of the last bar. The degrees 1001, 1002, 1003-1009, 1010 extrapolate the function section. This section of the function is redrawn on each bar and is used only for visualization.
  • line_2_leverage =8-the interpolation arm, the indicator draws one point on each value that is removed from this arm, and does not redraw even as the bar develops, since it relies on the opening point. In the case of degrees 1001, 1002, 1003-1009, 1010 sets the length of the section of the function to draw.
  • line_2_interval =1 – the interval between the neighboring points involved in the calculation.
  • line_2_period_1 =6 – the period of the sinusoid, if the function is trigonometric. If the function is linear, the value is set to 1.

There may be combinations of external parameters that take the line far away from the current price (large degrees, large leverage, an unsuccessful ratio of the sinusoid period and the leverage). This is not a program error. The easiest way is to open the beginning of the chart and see the character of the line. For example, interpolation by a polynomial of degree greater than the fourth in the indicator is mathematically possible, but the fluctuations of the average line grow rapidly in amplitude, resembling a resonance.

[/spoiler]

Add review
Reviews ( 0 ):