The FLET formula

 

How do you programmatically define a flat?

 
And trend :)
 
In fact, look at the AMA indicator in codebase, there is something there
 
chell писал(а) >>

How do I programmatically define a flat?

Any quotation consists only of trend and flat sections. By identifying the flat areas, we automatically identify the trend areas. Obviously, by identifying the trend we get a kind of a printing press of unlimited power, capable to overturn the entire existing financial system within about a year. This is nonsense! Therefore, we cannot programmatically determine the flat. Sleep well.

 
Neutron писал(а) >>

Consequently, it is not possible to define a flat programmatically. Sleep well.

Bummer)))

 

It has been said, quite rightly, that a flat is an abstract phenomenon, and by constantly scaling the view of the market, it can be argued that there is always a trend. And since a trend and a flat are in some way mutually exclusive, there is no flat at all.

It is hard to identify a flat on each TF, and in fact it is not real software. However, there are indicators, such as Alligator, that, as a result of substitution of notions, show not a flat, but rather "a situation, undefined for a particular indicator". If you are happy with this state of affairs, you can look in this direction.

 

If we adhere to some mathematical rigor, then on a particular TF and only on historical data we can distinguish trend and flat areas of the quotes according to certain attributes (they have been mentioned several times in this forum). Unfortunately, at the right border of quotes (when one cannot look into the future) we cannot distinguish these segments, because of some fundamental reasons, in particular because of very weak predictability of financial timeseries, that is what provides the market efficiency - its main quality.

 

a)

Flat areas are distinguished very simply:
1. by sight,
2. by planimetry
3. as well as by technical indicators which have a threshold (measure) in their formula.

б)

Unfortunately, the flat is not an abstract notion, as there is, for example, a spread.

 
Let's put our heads together and write a series of indicators that define TRAND and FLAT proper...
 
Take a look YOUTH the man "Tries to write a trend indicator", why don't we try it?)
 
chell писал(а) >>
Look here, the man "Tries to write a trend indicator", why don't we try it?)

I absolutely agree with others that flat is an abstract concept. The usual approach to this problem is as follows:

1. We write two Expert Advisors, one for trading on the flat, the other - on the trend.

2. Add different filters of loss trades to both EAs and optimize their thresholds in order to increase the balance. These filters of loss trades will be YOUR (and only YOUR) conditions for trend and flat

3. Combine the two EAs in one, and off you go!

A more correct and vital question would be: What filters of losing trades can be applied for a trend or flat (they are different)?