From theory to practice - page 73

 

how is sko better than sao (average absolute deviation). maybethe extremes are off... something is there.


I counted the deviations from some scale. sko came out 12 points. soo came out 6 points.

I wonder what the big difference between sko and co could mean.
 
Vladimir:

Why pick on it, the formula is there. RMS is indeed much more common, I would say incomparably more common. First of all, because of the simplicity and computational efficiency generated by the least squares method (LSM). Here's a simple example. For now, I'm going to assume that your average is the same as in MNC, arithmetic.

There are many, many lines. The Great Soviet Encyclopaedia electronically. Need to calculate the average fraction of the number of spaces in the line, and any of the indicators of dispersion of this fraction, RMS or your modulo average deviation from this average (briefly I will call it Cheb, then tell you why.) Each pass on all the lines is expensive, the books are on different Internet resources, modem connection via copper pair.So, to calculate RMS one pass will be enough (just copy the number of lines, the sum of space fractions and the sum of squares of the space fractions, from these amounts count immediately RMS), and for Cheb need two (the first copy the number of lines and the sum of fractions, on them consider the average, the second copy the sum of absolute deviations from the average, it counts the deviation Cheb). The difference in labour intensity is 2 times.

And so everywhere you turn, there is a wedge, if something needs to be done by Cheb methods. The problem of approximating a tabularly defined function generates completely different solution costs. The simplest case is to replace the function with a constant. According to MNA, this is the arithmetic mean, which is found by all in one pass over the table of values. The approximation with minimization of absolute deviation is called uniform approximation, or Chebyshev approximation. It is used to find the median average that ensures the minimum of the sum of absolute deviations from any constant. Think about how to calculate the median. MQL has a ready function for it. What it does is that it first arranges all elements in ascending order. This is not the same as finding the arithmetic mean.

And so on. At the same time, you have to be aware that LOC distorts normal ideas about a phenomenon. For example, the average level of wages. Statistics agencies take advantage of this by reporting average wages. If a company has 25 employees, of which the top 5 earn a million and the other 20 earn 50,000, the arithmetic average wage will be 6/25=240,000 and the median average will be 50,000.


Oh, right. Maybe in trading we should use the median deviation...


because I don't see the point in the staple.

I can't see the point of using sko. all deviation values squared. then calculate the median deviation value squared. then take the root of it again.

 
Максим Дмитриев:

how csr is better than sao (average absolute deviation). maybethe extremes are off... something is there.


I calculated the deviations from the mach. sko comes out 12 points. soo comes out 6 points.

I wonder what the big difference between the sko and co could be telling us.
Sensitivity of RMS to emissions. After all, emissions deviations have a squared effect, which is equivalent to a dramatic increase in their weight if we were talking about weighted averaging.
 
Vladimir:
On the sensitivity of RMS to emissions. After all, deviations in emissions have a squared effect, which is equivalent to a dramatic increase in their weight if we were talking about weighted averaging.

indeed. on the contrary, it does not discard them, but increases their weight! in this respect, sko is worse than sao.

so why does everyone take her as a benchmark?

 
Yuriy Asaulenko:

we saw)

A large deviation of the sco from the sao may indicate that there are many emissions, or that the values of the deviations are very different, rather than all being almost the same.


 
Максим Дмитриев:

indeed. on the contrary, they don't put them off, but increase their weight!

Very roughly speaking, all statistics have come from energy or work accounting (gas theory). Which isn't quite right, but will do).

The average energy of the bodies would be Wcp=(M*V1^2/2 + M*V2^2/2+...)/n. I.e. the bodies, in order to do the work, must have average velocity Vcp=sqrt(Wcp)/M. The formulas are equivalent.

The average velocity will give you absolutely nothing for these calculations.

 
Yuriy Asaulenko:

Somewhere in the beginning of the thread, Alexander wrote that the market is self-similar. That is, it has the same properties at different timeframes.

To find it out, I took several MAs with significantly different periods, plotted them on TF 1m, and calculated distributions with respect to them. It can be done quickly enough in the same R.

If the market is self-similar, then distributions should overlap when scaling up. It turned out that they don't, distributions differ significantly, i.e. the market is not self-similar.

It follows that strategies operating on different time scales cannot be shifted to another one by scaling, and probably in some cases they cannot be shifted at all.

Non-similarity also confirms that strategies operating on different time scales are very different in technique. Say, scalping, intraday, short and medium term strategies, and long term strategies are all very different trading techniques.

Perhaps it's all trivial, but I hadn't thought about it before.

According to the thread, Alexander's strategy is "rare trades that last for hours", although we don't know this for sure, as we only had a demo in front of us.

My activities are in a different time scale of trading, and with no self-similarity to the market, it is a very different technique. In short, not my sector of the market).

In other words: it's ridiculous to give advice to Rolls Royce traders when you yourself are trading sauerkraut. The reverse is also true, by the way.

I am interested in the question you raised. Actually, the fact that there is no overlap. I took the minutes of EURUSD for two years and decided to see the dependence of the number of deviations N of a fast average with the period T1 minutes from a slow one with the period T2 minutes for the total time Tall in minutes on the size of deviations d in 4-digit points 0.0001. For averages T1 and T2, we calculate sample frequencies of their difference in the half-open range [d-0.5, d+0.5) and relate this frequency to d, denoting it by N(d,T1,T2).
Then we count the sum N(d,T1,T2) over all encountered values of d and divide N(d,T1,T2) by it. Thus, we obtain relative sample frequencies n(d,T1,T2), the sum of which for any pair T1,T2 is the same and equals 1. We do not compare for two pairs (T1,T2) and (T3,T4), but compare among themselves deviations of mean Ti from the course, which is an average with period of 0 minutes, which reduces the number of calculations. Actually, let us give 5 periods of slow averages at once: T1 = 4 T2 = 16 T3 = 64 T4 = 256 T5 = 1024, covering periods from 4 minutes to 17 hours. The fast average for these 5 slow averages is one, T0 = 0, the course itself. That is, we collect the frequencies N(d,Ti,0). Further it is better to follow the figure. For analysis a table was made in Excel (750 thousand lines 94 Mb) https://yadi.sk/d/97QaopiK3QbTv9 (80 Mb), who wants - check it, maybe I made a mistake.



Figure 1. Primary sample deviation frequencies in the range from -350 to +350 points.

We can see symmetry, so we add up the frequencies for deviations of different signs and apply the logarithmization to the abscissa axis as well. We also increase all frequencies by 1 to exclude problems with calculation of logarithms. We obtain Fig. 2. Having calculated sums of sample frequencies, we divide by them, and thereby we pass to relative frequencies. Fig. 2 already shows that the curves tend to be equidistant. Let us also take into account the oscillation amplitude of each of the SMAs. Using the square root law (EQC https://www.mql5.com/ru/forum/193378/page16#comment_5116118 formula (2), the oscillation scale of an average is proportional to the root of its period) divide d by Ti^0.5. The next Fig. 3 shows curves getting even closer. The second time we apply ZKC directly to the oscillations themselves, their magnitude turns out to be inversely proportional to the square of the frequency. In Fig. 4 the last step of reduction of distributions to the automodel form is done.

Tell me, Yuri, what kind of self-similarity were you looking for? Not the one I came up with?





EUR_M1_2_Year_To_2017-02-04.zip
EUR_M1_2_Year_To_2017-02-04.zip
  • yadi.sk
View and download from Yandex.Disk
 
Vladimir:

cool, a small step remains for you (with your skills) and a big step for humanity:

Identify in a shallow time cycle the features of a larger one forming at the same moment, with a slight shift for prediction. And extrapolate the remainder to a cycle with a different period. That would be the forecast.

By the way, it didn't work for me but I'm a lump in mathematics and did it through correlation and affine rotation of cycles (similar cycles can exist at different angles), and the dependencies there may not be so lenient. :)

Or rather, something worked, but I'm not satisfied with the results... I can give you code examples and pictures

 
Vladimir:

Interested in the question you raised. Actually, the fact that there is no overlap. I took minutes of EURUSD for two years and decided to see the dependence of the number of deviations N of a fast average with the period T1 minutes from a slow one with the period T2 minutes for the total time Tall in minutes on the size of deviations d in 4-digit points 0.0001. For averages T1 and T2, we calculate sample frequencies of their difference in the half-open range [d-0.5, d+0.5) and relate this frequency to d, denoting it by N(d,T1,T2).
Then we count the sum N(d,T1,T2) over all encountered values of d and divide N(d,T1,T2) by it. Thus, we obtain relative sample frequencies n(d,T1,T2), the sum of which for any pair T1,T2 is the same and equals 1. We do not compare for two pairs (T1,T2) and (T3,T4), but compare among themselves deviations of mean Ti from the course, which is an average with period of 0 minutes, which reduces the number of calculations. Actually, let us give 5 periods of slow averages at once: T1 = 4 T2 = 16 T3 = 64 T4 = 256 T5 = 1024, covering periods from 4 minutes to 17 hours. The fast average for these 5 slow averages is one, T0 = 0, the rate itself. That is
we collect frequencies N(d,Ti,0). Further it is better to follow the figure. For analysis I made a table in Excel (750 thousand lines, 94 Mb) https://yadi.sk/d/97QaopiK3QbTv9,(80 Mb) who wants - check, may be I made a mistake.



Figure 1. Primary sample frequencies of deviations in the range from -350 to +350 points.

We can see symmetry, so we add the frequencies for deviations of different signs and apply the logarithm to the abscissa axis. We also increase all frequencies by 1 to exclude problems with calculation of logarithms. We obtain Fig. 2. Having calculated sums of sample frequencies, we divide by them, and thereby we pass to relative frequencies. Fig. 2 already shows that the curves tend to be equidistant. Let us also take into account the oscillation amplitude of each of the SMAs. Let us use the square root law (EQC https://www.mql5.com/ru/forum/193378/page16#comment_5116118 formula (2), the oscillation scale of an average is proportional to the root of its period) and divide d by Ti^0.5. The next Fig. 3 shows curves getting even closer. The second time we apply ZKC already directly to the oscillations themselves, their magnitude is inversely proportional to the frequency. In Fig. 4 the last step of reduction of distributions to the automodel form is done.

Tell me, Yuri, what kind of self-similarity were you looking for? Not the one I came up with?


And what if we do all this on random walk plots with wands of different period?

 
Yuriy Asaulenko:

Somewhere in the beginning of the thread, Alexander wrote that the market is self-similar. That is, it has the same properties at different timeframes.

To find it out, I took several MAs with significantly different periods, plotted them on TF 1m, and calculated distributions with respect to them. It can be done quickly enough in the same R.

If the market is self-similar, then distributions should overlap when scaling up. It turns out that it doesn't, distributions differ significantly, i.e. the market is not self-similar.


Can you give me some pictures? How to do the scaling?