Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Three Neural Networks - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources

author EAcpu | 2 reads | 0 comments |

Three neural networks - expert for MetaTrader 5

Idea from: Apelcin

mq5 code: Barabashkakon

The EA uses very simple neural network units

 Double n1=((ma_h1[ 1 ]-ma_h1[ 2 ])/ma_h1[ 1 ])*p1+((ma_h1[ 2 ]-ma_h1[ 3 ])/ma_h1[ 3 ])*p2+((ma_h1[ 3 ]-ma_h1[ 4 ])/ma_h1[ 4 ])*p3;
  n1=( math wheel (n1* 10000 ));

Double n2=((ma_h4[ 1 ]-ma_h4[ 2 ])/ma_h4[ 2 ])*q1+((ma_h4[ 2 ]-ma_h4[ 3 ])/ma_h4[ 3 ])*q2+((ma_h4[ 3 ]-ma_h4[ 4 ])/ma_h4[ 4 ])*q3;
  n2=( math wheel (n2* 10000 ));

Double n3=((ma_d1[ 1 ]-ma_d1[ 2 ])/ma_d1[ 2 ])*k1+((ma_d1[ 2 ]-ma_d1[ 3 ])/ma_d1[ 3 ])*k2+((ma_d1[ 3 ]-ma_d1[ 4 ])/ma_d1[ 4 ])*k3;
  n3=( math wheel (n3* 10000 ));

if ((n1> 0 && n2> 0 && n3> 0 ))
      m_need_open_buy= true ;
if ((n1> 0 && n2< 0 && n3< 0 ))
      m_need_open_sell= true ;

Signals based on the three indicators iMA (moving average, MA) H1, H4 and D1.

Optimization suggestions

Optimization is performed in two stages (1 and 2 in the figure below).

After the first and second stages

Three neural networks - expert for MetaTrader 5

Choose from the top ten versions the one that provides equally good results in backtesting and forward testing.


Attachment download

📎 three_neural_networks.mq5 (68.17 KB)

Source: MQL5 #23338

Verification code Refresh