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

 
ANG3110:

We can also suggest the following simple method. The smoothing indicator should not change within a given range (20-40 points). And when it goes out of the range it will smoothly change. Then it will go flat - flat. Where it changes - a trend.
It only remains to calculate how many bars, or price increments, are on the horizontal sections and how many are on the changing sections.

This is how the ZZ channel is set up. It does not change within a given range. I think the principle is the same. And what smoothing indicator would you suggest? The one in the picture? It is a bit "tricky", doesn't it overdraw? But it is not so important for history evaluation.
 
Xadviser:

The heights of the segments must necessarily be counted for those that have been built.

Made


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

I guess it can be done. I'll have a look.

Just don't know when - probably as early as Sunday.

Files:
 
komposter:

Made

Simply awesome! A huge RESPECT to you!

However, the numbers are still hard to believe. (it really is a grail, although it shouldn't be. We need to look for an error. Maybe it is too small to estimate? How to check the data obtained. Maybe you may be able to run the Expert Advisor? If we opened by the simple rule, we would gain 2018 points of profit and 488 points of loss minus 24 trades * 3 points of spread = 72 points within this interval (without taking slippages into account).

Total 2018-488-72=1458 points of profit for about 43 days (4102 (15 min) / 4 / 24 = 42.7).


  1. Have I done all the calculations correctly?
  2. How do I set the measured area? Maybe a set number of bars could be added?
  3. It would be useful to add a set channel width to the report (wishful thinking)
 

Xadviser писал (а):
Однако в цифры до сих пор не верится. (действительно Грааль получается, хотя его быть не должно. Нужно искать ошибку)

Whoa, whoa, whoa, whoa... You're not confusing history with reality =)

I wrote right away - now we need to see what percentage of these trends don't disappear when the ZigZag is redrawn.

For this purpose we should either run testing in visual mode and try to trade by these "signals", or improve the script so that it calculates everything by itself.


Xadviser wrote (a):
How do you set the measured area? Maybe you can add a given number of bars?
It would be useful to add a set channel width to the report (wishful thinking)

Ok.

 

komposter писал (а):

Whoa, whoa, whoa, whoa... You're not confusing history with reality =)
I wrote right away - now we need to see what percentage of these trends do not disappear when the ZigZag is redrawn.
For this purpose we must either run testing in visual mode and try to trade by these "signals" or improve the script so that it calculates everything by itself

I do not seem to be confused. But in this scheme (if we understand each other correctly) TFS segments obtained are not redrawn. It is ZZ that may redraw depending on the fulfilment of its conditions.

The correct phrasing is: Each new TFS will be flat at the beginning, until the price reaches a certain level (equal to twice the width of the channel), then it becomes a trend one (conditionally the deal goes to Breakeven) and this trend does not disappear. The result we see in the history is that all flat trades are losing, and trend trades are profitable. If everything is calculated correctly (sum of separately flat and trend segments), the result will be exactly the same as in the report minus Spread*number of trades (slippage is naturally not considered)

 
Xadviser:

However, the numbers are still hard to believe. (There really is a grail, although there shouldn't be one. We need to look for an error).



Hmm, do you have a recipe for a perfect exit? Also, on the same flat you can usually catch a number of lots (although this time I did not look at the details of the calculation of statistics).
 

lna01 писал (а): Хм, у Вас есть рецепт идеального выхода из позиции?

That's just it, no. That was not the objective at all. The idea was to collect statistics and find out whether the data would be applicable to the development of another TS. It is, so to speak, a "side" effect =)

If we open trades "directly" on the border of a channel for its breakthrough, i.e. each time it is a flip, then graphically each flat segment will be a loss and each trend segment will be a profit

Besides on one and the same flat we can usually catch several losses (although I haven't checked details of statistics calculation this time).

Therefore there will not be several losses at each separate flat.

So far the first suspicion is that a short interval is chosen for estimation

 
Xadviser:

In addition, on the same flat, it is usually possible to catch more than one loss (although I didn't look at the details of the statistics calculation this time).

That is why there will not be more than one loss on each separate flat

Yes, it seems that there won't be additional losses on each flat. Shouldn't we subtract the channel width from the trend spread? It should be a breakthrough entry.
 
lna01:
It will not affect the time factor, that is what I have already mentioned. And the channel width should not be subtracted from the trend spread? It's a breakthrough entry.

Just look at the picture carefully. Not to be confused with ZZ segments. TFS formed "go" from the border to the border of the channel in any case, whether trending or flat. There is no need to take anything away. If we compare with the ZZ segment, it is exactly larger (longer) by two channel widths, as I've already mentioned. That's why Andrei redid the calculation of the statistics. But it turned out (what is on the picture) on Euro and in a given interval. For other pairs (I checked pound) it looks 50/50, which is "better", i.e. seems more reliable to me. Although, if I run it through all of them and with different channel widths, I can find "interesting" variants.



I initially tied to ZZ points for ease of calculation. It will not affect the value in pips, while the time factor will.

The segments marked in another colour are "timed" to actual trades, as if they were opened when the price and the channel border value were equal.

 
ANG3110:

How the channel of this ZZ is set up, of course, I know very well, because I wrote the original code myself, but Andrey (komposter) used it for the purpose in question, which I don't mind.

You should also tweak it, because it sometimes draws segments wrong =) And it would be nice to add some extras to it. But in general I like it very much.

The smoothing indicator shown on the chart is overdrawn, but not significantly. In principle you can use any filter, any mouvings, regression or DCT - it will be a little better against sharp spikes, but it's not so important. More important in my opinion is how the trading logic is handled during trend and flat.

The trading logic is not handled in any way. The purpose was to get statistical data about prices in flat and trend according to time (number of bars) and magnitude in pips for the specified conditions of the trend and flat for possible use in different TS.

As a "side result" it appears that for some parameters we have a significant advantage of trend segments over flat ones. That is why there is a task to check the validity of the obtained data and it's a question of trading.

Because if used properly, it is possible to earn even more on some flat sections than on trend ones.

I totally agree. Again, it's not about making trading criteria for the TS yet

Reason: