Discussion of article "Experiments with neural networks (Part 2): Smart neural network optimization" - page 2

 

Hi Roman,

This is a great article and I am attempting to thoroughly understand it in anticipation of incorporating it into my existing EA.  I hope you will be releasing further articles on this subject.

First, in your Angle 4-4-4-3.mq5 this test is checked against false

if (FileIsExist(OptimizationFileName)==false){
 whereas in the Original EA 4-4-4-3 it is checked against true

if (FileIsExist(OptimizationFileName)==true){

More importantly, I am a complete newbie regarding DNN's; this is my first exposure to Neural Networks.

my plan is to use multiple strategies for evaluating buy conditions.  Am I correct in assuming that each strategy might need a separate DNN or can the DNN  expanded to provide evaluation of all strategies at the same time?  In thinking about this, it seems that a Risk Reward function is needed to properly evaluate the best strategy to select for specific conditions, e.g. trending or flat markets.  Is what I am considering result in a significantly larger and more complex network?

I have also developed a complex StopLoss function, for which I am considering a second separate instance of the DNN in order to maximize profits.  Is this a better approach to including the inputs into one larger DNN.

Any  comments you may have will be greatly Appreciated


CapeCoddah

 
CapeCoddah #:

Hi Roman,

This is a great article and I am attempting to thoroughly understand it in anticipation of incorporating it into my existing EA.  I hope you will be releasing further articles on this subject.

First, in your Angle 4-4-4-3.mq5 this test is checked against false

if (FileIsExist(OptimizationFileName)==false){
 whereas in the Original EA 4-4-4-3 it is checked against true

if (FileIsExist(OptimizationFileName)==true){

More importantly, I am a complete newbie regarding DNN's; this is my first exposure to Neural Networks.

my plan is to use multiple strategies for evaluating buy conditions.  Am I correct in assuming that each strategy might need a separate DNN or can the DNN  expanded to provide evaluation of all strategies at the same time?  In thinking about this, it seems that a Risk Reward function is needed to properly evaluate the best strategy to select for specific conditions, e.g. trending or flat markets.  Is what I am considering result in a significantly larger and more complex network?

I have also developed a complex StopLoss function, for which I am considering a second separate instance of the DNN in order to maximize profits.  Is this a better approach to including the inputs into one larger DNN.

Any  comments you may have will be greatly Appreciated


CapeCoddah

Hi. You can use the 8-4-3 or 16-4-3 network to expand your strategy. So you can add conditions. To do this, you need to modify the files. The network has 3 output values Sell, Buy and close. I think there is no need to separate buying and selling.

 
Can you please tell me more about the Original EA 4-4-4-3 strategy ?
I came across its refinement looks promising.
 
Отдел аналитики и трейдинга #:
Can you please tell me more about the Original EA 4-4-4-3 strategy ?
I came across its refinement looks promising
.

Good afternoon. The strategy is what percentage of the candle size each of its parts is. This is the strategy of the author of the library. Learn more here https://www.mql5.com/en/articles/5486

Пишем глубокую нейронную сеть с нуля на языке MQL
Пишем глубокую нейронную сеть с нуля на языке MQL
  • www.mql5.com
Статья познакомит вас с глубокой нейронной сетью, написанной на MQL, и с различными функциями активации этой сети, такими как функция гиперболического тангенса для скрытых слоев и Softmax для выходного слоя. Мы будем изучать нейросеть постепенно, двигаясь от первого шага до последнего, и вместе создадим глубокую нейронную сеть.
 
I am trying to run in the Original tester, but it opens only the first trade and does not close it.

I use each tick based on real ticks, the settings are the same as in the files attached here.

How can I fix this and make a normal test?

On a demo account, for example, trades open and close normally, but in the tester with the same settings the robot does not trade in fact, it opens the first trade and holds it until the end of 3 years until the test is over.
 
Отдел аналитики и трейдинга each tick on the basis of real ticks, the settings are the same as in the files attached here.

How can I fix this and make a normal test?

On a demo account, for example, trades open and close normally, but in the tester with the same settings the robot does not trade in fact, opens the first trade and holds until the end of 3 years until the test is over

Good afternoon. Checked, everything works for me.

 

Hi Roman,

I started with your code, Angle 4443,  but I soon realized that there is a glaring issue with your assumption of random testing, namely random testing requires a huge data set,namely 10 to 55th power to completely optimize the results.  A 10,000 element data set only has a remote possibility of identifying a decent solution for each of the 55 neurons. But with Genetic optimization, the use of the best results combined with random mutations should provide faster initial identification of good results although  probably not the most optimum. Consequently, I returned to the original work and chose a 4453 network and tried optimizing using EURUSD H4 with the time  period from 2021 01 01 to 2023 01 01.   I obtained some interesting results using my older 4 core cpu.  First the complete run requires 75000 iterations and over 200 hours to complete. but I was able to identify good solutions after only 4 -8 hours, total equity of 2700 to 2900, based on an initial equity of 1000.  In the last run, that ran almost 2 days, the equity reached 3336. I duplicated your test period and achieved new equity of 2788, although your test period was within my optimization period.  I was using the original calculations as they seemed to work best.  However, short gains achieved a 68% wins whereas longs only had about 45%.  IN the last long run, there were 40,500 optimizations with 37,400 trades breaking even or producing gains whereas only 33150 trades produced a loss.

I did not loook at the money management aspect of the Original system.  When I tried your Angle system on H4, the results bere abysmal.  It looked like the stop loss function was failing miserably, probably due to the different time frame.  Nearly all the runs ended with almost all losses.

I now planto run some sensitivity optimizations to see how changing the number of neurons in each layer affects the optimizations and also see how a 3 layer DNN compares to a4 layer one.


CapeCoddah

 

Can you tell me what settings were used when testing Original 4-4-4-4-3, with settings for example which I downloaded from here standard in the tester does not open trades at all, although on a regular account in real time everything is ok.

I have already checked on two terminals of different brokers....

 
Отдел аналитики и трейдинга #:

Can you tell me what settings were used when testing Original 4-4-4-4-3, with settings for example, which downloaded here standard in the tester does not open trades at all, although on a regular account in real time all ok.

I have already checked on two terminals of different brokers....

Good day. Disable the Optimisation parameter. Read Part 3, I have explained everything there.

 

Did I understand correctly that the weights are set randomly and their value is memorised?

Why don't you use a frame to pass the weights and save them?