A statistical EA

 

As a follwo up, here's a statistic EA that does this:

Day by day, calculate the following:

1) number of consecutive ticks in an uptrend

2) number of successive ticks in a downtrend

3) the maximum successive ticks in both direction and the time it was found

4) Assuming I just bought on every uptrend, what's the profit

5) Assuming I sold for every downtrend, what's the profit

6) what's the maximum in both cases and when was that found

It is interesting to use this with multiple currencies. I did it in just over an hour, so it may have errors so please help in finding them.

Such code is just one step to find an answer to this question:

Q: Are there hidden patterns? How/when do they evolve to different currencies at different times?

It is somewhat relevant to my earlier post here:

https://www.mql5.com/en/forum/175872

If you noticed, assuming that we had a spread of 2-pips, taking those trades would still be profitable, of course it is not possible due to no-scalping strategy. But it is also an addition for you to use as food for thought. .

Files:
 

A modification

I realized the profit was miscalculated based on ticks rather than minutes.

A few bugs are also corrected here.

Here's a version that calculates the values for any timeframe desirable.

You can use it to measure the volatility and trend of any currency in any day. I think I will use it as a basis for an upcoming EA.

Files:
Reason: