Market condition - flat or trend? Which dominates? - page 9

 

Slightly modified komposter' s script. Now it writes trend and flat percentages for each successive Sample segment of a zone into a file. If we use this data to draw chronological trend percent sequences for zones with 20, 30, 40 and 50 point thresholds, we will get the following picture. Interpret to your liking :).


TFA


P.S. I completely forgot, the picture for Sample = 100.
 

If you record and time, you can draw a similar but synchronised picture.


TFA

 
komposter:

But I have another idea - to see what percentage of these "trends" are lost in the real-time analysis.

If at least half of the trends are detected correctly from the start - it's a mega-grial =)

Unfortunately, nothing can be det ected beforehand. But "Graality" can be quickly calculated as follows:
Add up all trend segments by height in np
Add all flat segments to the height of the point
Subtract one from the other (the smaller of the two) minus the spread *number of all segments
A comparison of the sums of lengths in F/T bars would also be interesting and I think even more revealing

 

I would like to go back to the statistics. In order to do so, we need to get a more detailed picture. I.e. we should have the following table



Flat Trend
total bars counted (or time frame)

number of bars


minimum interval in pps


Maximum bar in nb


average value of the interval in nb

min time (bars)


Maximum length (bars)


average value of the interval in bars


sum of all sections in np


sum of all sections by number of bars


bar to bar ratio in %

the ratio by the sum of bars in %


It is even more correct and beautiful to obtain the distribution of the resulting segments. It is clear that for a flat segment the limitation will be the width of the specified range (channel).
But we'd like to see the basic concentration (and how it coincides with the average value).

For the trend segment there will be no limit on the maximum value and it will be limited by its presence in the history. This may serve as a starting point for necessary calculations
in some TS. The distribution of trend segments is more instructive than that of flat segments and should be closer to normal (Gaussian). The basic concentration can also
be used in the development of the TS.

 
lna01:

Slightly modified komposter' s script. Now it writes trend and flat percentages for each successive Sample segment of WP into a file. If using those data we draw chronological trend percent sequences for the zones with 20, 30, 40 and 50 points thresholds, we will obtain the following picture. Interpret to your liking :).

P.S. Completely forgot, image for Sample = 100.

Please explain what is "consecutive Sample" ? Is it how the percentage changed from the reference point? What is on the x-axis?

Was it you counting the ratio of time sections ? What would the ratio look like in pp ?
 
Xadviser:

I would like to go back to the statistics. In order to do so, we need to get a more detailed picture. I.e. we should have a table like this

Noted. As soon as I am free, I will do it.
 
Xadviser:

Please explain what is "consecutive Sample" ? Is it how did the percentage change from the reference point ? What's on the x-axis ?

Was it you counting the ratio of time plots ? What would the ratio look like in pp ?

Sample - the number of zigzag segments on the history section, for which the trend/float ratio is calculated. I.e. the original komposter script calculates it for the whole history, whereas my modification splits this history into consecutive chunks and independently analyzes each of them. The length of pieces is such, that each of them contains exactly Sample (which is 100 in this case) zigzag segments. Thus, the horizontal axis in the first image represents just the index number of a segment of the history, while the second image represents the difference between the time of the end of the segment and the time of the first bar in the history, in minutes.

By the way, the data for the pictures is derived from eurusd5, from mid-2004.


What is meant by "ratio in pp" I don't quite understand, what ratio to what exactly?

 
lna01:

Sample - the number of zigzag segments on the history section for which the trend / flat ratio is calculated. That is, the original komposter script calculates it for the whole history, whereas my modification splits the history into consecutive parts and works independently on each of them. The length of pieces is such, that each of them contains exactly Sample (which is 100 in this case) zigzag segments. Thus, on the horizontal axis in the first image, it is the index number of a segment of the history, and on the second one - the difference between the end time of the segment and the time of the first bar in the history, in minutes.

Thank you. Now I get it. It seems that the wider the channel, the greater the resilience

And it is also interesting at what moments (dates) of time the maximal peaks occurred. Particularly with a 50pp channel?

I don't quite understand what is meant by "ratio in pp", what is the ratio to what exactly?

The script, which was made by Andrey and corrected by you, considers the length of obtained segments in bars (i.e. the number of bars on the segment)

I have a suggestion to calculate the height in points (pps) of the obtained flat and trend segments respectively, and also to compare them.

I assume that we will get the inverse dependence and as a consequence - the market equilibrium. There are more points in a shorter time and fewer points in a longer time. How will it be in reality?

 

Get it, sign it =)

Made a new version, stats looks like this now:


All who downloaded indicator from this thread - rename it to "ZZm-fx-txt.mq4"!

PS: the height of the bars (in pips) is counted by the ZigZag rays. In principle, there is an option to count by constructed segments. I don't know how to do it correctly.

Files:
 
komposter:

Receive, sign =)

PS: the height of the segments (in points) is counted from the ZigZag rays. In principle, there is an option of counting by constructed segments. How to get it right - don't know.

All very cool! But it requires some fine-tuning:

Height segments (segments) need to be sure to count those that are built. I propose to name them something. For example: TFS (trend-flat segments) or TFO (segments). If we count lengths of ZZ segments, the trend segments will be two times wider than the channel width. Flat segments will also increase, but not as much as trend segments.

Their interpretation looks as follows. If statistics shows us an advantage of trend segments, for example, then we select the condition of opening positions upon a break in the channel. Then the sum of trend segments is a profit in pips while the sum of flat segments is a loss in pips. That's if we open positions "directly" without any tricks.

There is one more controversial point. I pointed points on the opposite edges of the GZ channel (on which the TFS were obtained) for perception and possible calculation ease. However, a slightly different interpretation is possible. It does not influence the size in pps, but the number of bars, i.e. time spent in the trend/flat state has a significant effect. Actually it turns out that we get a signal of a new trend or flat when the price reaches the channel border. If we approach it formally, almost nothing will change. The obtained TFSs will shift and the overall result will be almost unaffected. Because both flat and trend segments will be shifted. See Fig. 1.


Fig. 1

However, if we approach it not formally, but creatively, it would be correct to finish the trend segment at the maximum and "stretch" the flat segment to the beginning of a new trend one. Such an arrangement would substantially affect the time correlations of TFS, since not only the flattish areas would increase, but the trend areas would decrease as well. See Fig. 2


Fig2

How problematic is it to implement this algorithm? I think this approach to counting (estimation) is more objective. What do you think?
Reason: