Discussion of article "Third Generation Neural Networks: Deep Networks" - page 7

 
Maxim Dmitrievsky:

A HUGE THANK YOU to the author for the article. I started to familiarise myself with the application of neural networks to the market with your article. I was not familiar with neural networks before and had never used the R language. But now I have installed it and am learning it. It seems complicated, but interesting!

And yes, please tell me, I can't understand how the SAE.model file works as a library for an Expert Advisor or as what? That is, can we save the neural network structure from R and then use it as a regular library in an Expert Advisor, or what? It's all very confusing and complicated (for me).

SAE.model is a file in which two objects are saved: the actual trained model"SAE" and normalisation parameters(prepr). When the EA is started, they are read into the workspace and further used in the calculation.

Any business is difficult in the beginning. But this topic (R language) is worth studying.

Good luck

 
Vladimir Perervenko:

SAE.model is a file where two objects are saved: the trained model"SAE" and normalisation parameters(prepr). When the EA is started, they are read into the workspace and further used in the calculation.

Any business is difficult in the beginning. But this topic (R language) is worth studying.

Good luck

Is it possible to realise here the EA address directly to the saved object of the trained model "SAE", without unnecessary adapters of interaction between the terminal and R? That is, we save the trained model and access it directly from the EA code. I would like to simplify the process of communication between the EA and the model as much as possible, so that I could concentrate on studying the subject area rather than programming languages (since I am not a programmer and can only write in mql, and I can understand the basics of R). I apologise in advance for my nubachestvo.
 
Maxim Dmitrievsky:
Is it possible to realise here the EA address directly to the saved object of the trained model "SAE", without unnecessary adapters of interaction between the terminal and R? That is, we save the trained model and access it directly from the EA code. I would like to simplify the process of communication between the EA and the model as much as possible, so that I could concentrate on studying the subject area rather than programming languages (since I am not a programmer and can only write in mql, and I can understand the basics of R). I apologise in advance for my nubachestvo.

No. An object created in R can be used only in R. It is not the EA's job to communicate with the model. His task is to supply quotes, execute signals received from the model, manage capital, trawl and other acts of interaction with the market. He is a "doer". But Rterm is a "thinker" with the model.

It is possible and necessary to move the train_SAE() function to the Expert Advisor. Then at the first run the model is trained, and at the next runs (at each new bar) it predicts).

Good luck

 

Good afternoon!

Could you please elaborate on the implementation of genetic algorithms in R with respect to NS?

 
Nyamhyy14:

Good afternoon!

Could you tell me in detail about the implementation of genetic algorithms in R with respect to NS?

There are several packages in R that implement evolutionary (genetic) optimisation algorithms. I use "rgenoud". The algorithm works in a standard way. We write a fitness function that calculates the variable to be maximised (minimised). This function must have parameters that can be changed and that affect the final result. Set the limits within which these parameters can be changed. Start the search. This is in a nutshell. And if in detail, it is necessary to write an article.

Read here, here and here. There are other packages, but I personally like this one.

Regarding NS? - please specify what you're talking about.

Good luck

R-GENetic Optimization Using Derivatives (R-GENOUD) Home Page
  • sekhon.berkeley.edu
R-GENetic Optimization Using Derivatives (RGENOUD) Home Page
 
Vladimir Perervenko:

Also do not forget to correct the path to the directory where the installed R language is located on your computer.

It is desirable to run the Expert Advisor in the following sequence: install the Expert Advisor on the chart.

After normal initialisation of the Expert Advisor, the alert "No calculation result! Symbol". After that, set the indicator with the external variable send = true and specifying the server port to which the indicator should connect (see above). If everything works normally, the real data - "operation", Accuracy, K and Kmax - will appear in the output line and trading will start.

The best way to control the R-process operation state is to open the Windows Task Manager window. If Rterm does not appear in the list after launching an Expert Advisor or indicator, it means that the R-process has fallen down. The main reason why the process crashes is a syntax error in scripts, mismatch between the lengths of the receiving vector in MQL and the vector to be taken out of Rterm.

I tried to launch the Expert Advisor, but nothing worked.

The path to the R directory in the indicator and the Expert Advisor was corrected, all files were placed in the necessary folders. When loading the Expert Advisor on the chart, the message "Expert e_SAE EURUSD, M30: loaded successfully" appears

After 2-3 minutes, the window with the Expert Advisor hangs up and I manage to press the "OK" button, messages with the Expert Advisor input parameters appear, then "e_SAE EURUSD, M30: initialised".

And after that the "Rterm crashed" alerts start falling. Rterm does not appear in the list of processes.

When launching the indicator, the "Rterm crashed" alert also appears.

What can be the problem?

 
donvald:

I tried to start the Expert Advisor, but nothing worked.

The path to the R directory in the indicator and the Expert Advisor was corrected, all files were placed in the required folders. When loading the Expert Advisor on the chart, the message "Expert e_SAE EURUSD, M30: loaded successfully" appears

After 2-3 minutes, the window with the Expert Advisor hangs up and I manage to press the "OK" button, messages with the Expert Advisor input parameters appear, then "e_SAE EURUSD, M30: initialised".

And after that the "Rterm crashed" alerts start falling. Rterm does not appear in the list of processes.

When launching the indicator, the "Rterm crashed" alert also appears.

What can be the problem?

1. What release of R do you have installed? Since this is a rather old article, many libraries have been updated during this time and some of their functions stopped working.

2. Is the "picture" of the workspace preserved or not?

To check the libraries, run the scripts in Rstudio standalone. Errors should pop up. Make screenshots and send them to me. It's easier to analyse

I will check the scripts for version R3.2.0 on the weekend. I promised for a long time, but I can't get my hands on it.

Just confirm who is interested, so as not to waste time. There are many other tasks.

Good luck

 
Vladimir Perervenko:

1. What release of R do you have installed? Since this is quite a long time ago, many libraries have been updated in the meantime and some of their functions no longer work.

2. Is the "picture" of the workspace preserved or not?

To check the libraries, run the scripts in Rstudio standalone. Errors should pop up. Make screenshots and send them to me. It's easier to analyse

I will check the scripts for version R3.2.0 on the weekend. I promised for a long time, but I can't get my hands on it.

Just confirm who is interested, so as not to waste time. There are many other tasks.

Good luck

Good afternoon.

The release is 3.2.0. Found a couple of errors in the directory names. In the article it was written to put it in "C:Rdata/SAE/", but in the code of the indicator and Expert Advisor it was"C:Rdata/". I corrected this and then ran the scripts in Rstudio. I found out that several packages were missing. I installed deepnet, svSocket, caret.

Started as described by the Expert Advisor and the alert "No calculation result! EURUSD". Then I put the indicator on the chart with Send to server variable - true. I waited for 15 minutes, the window with the indicator was still hanging, it did not appear in the list of indicators, and the Expert Advisor gave the same alert every 5 seconds. Finally, the indicator hung down and the "OK" button was triggered. The indicator appeared in the list of indicators and "Rterm crashed" alerts started to appear.

It is not easy to run scripts in Rstudio standalone, because they require parameters that should be passed from the Expert Advisor and some lines cause errors, which my qualification does not allow me to understand.

 
donvald:

Good afternoon.

The release is 3.2.0. I found a couple of errors in directory names. In the article it was written to put it in "C:Rdata/SAE/", but in the code of the indicator and Expert Advisor it was"C:Rdata/". I corrected this and then ran the scripts in Rstudio. I found out that several packages were missing. I installed deepnet, svSocket, caret.

Started as described by the Expert Advisor and the alert "No calculation result! EURUSD". Then I put the indicator on the chart with Send to server variable - true. I waited for 15 minutes, the window with the indicator was still hanging, it did not appear in the list of indicators, and the Expert Advisor gave the same alert every 5 seconds. Finally, the indicator hung down and the "OK" button was triggered. The indicator appeared in the list of indicators and "Rterm crashed" alerts started to appear.

It is not easy to run scripts in Rstudio standalone, because they require parameters that should be passed from the Expert Advisor and some lines cause errors, which my qualification does not allow me to understand.

Does the indicator with Send to server variable - false start normally?

Have you put the model where it should be?

Read the "pictures" saved by the Expert Advisor and the indicator in Rstudio (set the variable swr = true). I would like to see them.

Are the directories created normally? Have you figured out what is where?

Good luck.

 
Vladimir Perervenko:

Does the indicator with Send to server - false start normally?

Have you put the model where it should be?

Read the "pictures" saved by the Expert Advisor and the indicator in Rstudio (set the variable swr = true). I would like to see them.

Are the directories created normally? Have you figured out what is where?

Good luck.

It's the same with the variable false.

I'm not sure about the model directory. I put it in the directory with other SAE files. Just in case I put it in the MT4 folder: ..\MQL4\Files\EURUSD\M30.

I haven't figured out what mainDir is.

All other files are clearly described in the article, there are no errors here.