Calculation of the slope angle of the trend line. - page 23

 
Valeriy Yastremskiy:

Let's simplify the problem. 2 one-dimensional arrays of the same length N. The first has speeds, the second has bar numbers. I don't like multidimensional arrays and writing them down. But let's write it as a two-dimensional array for clarity

index 1 2 3 4 5 6 7 8 9 10 11 12 13 14

Values 5,4, 7,8 6,11 4,14 -2,17 3,19 6,24 5,27 9,29 12,32 15,36 13,39 16,43 12,45

You can see that the break occurred on index 9 and from index 10 the average price has changed. How to find /reveal index 9 and 29 bars.

Change detection problem. Perhaps something like CUSUM would work.

 
Aleksey Nikolayev:

Achange detection task. Maybe something like CUSUM would work.

From Wiki: When S value exceeds a certain threshold value, a change in value has been detected. The above formula detects changes only in the positive direction. When negative changes are to be found, as well, the min operation should be used instead of the maximum operation, and this time a change has been detected when the S value is below the (negative) threshold value.

It was the first thing that came to mind)))

I'll probably have to do some checks. If it's more than calculated corridor width by the first sliding window and then sliding window of 3 - 5 values, go to average, nominal and if several windows in sequence, it means corridor, if window parameters in next step go too high, then no corridor.

 
Valeriy Yastremskiy:

Let's simplify the problem. 2 one-dimensional arrays of the same length N. The first has speeds, the second has bar numbers. I don't like multidimensional arrays and writing them down. But let's write it as a two-dimensional array for clarity

index 1 2 3 4 5 6 7 8 9 10 11 12 13 14

Values 5,4, 7,8 6,11 4,14 -2,17 3,19 6,24 5,27 9,29 12,32 15,36 13,39 16,43 12,45

You can see that the break occurred on index 9 and from index 10 the average price has changed. How to find/identify index 9 and 29 bar.

I don't know what's in your head and on what principles you consider a channel to be a channel to determine when it ceases to be a channel. You have to try different variants and check visually - whether the result corresponds to the idea of it.

And if simple solutions are satisfactory, then the average direction (i.e. the difference in values on two neighbouring bars) must be counted and if it has changed.
 
Aleksey Nikolayev:

Change detection task. Perhaps something like CUSUM would work.

Can you tell me in your own words what CUSUM is and how it's implemented?

===

123
===

The method is of course a masterpiece, and how deeply thought-out! What the hell - Cambridge! Are you guys all incapable of using your own brains, even formulas in arithmetic only with reference to an authoritative publication?

===

Alexei, and if the raw data can take negative values? That's it, a mathematical disaster?

 
Dmitry Fedoseev:

I don't know what's in your head and on what principles you consider a channel to be a channel to determine when it ceases to be a channel. You have to try different variants and check visually whether the result corresponds to what you imagine it to be.

In everyone's mind, if you draw it you can clearly see where the changes are. On 9. This is in general I agree, it's a problem to solve, but I don't like the CUSUM solution. It then needs filters from single outliers. So far a sliding window. The cumulative calculation is not very good.

 
Valeriy Yastremskiy:

In everyone's head, if you draw it you can clearly see where the changes are. On 9. This is generally agreed to be the problem, but I don't like the CUSUM solution. It then needs filters from single outliers. So far a sliding window. Cumulatively calculate is not very good.

So you should not draw, and there must be a dozen or two algorithms in the piggy bank of ideas - apply them and see if the problem is satisfactorily solved.

 
Dmitry Fedoseev:

So you should not draw, but have a dozen or two algorithms in a piggy bank of ideas - apply them and see if the problem is satisfactorily solved.

Well, that's why I'm asking, in case there are solutions). Of course, I will make them myself, but the first solution is not always rational, and I want a nice-looking one. The usual statistics is still for the stationary state, even in the presence of some SB. I just thought that turning a channel with random values has at least some solutions, but I haven't found what I wanted.

 
Valeriy Yastremskiy:

So I'm asking if there are any solutions). Of course I will do it myself, but the first solution is not always rational, and I want a nice look. The usual statistics is still for stationary states, even in the presence of some SB. I just thought, that rotation of the channel with random values has at least some solutions, but I haven't found what I wanted.

What do you mean by "solutions"? From Cambridge, by authoritative authorship?

There are 1,000 of these solutions. You just have to sit and try until you see a satisfactory result.

 

What is the OBJPROP_ANGLE parameter for the trend line ?

For some reason, when a trendline is created, it is always read=0

Although, when rotating the trend line, an angle is displayed, i.e. the developers calculate the angle

 
IuriiPrugov:

What is the OBJPROP_ANGLE parameter for the trend line ?

For some reason, when a trendline is created, it is always read=0

Although, when rotating the trend line, an angle is displayed, i.e. the developers calculate the angle

The angle is in the screen coordinates. The developers have tried, the line holds the angle, but if you change the scale of the graph, the line itself floats away.

It must be assumed that this is a tool for Gann analysis - in fixed coordinates.

Reason: