Discussion of article "Neural networks made easy (Part 2): Network training and testing"

 

New article Neural networks made easy (Part 2): Network training and testing has been published:

In this second article, we will continue to study neural networks and will consider an example of using our created CNet class in Expert Advisors. We will work with two neural network models, which show similar results both in terms of training time and prediction accuracy.

The first epoch is strongly dependent on the weights of the neural network that were randomly selected at the initial stage.

After 35 epochs of training, the difference in statistics increased slightly - the regression neural network model performed better:

Value Regression neural network Classification neural network
Root mean square error 0.68 0.78
Hit percentage 12.68% 11.22%
Unrecognized fractals 20.22% 24.65%

Result of the 35th training epoch of the regression neural network (1 output neuron) Result of the 35st training epoch of the classification neural network (3 output neurons)

Testing results show that both neural network organization variants generate similar results in terms of training time and prediction accuracy. At the same time, the obtained results show that the neural network needs additional time and resources for training. If you wish to analyze the neural network learning dynamics, please check out the screenshots of each learning epoch in the attachment.

Author: Dmitriy Gizlyk

 


For the Fractal.mq5 file, I receive the following error while debugging:


2022.01.13 08:30:54.502 Fractal_1 (BTCUSD,M1) CSeries::CheckLoadHistory: requested too much data (100801)

2022.01.13 08:30:54.502 Fractal_1 (BTCUSD,M1) failed to get 100801 bars for BTCUSD,PERIOD_M1



Any suggestions on how to edit the code to not request greater than the max number of bars of data (10,000)?

 
Here are the files I am working with.
Files:
Fractal.mq5  36 kb
NeuroNet.mqh  40 kb
 
Josh #:


For the Fractal.mq5 file, I receive the following error while debugging:


2022.01.13 08:30:54.502 Fractal_1 (BTCUSD,M1) CSeries::CheckLoadHistory: requested too much data (100801)

2022.01.13 08:30:54.502 Fractal_1 (BTCUSD,M1) failed to get 100801 bars for BTCUSD,PERIOD_M1



Any suggestions on how to edit the code to not request greater than the max number of bars of data (10,000)?

You are using M1 timeframe. And 10 000 min is only 7 days. It too small to train NN.

 
Dmitriy Gizlyk #:

You are using M1 timeframe. And 10 000 min is only 7 days. It too small to train NN.

Thanks for the reply, Dmitriy!! Should have started with 1H like you do at the end of the article.

Really appreciate your Neural Network Made Easy series! I hope to master these concepts in MQL myself (although it is easier to pass data to R using MTR lol).

These are high potential algorithms and you have done a masterful job with the library and series, thank you!!

 
hello, really a very useful article.
 
I have question,

how does the EA open a buy or sell position after training?
I want to know the accuracy of this neural network
 
KrisnaMT5 #:
hello, really a very useful article.
 
I have question,

how does the EA open a buy or sell position after training?
I want to know the accuracy of this neural network

After training you can use neural network like indicator to generate signals to make trades.

 

Could you help me solve this?



 
Guilherme Mendonca #:

Could you help me solve this?



Hi, remove "const" in feedForward and calcHiddenGradient method parameters


 
I have a simple question.
Why does these codes form a fractal?
if sell is true, candlestick (i+1) is a peak.
if buy is true, candlestick (i+1) is also a peak.


            bool sell=(High.GetData(i+2)<High.GetData(i+1) && High.GetData(i)<High.GetData(i+1));
            bool buy=(Low.GetData(i+2)<Low.GetData(i+1) && Low.GetData(i)<Low.GetData(i+1));
            TempData.Add(buy && !sell ? 1 : !buy && sell ? -1 : 0);

https://www.metatrader5.com/en/terminal/help/indicators/bw_indicators/fractals

According to the definition above, a fractal should have at least five successive bars

 
MetaQuotes:

New article Neural networks made easy (Part 2): Network training and testing has been published:

Author: Dmitriy Gizlyk

I'm reading the neural net series of articles ... I can't find the links to the source files used in the articles, where can I find them? Thank you
Reason: