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

 
  • komposter:

    Analysis - yes, to any data. Just an example of analysis: "here is the EURUSD H1 chart for such a period, here is the statistics, we draw such-and-such conclusions, etc.".

    In my opinion the answer is obvious, and if obvious, it does not imply a question, but if the question is there, it means I did not understand the question or there is a deeper question under the(literally) obvious one, the meaning of which escapes me :))

Let's try again. But first, I want to emphasize again the purpose of our research - it is to answer the question of what dominates the market flat or trend .

We didn't try to find the answer as to how a trend differs from a flat condition (we set this distinction externally) or to build some TS. I.e. we needed to investigate the phenomenon by obtaining statistical reports, nothing more.

However, to answer this difficult question, we needed to introduce criteria for flat and trend. As some panelists pointed out:

lna01 wrote (a):

I think if the market is 100% fractal, then the trend/flat ratio should be the same for any timeframe (while of course it may depend on the "measurement" technique). If the ratio turns out to depend on the timeframe, it may be one of the factors influencing the choice of the working timeframe. The methodology, imho, should be oriented to the intended game strategy. I did not do such research myself, the time horizon of the game is determined by other considerations.

But the results would be interesting.

grasn 28.03.2008 14:17


to Xadviser.

In my opinion, I would classify your question as one of the fundamental, largely determining the search for strategies with statistical advantage. Understanding it the way I wrote - spent some time to answer the question, at least for myself. But unfortunately the search for solutions and answers lie more in the philosophical plane, as there is no strict criterion.

Identification of the criterion is the most important requirement for the solution of the problem.

I suggested to select as a criterion a certain range, within which the price movement would be considered a flat, and when it exceeds the value equal to (in fact, double) the width of the set range - a trend. The beginning and the end of each definition (of a trend and a flat) should be considered as the opposite border of the range (the setting channel). See pictures on the page 6 of this branch(here).

My reasoning was as follows. Suppose the price movement of one tick. One up, one down, ... one up, one down.... Where is the equilibrium state of the price in this case? There isn't one. Because the changes are discrete (change by a small but fixed amount). In other words, the price has two stable states simultaneously (uncertainty principle :)), which is set by a certain value (in this example, the value of one tick). But in reality we cannot use such a value, but nobody prevents us from scaling up this example - to set this value from outside, independently. Thus the criterion was set. It remains to check the assumptions put forward concerning an equal ratio of trend sections to flat segments (trend-flat segments, hereinafter TFS) and to what extent the results will differ depending on the set parameters (channel width).

SK. 30.03.2008 19:00
.... When you figure it out, let us know, it will be interesting to hear. In the general case, of course, everything will be different.

An elite division of programmers was engaged in solving this problem, and thanks to the heroic work of Mr. Composter we have obtained a unique tool for assessing the trendiness and flatness of currency pairs.

The results were close to the expected ones and (for some pairs) even showed some trend. But no strong dependencies (differences from the width of a given channel) were found (in relation to one currency pair (GP)), which was confirmed in his research by Candide. See p_14 (here).


The data obtained provide a great deal of room for investigation. In particular, it is obtained:
  • TFS ranges by time (number of bars) and size (length in pips)
  • maximum, minimum and average values of the TFS
  • sums of all SST and their ratio on the given (analyzed) interval
  • maximal sequences of TFs meeting one criterion (either trend or flat) and their sizes in bars and points
  • maximum widest (in bars) and longest (in points) sequence of SSTs and their sizes

See fig. 1. View of EA's report with specified parameters - 30, 60, 90 pips. (See Indicator Points line)


Fig_1


What conclusions can be drawn from this report.

The first thing that catches your eye is TFS ratio that does not change much, both in width and length, depending on the set range, which confirms the initial assumption that there is no such a dependence. It means that selection of a trading range for trading should be determined by other factors (like range-to-spread ratio, frequency of transactions, permissible drawdown level, etc.). The applicability of the obtained data is possible practically at any TF.

The second one is that on a quite long time interval we have a small, but statistical advantage, which can be increased (below is a list of variants in the first approximation)

  • using analogous channels, but by "playing along" with the younger channel (of a smaller range) by priority of the higher one. i.e. to open on the lower one from opposite channels only in the direction where the higher one was pointing. (Example: see pictures on p. 15 of this thread)
    .
  • or vice versa, evaluating a move inside the higher channel as a flat one, open on the lower one from the border to the inside.
  • using some other (still to be thought over) algorithm for increasing positions in the direction specified by the criterion.
  • using unrelated pairs with the same trend (unrelated - those which do not have the same values (names) in pairs).

Third. This evaluation method can be used on different trading instruments.

Fourth. With the help of such statistics (combined with other criteria, characteristics etc. as applied to a currency pair) you can form other trading criteria for manual or automatic trading.

The obtained data is obviously not enough for making generalized conclusions (it is necessary to collect data from various currency pairs, with different parameters, on different analyzed timeframes, and double-check them). However, everyone will decide for himself about necessity and usefulness of such studies for his own tasks, as well as their applicability to the synthesis of trading criteria in his TS.

 

Here, have a look at ;)


TrendFletAnalysis - EURUSD (1999.01.04-2008.04.16)


X-axis - indicator "Points" parameter. Y-axis - ratio of total trend areas height to the total height of flat areas. Conclusions are up to you. In the trailer - xls with data for the chart.

Files:
tfa_eurusd.rar  16 kb
 

To finalise the report.

In the figure I have shown flat segments with zero level, but not with the zero number of bars (which cannot be less than 1).


Therefore, time (number of bars) of both flat (increase) and trend (decrease) sections will not be calculated correctly. It will not influence the value in points. The average in pips based on the total number of segments calculated will also not be indicative, because there will be a significant number of "zero" segments. Since the maximum number of successive segments will not be significant (so far in our experience it has not exceeded 10), you can specify the number of encountered (on the studied interval) sequences in increments of 1.

Some more corrections.

- there is no point in specifying report lines indicating minimal widths for TFS in bars and points, as these values are always close to or equal to zero (which is not principal)

 

The first time, for some reason, it didn't render on the wide channel. But then it worked. I drew the channels to make it clearer.

This is a counter-trend technique - CTT. I drew the trend (profit) sections of the upper channel in yellow. I did not draw flat areas of the upper channel.

I used the variant of closing trades by "signals" (levels) of the upper channel. The advantages of this method cannot be seen in this figure; on the contrary, all closings are longer (marked in bright pink)


On this picture (the fourth and seventh position from the left is a losing trade) we can see that owing to a stop at the level of the higher channel the loss is limited in comparison with the adjacent green and red segment respectively (I have not marked it in the picture, unfortunately, but I hope it is clear from the description). In this figure you can also see that application of levels of the higher channel does not seem to give advantages (two of seven deals were limited, while five deals increased on the contrary), but it is too early to draw conclusions, the analyzed timeframe is too small.


This figure shows trend-following technique - PTT. You can see missing trend segments of the junior channel.


On this figure is also a PTT, but taking into account the logic of opening (closing) including levels of the higher channel. We can see a significant (by this plot) gain in profitable segments.

However, more reliable conclusions can be drawn after investigating a more significant portion of history.

 

Here is what we have at the moment:


Tactic 1: Trade against the broader channel trend (in an uptrend we only open a sell, and vice versa).


The thickest solid lines are the 200p channel.

The middle solid lines are the 100 p channel, and positions would have been opened on them (bright colours - profit, pale - loss).
Thin dashed lines - channel 100 p, positions cancelled by the older channel (colours similar).


Tactic 2: trade in the direction of the trend of the wider channel (in an uptrend, we open only buy, and vice versa).


The legend is similar.


Tactic 3: trade in the direction of the broader channel trend + open in the extremums of the wider channel when the direction coincides with an existing narrower channel segment.


Additions to the legend:
blue lines - profitable positions opened at extremums of the wider channel (both buy and sell);
crimson lines (not shown in the figure) - similar losing positions (both buy and sell).

 

Testing has revealed some unpleasant things: The statistics looks like this


In the tester it is 0. Presumably, this is due to opening on the bar following the "break".

 
imsgfx:

Testing has revealed some unpleasant things: The statistics looks like this

What TF was used? 30-point ZZs can only be counted on minutes.

imsgfx wrote (a):
And in the tester it's 0. Presumably it's because of opening on the bar following the "break"

This has nothing to do with it. The statistics takes into account everything except spread and swap.
I.e. test result should differ ~ by Count*Spread.

Try to test with Points = 100.

 
komposter:
What TF was used? 30-point ZZs can only be counted on minutes.

D1


In real trade I have been working on 30 pips on 1 minute. I made about 10 trades, got a slight drawback (about $15). If we start with several orders with different targets, for example 15, 30 pips and an order before the break, imho, we can improve the results, because even flat deals were in the plus, not to mention the trend deals.

 
imsgfx:

D1

No comments =)))

imsgfx:

In real time I sat for a whole day on minutes with 30 pips. About 10 trades, slight loss (about $15). If I started with several orders with different targets, for example, 15, 30 pips and an order before the break, the indices may improve, because even flat deals were profitable, not to mention trend deals.

I honestly warned about the real trade - you should not use the Expert Advisor even on a demo, it is not for that...

 
komposter:

I honestly warned you about the real EA - you can't even hang it on the demo, that's not what it's for...

I have not and cannot have any pretensions to the Expert Advisor (I have only removed the ticket definition line from the lock function). It has worked well but its discrepancy with real statistics has become clearer.

The break point is located, for example, on the pre-bar 102.40. And opening of next bar is 102.45 + 2 points of spread, so it results in the divergence of 7 points only on one trade. All stat. advantage slowly but surely melts away. And not only because of spreads and swaps.