From theory to practice. Part 2 - page 97

 

I know there are people in this thread who like zigzags ;)

Let's say there is a zigzag that has one parameter - the minimum price step in pips and there is a currency pair, for example EURUSD.

How can I choose the optimal step? I cut segments of the zigzag, some of them are noisy, so how can I find out whether this configuration of the zigzag with such a minimal step is good for the current symbol? What should I analyze these sections for?

 
Looks like everyone's gone to the Sports Lotto. Because that's where the Grail is.
 

Zhenya, I like it. Make a simple EA, for example, when registering a wave up we buy (or sell) and down we flip. Then you find in the optimizer the value of the minimum step at which you get the most profit for the whole period.

But then the following picture is obtained: in some years the profit is stagnating, in other years it is falling, in other years it is growing. It turns out that we have picked the median movement size for the whole period, but within it there are periods with another best zig-zag wavelength size. That is, the median length changes all the time, but its change is not abrupt. It can hold for years. The question is how to find a tool that breaks the period into segments with the same price behaviour.

 
Aleksei Stepanenko:

Zhenya, I like it. Make a simple EA, for example, when registering a wave up we buy (or sell) and down we flip. Then you find in the optimizer the value of the minimum step at which you get the most profit for the whole period.

But further the following picture is obtained: in some years the profit is stagnating, in other years it is falling, in other years it is growing. It turns out that we have picked the median movement size for the whole period, but within it there are periods with another best zig-zag wavelength size. That is, the median length changes all the time, but its change is not abrupt. It can hold for years. The question is how to find a tool that splits the period into segments with the same price behaviour.


Thank you, that's an interesting idea.

 
Evgeniy Chumakov:

I know there are people in this thread who like zigzags ;)

Let's say there is a zigzag that has one parameter - the minimum price step in pips and there is a currency pair, for example EURUSD.

How can I choose the optimal step? I cut segments of the zigzag, some of them are noisy, so how can I find out whether this configuration of the zigzag with such a minimal step is good for the current symbol? What should I analyze the obtained segments for?

I like them as they are convenient when using the matstat. If z0 is a zigzag parameter and z is knee height, then for SB the value z/z0 - 1 has a standard exponential distribution. Accordingly, look for conditions under which the zigzag knee distribution for real prices differs as much as possible from that for SB.

 
Aleksey Nikolayev:

I like it as it is convenient when using a matstat. If z0 is the zigzag parameter and z is the knee height, then for SB the value z/z0 - 1 has a standard exponential distribution. Accordingly, look for conditions under which the zigzag knee distribution for real prices differs as much as possible from that for SB.


Thank you!

 
Evgeniy Chumakov:


Thank you!

For EURUSD with ZZ step 100 pips (5 digits) I got this histogram:



If you want to work visually, it is better to compare with a uniform distribution on a segment from 0 to 1. To do so, you can plot a histogram for the value 1 - exp(1 - z/z0) and draw a straight line segment y=1. If the histogram is "skewed" to the right, we can talk about trendiness, while if it is skewed to the left, we can talk about flatness. Usually it is not very clear where it is oblique and deviations from the uniformity are not very significant. One can see how the picture changes depending on z0 and select knees by some rules (just don't look into the future).

 
Evgeniy Chumakov:


Thank you!

For EURUSD with ZZ step 100 pips (5 digits) I got this histogram:



It's nice to see how someone uses statistics)

 
Aleksey Nikolayev:

If you want to work visually, it is better to compare with a uniform distribution on a segment from 0 to 1. To do this, you can plot a histogram for the value 1 - exp(1 - z/z0) and draw a straight line segment y=1. If the histogram is "skewed" to the right, we can talk about trendiness, while if it is skewed to the left, we can talk about flatness. Usually it is not very clear where it is skewed and its deviations from flatness are not very significant. You could look at how the picture changes depending on z0, and also do some sort of knee selection by some rules (just not looking ahead).


Thanks again! Now that's constructive dialogue in this thread. Because I have a lot of creative thoughts, but no knowledge of how to approach the issue correctly.

 

Genghis is right, it feels good.

As for the statistics themselves, it appears that short knees will recur frequently, medium knees less frequently, and long knees rarely. A smooth descending line without much disturbance. There's no money to be made from it. We should think about finding and combining price segments with similar knee lengths as much as possible. The search options are: by position in the trend, by amplitude, by period of fluctuations, and some other things that I do not know.