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

Expert Advisor based on 2 moving averages - Expert for MetaTrader 4

author EAcpu | 2 reads | 0 comments |

The Expert Advisor based on 2 lines of the Moving Average - expert for MetaTrader 4

The idea of ​​EA trading is mine. The code of the Expert Advisor was written by Sergey Dybakin .

This version of Expert Advisor is used for trading on PAMM accounts. Due to the human factor (i.e. me), the net profit is 20%. The maximum profit that can be achieved is 84% ​​of the initial deposit.

Real trading time: February 23, 2015 to July 23, 2015.

According to my observations, trading with this Expert Advisor requires a large deposit (minimum 15 000 - 20 000).

This moving average indicator value is used for trading. If the fast moving average is above the slow moving average and the distance between the two lines is greater than the specified value, a buy order is opened.

The opposite value of the indicator is used to open a sell order. Order closing is performed based on the Moving Average indicator value.

This EA also has additional plugin modules: distance between fast and slow moving averages, take profit, stop loss, trailing stop, distance between orders (up and down), average take profit method, trading time, reversal, increase of the first lot when the previous main lot ends in loss.

EA algorithm:

EA trading settings:

How to operate:

Fast MA — Settings of the moving average indicator plug-in: period, offset, moving average method. Use the moving averages included in the MetaTrader 4 terminal.

Slow MA — Settings of the moving average indicator plug-in: period, offset, moving average method. Use the moving averages included in the MetaTrader 4 terminal.

4.1.Initial batch

Risk % — Set the initial lot size based on the deposit.

4.2. Add batch

Distance setting between Fast MA and Slow MA

Profit Points - TP

Average method - Variant — variant of the average method for take profit levels (can be chosen between 1 or 2).

Stop—SL

Distance between orders (Step Up) — distance (interval) between open orders in the order grid, set along the "trend".

True — the Step Up module is activated (turned on),
Wrong —The Step Up module is deactivated (turned off).

9.1. Trailing Stop – a moving stop level.

Distance between orders (Step Down) — distance (interval) between open orders in the order grid, for the "Trend" setting.

true — the buck module is activated (turned on),
False —The buck module is deactivated (off).

Identifier of EA orders — Magic (magic number) — This parameter helps the EA to identify its orders when trading in a terminal.

Logo and data output — ShowTableOnTesting — This parameter allows opening and closing the table (today's earnings, yesterday's earnings, etc.): true - on, false - off.

Approximate time — program code that determines which chart time frame the EA will use for trading.

Trading hours — module for opening the first main order at a specific time.

True — the trading time module is activated (opened),
Wrong — The trading hours module is deactivated (closed).

Turn — place a limit order based on the stop loss level of the first main order in the opposite direction.

True — the Turn module is activated (turned on),
Wrong —The Turn module is deactivated (turned off).

The Expert Advisor based on 2 lines of the Moving Average - expert for MetaTrader 4

This version of Expert Advisor is used for trading on PAMM accounts. Real trading time: February 23, 2015 to July 23, 2015.

The maximum profit that can be achieved is 84% ​​of the initial deposit. But due to my own reasons, the net profit is only 20%. The reason is that I interfered with the EA's trading.

The EA test I conducted showed that the monthly net profit rate of return is 5%, 10%, and 15%, and the withdrawal amount does not exceed 20% of the deposit.

PS: The attached suite only works on the account I trade with. Each DC/broker and account (demo or real) requires custom EA settings.

Don’t get carried away with optimization as it doesn’t always help and may overlook order placement speed in very fast moves.


Attachment download

📎 ma_v_1_3_3.mq4 (35.88 KB)

Source: MQL5 #13617

Verification code Refresh