Discussion of article "Statistical Distributions in MQL5 - taking the best of R" - page 10

 
СанСаныч Фоменко:

What do you mean "show"?

I have a PAMM due to the pound not working right now....

That's not the point....

I am writing about models, but it is not about models - it is about money as always, or more precisely about the certainty of their receipt in the future.

According to me, the main problem of trading systems on financial markets is not in the application or not of complex mathematical models, but in overtraining (over fitting) of these very TS. Overtraining manifests itself in the fact that over time (if not immediately) the TS loses its performance in relation to its training.

To solve this problem, I am trying to prove that the trading systems I have developed are NOT overtrained. That is, I want to be sure that the future performance of the TS will not change much and, in any case, will not drain my deposit.

I am busy with this. All the necessary tools for this task are available in R in abundance. There are no corresponding tools in MKL at all.

Look at Burnakov's thread about machine learning. There I posted on this topic in detail.

That's the point. You may be a talented person, but R will not let you turn round - everything is ready there. You want to dash and take up the task, - and here you - BANG! -Get a ready-made solution.

Excessive opportunities will stagnate the development of any person's talent. If there are no challenges, there will be no development. What will be left? - Stagnation and inevitable degradation of abilities.

For a person who strives for self-development, it is necessary to escape from such a field.

Understand, machine learning is not a panacea. It may be useless in trading. Strategy parameters can be adjusted in the tester with the help of optimisation.

Perhaps you just want to make your work easier.

I understand it, but I do not accept it. You cannot earn more that way. You need to work hard.

[Deleted]  
СанСаныч Фоменко:

To solve this problem, I am trying to prove that the trading systems I have developed are NOT TRANSFORMED. That is, I want to be sure that the future performance indicators of the TS will not change much and, in any case, will not drain my deposit.

I am busy with this. All the necessary tools for this task are available in R in abundance. There are no corresponding tools in MKL at all.


That's not quite true, San-Sanych.

Banks and hedge funds use mathematical methods like "Tikhonov regularisation" to trade options and for other purposes. In trading, where there is a lot of noise, these banks can't do anything without it.

And just in R it is not available (it's just surprising), or rather it is somewhere in the Internet, but only in the form of a prefabricated script, and of incomprehensible quality and accuracy.

http://stackoverflow.com/questions/38899849/r-packages-for-tikhonov-regularization-in-solving-least-squares-with-ill-conditi

This just shows that :

a). real practitioners had nothing to do with the development of R;

b). serious uncles from the world of trading, if they use the R system somewhere secretly, it is only for prototypes of very simple trading models.

And they have never heard of the Yanenko method, which banks and hedge funds sometimes use to solve diffuras for option calculations and portfolio management, in the R package. (Nowadays trading uncles have better methods than the Janenko method).

I am not even talking about the problems of accuracy of mathematical calculations on a computer in general, and in the R package in particular.

The greater the aggregation of functions and subroutines (as in R), the greater the probability of systematic error of calculation error.

R packages for Tikhonov regularization in solving least squares with ill-conditioned matrices?
R packages for Tikhonov regularization in solving least squares with ill-conditioned matrices?
  • stackoverflow.com
Does anybody know any R packages available for Tikhonov regularization in solving least squares with ill-conditioned matrices? I know that there few functions available in MATLAB.
 

Today we received the results of MQL5 vs R benchmarks for a large number of statistical functions.

R fails from times to dozens of times. Its code is written head-on and nobody thought about optimisation. In MQL5, maths is obviously considered much faster.

As soon as we finish work on MQL5 maths libraries, we will publish a new article on capabilities and benchmarks.

[Deleted]  
Amazing library. Great work!
 

The beta version of MetaTrader 5 build 1467 includes an updated statistical library with extended functions.

We have done a lot of work on a total quality and accuracy check of all functions both in the MQL5 version and in the original R. It turned out that R uses a number of old unreliable functions with optimisations that lead to calculation errors.

This was revealed by our unit tests, which we obligatory distribute with our library as separate scripts in the catalogue /Scripts/UnitTests/Stat:

  • TestStat.mq5 - the main test script for checking the results of calculations
  • TestPrecision.mq5 - test the accuracy of calculations
  • TestBenchmark.mq5 - test to measure the performance of calculations


The big surprise was a convincing victory in the speed of MQL5 over C++ implementations of functions in R. The acceleration varies from 1.5 to 46 times, although on average we can talk about acceleration from 3 to 7 times.

This is a proof of the high quality of the MQL5 compiler and allows traders to make calculations within the platform much faster.

 

As an afterthought, a graphics library similar to R will be available soon.

It allows you to easily visualise complex data series directly on a graph:


 
Renat Fatkhullin:

As an afterthought, a graphics library similar to R will be available soon.

It allows you to easily visualise complex data series directly on a graph:

Cool!

Bezier? NURBS?

 
Andrey Dik:

Nice!

Bezier? NURBS?

Bezier.

We'll release a big article with comparisons of functionality in R, code samples and lots of pictures to demonstrate the features.

 

Going back to this comment, here are the new options for displaying charts in MT5 using the standard graphics library:

n <- 2000

k <- seq(0, n, by = 20)
a <- dbinom(k, n, pi/10, log = TRUE)
str(a)
plot(a)


#include <Math/Stat/Binomial.mqh>
#include <Graphics/Graphic.mqh>

void OnStart(void)
  {
   double    vars[101];
   double    results[101];
   const int N=2000;
//---
   MathSequence(0,N,20,vars);
   MathProbabilityDensityBinomial(vars,N,M_PI/10,true,results);
   ArrayPrint(results,4);
   GraphPlot(results);
//---
  }



In terms of code size and calls themselves, everything is almost the same. 4 working lines there and there, but the MQL5 code reads better from the outside.

Although under the bonnet is the full-featured graphical OOP library CGraphic, we have some simple GraphPlot functions that make it easy to output simple cases with 1, 2, 3 data series.

Two more styles of outputting the same graph:


An interesting feature to use functions as data series:

#include <Graphics/Graphic.mqh>

double Func1(double x) { return MathPow(x,2); }
double Func2(double x) { return MathPow(x,3); }
double Func3(double x) { return MathPow(x,4); }

void OnStart()
  {
   GraphPlot(Func1,Func2,Func3,-2,2,0.05,CURVE_LINES);
  }


Will be available in today's beta on MetaQuotes-Demo
 
Renat Fatkhullin:

Going back to this comment, here are the new options for displaying charts in MT5 using the standard graphics library:

#include <Math/Stat/Binomial.mqh>

... 

In terms of code size and calls themselves, everything is almost the same. 4 working lines there and there, but the MQL5 code reads better from the outside.

...

Will be available in today's beta version on MetaQuotes-Demo.

Thanks. Good statistical graphics were sorely missed!