Discussing the article: "Permuting price bars in MQL5"

 

Check out the new article: Permuting price bars in MQL5.

In this article we present an algorithm for permuting price bars and detail how permutation tests can be used to recognize instances where strategy performance has been fabricated to deceive potential buyers of Expert Advisors.

Permuting price bars is little harder to accomplish because of the multiple series involved. Similar to permuting tick data, when handling price bars we strive to preserve the general trend of the original price series. Its also essential that we never allow the open or close of a bar go beyond or below the boundaries of the high or low respectively. The goal is to get a series of bars with a distribution of features exactly the same as the original data.

Besides the trend, we have to maintain the dispersion of price changes as the series progresses from the open to the close. The spread of price changes between the open and close should be the same in the permuted bars as the original. Outside the bars themselves we must make sure that the distribution of bar to bar price changes are the same as well. Specifically, the difference between the close of one bar and the open of the next.  



This is important so as to not disadvantage the strategy being tested. The general characteristics of the series should be similar, the only difference should be the the absolute values of each open, high , low , close (OHLC) between the first and last bar. The code to implement  this is quite similar to that used in the CPermuteTicks class introduced in the article Monte Carlo Permutation testing in MetaTrader 5. The price bars permutation code will be encapsulated in the CPermuteRates class contained in PermuteRates.mqh.

Author: Francis Dube

 

Theworld's fastest speed in a car or any land guided vehicle - 1,228 km/h - was demonstrated on a Thrust SSC jet car by Englishman Andy Green on 15 October 1997 .

The 21 kilometre long track was marked on the bottom of a dried up lake in the Black Rock Desert, Nevada, USA.

//---

Let's see if this was fabricated to deceive the public.

We'll make the exact same track, but put rocks on it and try to drive it.

So we find out that the probability of getting the same speed as Andy Green tends to zero per cent. This clearly indicates that the ̶c̶о̶о̶в̶е̶t̶n̶и̶k̶k̶ speed record is fictitious.

:)

//---

The example of using this method of getting custom quotes, is not correct.

 
Permutation tests can also be used для определения степени переобучения after optimisation. To test for overtraining, we will need to test and compare performance in a sample of permutation and non permutation datasets. The extent to which the non-rearrangement performance differs from the permutation-dominated results can be used to quantify overtraining. When overlearning dominates, the difference between permutation and non permutation performance results will be small. We will see fairly large p values.
It is not clear why an overtrained model should perform well at random? As far as I know, on the contrary, if one is testing on generated plausible data, the model is considered more robust by generalising rather than memorising (overtraining).