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

Gandalf_PRO - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources

author EAcpu | 4 reads | 0 comments |

The author of the ideaCollector , the author of the MQL5 codeBalabashka Kon .

Neural networks inspired by the topic - where to start studying them (in Russian).

Warning: Optimization required!

The world has changed. I felt it in the water. I feel it here on earth.

I smell it in the air. Many things from the past have disappeared...

"The Lord of the Rings" by J.R.R. Tolkien

The idea of ​​creating Gandalf Expert Advisor sparked a discussion on the forum How does neural network learning begin? .

The EA maintains 1 buy position and 1 sell position (two independent positions) until the market closes the position at a fixed take profit or stop loss level.

It enters the market based on two-parameter exponential smoothing of time series, taking into account 2 parameters:

First parameter: price position - S

Second parameter: trend slope - T

A recursive formula is used in the calculation:

S[n]=w*y[n]+(1-w)*(S[n-1]+T[n-1])

T[n]=t*(S[n]-S[n-1])+(1-t)*T[n-1]

The predicted value is: y[n+1]=S[n]+T[n]

For the source values ​​of the first and second parameters we can use tejh the ratio in the linear regression formula - a useful feature of KimIV .

________________________________________________________________________________________

EA trading input>

For long positions:

For short positions: variables In_SELL, Count_sell, m_price , m_trend, SL_sell, risk_sell are similar to above.

________________________________________________________________________________________

The optimization is performed in two steps, on a fixed lot size, that is, when Risk_buy=0; and Risk_Sell =0;

Step 1 for a long position:

In_BUY=True; In_SELL=False; Count_buy from 3 to 120 in steps of 1;

w_price and w_trend range from 0.05 to 0.6 in steps of 0.01; SL_buy ranges from 30 to 100 in steps of 1.

Step 2 of the short position:

In_BUY=false; In_SELL=true; the rest is similar to above.

The Expert Advisor shows fascinating trades on the vivid trend cycles of the EURUSD H4 and D1 timeframes, but when you want to enter the market you should apply additional filters using indicators on higher timeframes.


Attachment download

📎 gandalf_pro.mq5 (27.91 KB)

Source: MQL5 #17187

Verification code Refresh