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

 
Sergiy Podolyak:


Like you, I put readability of programmes in the first place, not OOPs.

And now let's look at the essence of your post about readability of programmes in different languages.

Let's leave C alone - it is not relevant here

Let's make it simple, what we meet in practice.

Here is the code in R:

a<- b + c

How will the code look like in MKL? It is not known at all, because for MKL it is necessary to specify what b and c are.

So let me clarify: vectors

So your code number 1

And then I changed my mind and decided that these are matrices. What will your code look like on MCL #2? On R, the code will remain the same as above, but what will happen on the MCL? What will happen to the visibility?

And then I changed my mind and decided to add the even elements of one with the odd element of the other. In R, these are indices, which are themselves objects of operations.

And now your code on the MKL #3?

MKL doesn't have the tools to handle complex objects and I can develop this idea here for pages in the direction of complications. On R it will be a few lines, but on MKL..... If you don't have to make a complex object from a set of objects at all.

This is about data structures

And now the functionality. Let's not take what is not available in MKL at all, but tens of thousands of functions are unavailable. Let's take what is available. Random forests.

So the code is in R.

# подгонка и предсказание на наборе обучения целиком
        set.seed(849)
        rf              <- randomForest(trainX, trainY, 
                                                mtry    =       3,
                                                nodesize = 1,
                                                ntree   =       300); rf
        plot(rf)
        
        # ---------------------------------
        #  рисуем результат
        roc.plot(as.integer(as.factor(trainY))-1,
                 rf$votes[,2], main="")
        # ---------------------------------
        #  Предсказываем
                pred_rf         <-  predict(rf, 
                                                newdata = testX, 
                                                type = "response")
        # ---------------------------------
        #  сравниваем вне выборки
        table(pred_rf,  testY,       dnn = c("Prediction.", "Fact."))

And now your answer to alglib, but don't forget about ashi. Can we not copy tens of pages of madness from alglib?

The comparisons you have given are correct in the case of C and MCL and absolutely not correct in the case of R. It is madness to rewrite code from MKL to R. R has a huge toolkit (8 thousand packages and about 130 000 functions) and you should write in R having learnt its capabilities beforehand and not just rewrite code from one language to another.

PS.

I would like to note that this is a part of a real EA in terms of predicting the direction of movement on H4.

 
Sergiy Podolyak:


The comparisons you cited are not correct at all.


R is an extra-class algorithmic language and it has a lot of features that MKL does not have. And the reason is obvious. MKL grew from the terminal, and R from statistics. For this reason I am against any comparisons of algorithmic capabilities of these two languages - they are intended for different subject areas.

All I write about R is that R is a complement for MKL, and in the most important part of trading - in making decisions about positions.

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

Like you, I put readability of programmes in the first place, not OOPs.

And now let's look at the essence of your post about readability of programmes in different languages.

.......

San-Sanych, dear, I am a programmer. Do you understand?

No, you don't understand.

I am a programmer.

That is, I'm a person who doesn't do a job twice.

Programming itself, as well as all cybernetics, as well as all computational mathematics, as well as all mathematics - all this was born from laziness - not to do the work twice.

So I will not learn ONE more Martian syntax of some R language.

Why ? Because I am specifically lazy (read: "experienced shallow programmer") and not addicted to new syntaxes and frameworks, of which there are countless.

And secondly: any new stupid or semi-dumb syntax of a new framework - DISQUALIFIES my unclouded mathematical thinking. You know?

The more I bathe in new frameworks that were written by who-knows-who and with who-knows-what thinking, the more I'm going to be DUMBED by my "why is this so?" questions. And that's not a good thing. When you accept a new syntax, you also accept the way of thinking of its author, and this affects your worldview. The author of the English language is the English and American people - they were generally decent people at that time. The author of the C language and MQL4 syntax is a group of highly qualified programmers. And the author of the R syntax is a nameless anonymous author, an under-physicist, who may be a schizoid maniac.

The C language (and MQL4-5) does not suffer from this, it is as close as possible to English, in which algorithms and mathematical texts are written.

Therefore, while all the young people are quickly rushing from one framework to another, I slowly chew my grass , study the algorithm, then slowly come down from the mountain thinking how to break it into small understandable subroutines, and then ........ write a working programme that serves me faithfully for 20+ years.

In my OBz subroutine library I mentioned earlier at the top there is a procedure for solving systems of linear equations by Gauss-Giordano that I wrote in C around 1998-1999, i.e. 16-17 years ago. It works as before and there is nothing to change there. To be more precise, when transferring it from C to MQL4, one error was discovered, which could lead to inaccurate results in very rare cases. The MQL4-5 compiler generated a correct warning, which no compiler, including Watcom, Borland, Lattice C (MS Visual Studio), of many different versions, has ever generated in 16 years.

To the metaquotes, thank you.

 
СанСаныч Фоменко:
The comparisons you cited are not correct at all.


R is an extra-class algorithmic language and it has a lot of features that MKL does not have. And the reason is obvious. MKL grew from the terminal, and R from statistics. For this reason I am against any comparisons of algorithmic capabilities of these two languages - they are intended for different subject areas.

All I write about R is that R is a complement for MKL, and in the most important part of trading - in making decisions about positions.

Thanks to your detailed posts about the R language, I am starting to understand what it is all about. From your description of this language I get the impression that it is built not on the basis of simple functions, but on the basis of whole mechanisms, each of which is designed to solve its own class of tasks and is launched by a short and simple call. Of course, such features look attractive, but uniting with such a giant will stagnate MQL's own development.

Despite all the advantages of other languages, I personally would like MQL to grow and develop independently and not to be "spoilt" by someone else's power.

The right to independent and independent development is the most precious right in life.

You argue with the logic of a person who came to MQL from outside, being an already formed specialist, I argue as a person who "grew up" in MQL.

We cannot understand each other.

 

Yes, I'm from the outside and can't help myself.....

Here's what the below quote from a person from the outside looks like.

So the quote:

The right to develop independently and autonomously is the most precious right in life.

Adding:

Said Mowgli and spouted the wisdom he had comprehended in his first 16 years:

"You and I are of the same blood."

PS.

At first wanted to as a reply to a previous post, but then changed my mind as this applies to so many on this forum.

PSPS

Men!!!

Spend 3 hours of your life instead of this forum. Put R, put rattle, take my article in the form of instructions and an appendix to this article so as not to waste time on the source data, and before you get to the hillside, you will see that you were sitting in a hole....

It's just a matter of 3 or 4 hours. Your brain will be different. And that's worth a lot.

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

Like you, I put readability of programmes in the first place, not OOPs.

And now let's look at the essence of your post about readability of programmes in different languages.

Let's leave C alone - it is not relevant here

Let's make it simple, what we meet in practice.

Here is the code in R:

a<- b + c

How will the code look like in MKL? It is not known at all, because for MKL it is necessary to specify what b and c are.

I'll ask a few questions.

1. Do you understand that R is written in C++, R is essentially a set of wrappers of C++ functions and classes? Is it the same as gathering in a heap of stat and mat libraries in C, formalise them into classes and call them D, for example?

2. If you understood what I was asking in the first question, here is the second one: Do you understand that matrices, vectors or anything else in MQL can look like this:

a=b+c;

?

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

Yes, I'm from the outside and can't help myself.....

Here's what the below quote from a person from the outside looks like.

So the quote:

The right to develop independently and autonomously is the most precious right in life.

Adding:

Said Mowgli and spouted the wisdom he had comprehended in his first 16 years:

"You and I are of the same blood."

PS.

At first wanted to as a reply to a previous post, but then changed my mind as this applies to so many on this forum.

PSPS

Men!!!

Spend 3 hours of your life instead of this forum. Put R, put rattle, take my article in the form of instructions and an appendix to this article so as not to waste time on source data, and before you get to the hillside, you will see that you were sitting in a hole....

It's just a matter of 3 or 4 hours. Your brain will be different. And that's worth a lot.

Show your personal result of using the R language.

Show your talent, not the talent of R developers.

Can you?

A person with talent needs a problem, a person without talent needs a solution.

 
Реter Konow:

Show your personal result of using the R language.

Show your talent, not the talent of R developers.

Can you?

A person with talent needs a problem, a person without talent needs a solution.

That's a good question. I agree.
 
Реter Konow:

Show your personal result of using the R language.

Show your talent, not the talent of R developers.

Can you?

A person with talent needs a problem, a person without talent needs a solution.

What do you mean "show"?

I have a PAMM because of the pound is not working now....

That's not the point....

I write about models, but it is not about models - it is always about money, or more precisely about the certainty of receiving it 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 have posted on this topic in detail. By the way, I am not the only one.

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

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.

You are told that you use ready-made solutions for your tasks, you are satisfied with what others have done, you will not create anything new beyond what is already in R (talent of R developers). And to have confidence in the highlighted in bold you need more than ready-made solutions in R, you need to have at least the ability to look inside what others have created, you need to be able and have the ability to change it or create a new one. Otherwise, you will never have confidence.