Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

Gandalf_PRO - expert for MetaTrader 5

Published by:
Vladimir Karputov
Views:
4180
Rating:
(23)
Published:
2017.03.02 09:42
Updated:
2018.02.22 14:45
Gandalf_PRO.mq5 (27.91 KB) view
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

Author of the idea — Collectorauthor of the MQL5 code — barabashkakvn

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

WARNING: OPTIMIZATION IS REQUIRED! 

The world is changed. I feel it in the water. I feel it in the earth.

        I smell it in the air. Much that once was is lost...

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



The idea of ​​creating the Gandalf Expert Advisor inspired discussion on the forum Neural networks as they learn how to start?.

The EA keeps open one BUY position and one SELL position (two independent positions) until the market closes them either by fixed TP or SL.

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

1st parameter: location of price - S

2nd parameter: trend slope - T

Recurrence formulas are used in calculations:

                                                       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 1st and 2nd parameter we can use the ratios from tejh linear regression formula - Useful functions from KimIV.

__________________________________________________________________________________________

Expert Advisor Inputs > 

For long positions:

  • In_BUY=true; — allow long positions,
  • Count_buy=24; — the number of history bars, on which the time series is smoothed (closed parameter)
  • w_price=0.18; — price factor,
  • w_trend=0.18; — trend factor,
  • SL_buy=62; — Stop Loss level in pips,
  • Risk_buy=0; — Risk level in % (depending on free margin).

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

__________________________________________________________________________________________

Optimization is performed in two steps, on the fixed lot, i.e. when Risk_buy=0;and Risk_sell =0; 

Step 1 for long positions:   

In_BUY=true; In_SELL=false; Count_buy from 3 to 120, with a step of 1;

w_price and  w_trend  from 0.05 to 0.6 with a step 0.01; SL_buy from 30 to 100, with a step 1.

 

Step 2 for short positions:  

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

The Expert Advisor shows fascinating trading on vivid trend periods on H4 and D1 timeframes of EURUSD, but you should apply an additional filter using an indicator on higher timeframes when you want to enter the market.

Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/17187

JK BullP AutoTrader JK BullP AutoTrader

The Expert Advisor uses the iBullsPower (Bulls Power) indicator.

3D Moving Average Indicator 3D Moving Average Indicator

Demonstration of 3D visualization.

The Puncher The Puncher

Trades using indicators: iStochastic (Stochastic Oscillator) and iRSI (Relative Strength Index, RSI).

Hercules A.T.C. 2006 Hercules A.T.C. 2006

The Expert Advisor trades moving average breakouts. It uses the following indicators: two iMAs (Moving Average, MA), iRSI(Relative Strength Index, RSI) and two iEnvelopes (Envelopes).