The St Petersburg phenomenon. The paradoxes of probability theory. - page 11

 
Maxim Dmitrievsky:

Yeah, especially when you need to have a bunch of different quotes at hand and quick testing, R and python will quickly put you in a puddle just restarting scripts

+ R has a nauseatingly slow IDE.

Run any backtester hundreds of times in these languages and then hang yourself with grief.

I don't even want to mention errors coming from third party libs, constant incompatibilities, etc.

I'm idiosyncratic about R too. When I hear about R, I want to take up the gun)).

But don't talk about Python. From my own experience: everything is very fast. Say, queries to not very fast SQLite from 0.003 to 0.03 sec. Testing TC for 55 thousand lines of history takes just over 2 minutes, including all auxiliary stuff from start to finish.

 
Aleksey Nikolayev:

There are almost no statistics in mql5. And the one we have is, to put it mildly, untested.

maybe, i don't use it much as i don't see the point and i don't know how to do it.

the main thing is optimization and empirical pigeonholing of the search, as on nova's hubra

 
Yuriy Asaulenko:

R makes me idiosyncrasy too. When I hear about R, I want to grab a gun.)

But don't say anything about Python. From my own experience: everything is very fast. Say, queries to not very fast SQLite from 0.003 to 0.03 sec. Testing TC for 55 thousand lines of history takes just over 2 min, including all auxiliary stuff from start to finish.

Yes, it glitches too, outputs charts slowly for example. Or you may install some library, but it needs another library, that you already have, but it needs the same one, but of an older version, and others don't work...

so it took us two hours to do our research, not 10 minutes.

 
Maxim Dmitrievsky:

Yes, it also glitches, for example, it displays graphs slowly. Or you install some library, but it requires dependence of another library, which you already have and it c%#$ needs the same one but an older version, and others don't work with old one...

so it took us two hours instead of 10 minutes to do our research.

I haven't encountered it in Python yet, but I suppose it's possible. This has also happened with other software.

 
Maxim Dmitrievsky:

maybe, I don't make much use of it as I don't see the point and don't know how to

The main thing is optimization and empirical pigeonholing of search, like on hobra by Nova

For me the main rule (for speed of execution and absence of hangs) - there must not be loops in R. If very necessary loop and something simple inside it - write function in C (in R it is simple enough). If it does not fit - use pure C/C++ instead of R.

But if you need something like Kolmogorov-Smirnov test, R is the best choice. I'm writing now an article for forum, where I'll try to show usefulness of such methods for trading.

 
Aleksey Nikolayev:

But if you need something like the Kolmogorov-Smirnov test, ..... I'm writing an article for the forum now, where I'll try to show the usefulness of such methods for trading.

Can I do it now, in abstract form? If it's about R, I'd rather not.) Better about the benefits of Kolmogorov-Smirnov for trading.

 
Aleksey Nikolayev:

For me the main rule (for speed of execution and non-freezing) - there should be no loops in R. If we really need loop and something simple inside it - write function in C (in R it is simple enough). If it does not fit - use pure C/C++ instead of R.

But if you need something like Kolmogorov-Smirnov test, R is the best choice. I'm writing now an article for a forum where I'll try to show usefulness of such methods for trading.

OK, interesting, let's read it.

 
Yuriy Asaulenko:

Can I do it now, in abstract form? If it's about R, you'd better not). Better about the benefits of Kolmogorov-Smirnov for trading.

We construct some statistics on the price series. Using the criterion of agreement we check how much its distribution differs from the one that would be in case the prices were random walks. If the difference is statistically significant, it can indicate the possibility of trade. Of the criteria of agreement Kolmogorov-Smirnov seems to be the most appropriate.

Also, this criterion (and many others) would be very useful in the "From theory to practice" thread)

 
Aleksey Nikolayev:

We construct some statistics on the price series. Using the criterion of agreement we check how much its distribution differs from what it would be if prices were a random walk. If the difference is statistically significant, it can indicate the possibility of trade. Of the criteria of agreement Kolmogorov-Smirnov seems to be the most appropriate.

Also, this criterion (and many others) would be very useful in the "From theory to practice" thread)

Random VR can have absolutely any distribution. On most distributions, trading is either not possible at all or does not make sense.

Besides, trading is done on a particular final realization of a random process, which itself has nothing to do with a distribution at all. Since a distribution is either an infinite realisation or a set of SP realisations.

A good example, the same coin, where the win/loss can be absolutely any, with M=0.

Well, if you take non-stationary BP, then talking about distributions is talking about nothing at all.

 
Yuriy Asaulenko:

Random BP can have absolutely any distribution. On most distributions, trading is either not possible at all or does not make sense.

Besides, trading is done on a particular realization of a random process, which itself has nothing to do with the distribution at all. Since a distribution is either an infinite realization or a set of CP realizations.

A good example is the same coin, where the win/loss can be absolutely any, with M=0.

Naturally, from a single realization of a random process (our price series) we cannot establish its exact form. This statistic will only allow us to determine the probability of making a mistake, considering the process to be different from a random walk (a Wiener process). If this probability is less than the threshold we set - we assume the process is distinct from a random walk - this is the standard matstat approach. The difference from a random walk is of interest to us because this difference is a necessary (though not sufficient) condition for trading opportunity.