Expert Advisors for MT4 - Examples E-mail

 

Note: These examples are for MetaTrader 4. If you want examples for MT5 please click here. Some of these examples are based on the 20 Trade Signals Article published by Metaquotes (Copyright Metaquotes). The article is intended for MT5 but we use the same logic in MT4.

Please note that these Expert Advisors were created for educational purposes and do not constitute any financial advice.

 

Before using the Expert Advisors, please read the following:

  • Before using these eas, make sure you read our MA example page here and watch the video tutorial here
  • After using the EAs go to our forum and read this post to learn how to create more complex EAs importing custom indicators
  • For any support related questions, register in our forum at molanis.com/forum - Then send us your forum username and we will activate your account. After login, post your questions along your strategy file (.mol file)
  • THE DOWNLOAD FILES ARE IN MOL FORMAT (MOLANIS STRATEGY FORMAT - A .MOL FILE). TO OBTAIN THE EA FOR METATRADER, DOWNLOAD THE STRATEGY FILE (.MOL FILE,) OPEN IT WITH MOLANIS STRATEGY BUILDER AND CLICK ON GENERATE MQL4 CODE. To download the examples, go to example 0 and download all examples in a zip file. Then unzip the file in the Molanis directory.
  • The examples use a basic logic and avoid trading using the current bar to reduce false signals and flickering.
  • If your broker is an ECN broker test the EA. If you get errors, go to the START icon, find the Buy/Sell orders include TP/SL option and change it to No. With some ECNs, the stops limits are placed after the order has been executed. Non ECN brokers accept the order and stops/limits at the same time.

 

EXAMPLES FOR VERSION 3.2

0. Click here to Download all expert advisors in a zip file
To get the expert advisor, open the strategy file using the Strategy Builder version 3.2 and then click on Generate Code.

 

1. Simple moving average

Download MA strategy for MT4 now!

Very basic strategy explained here. Open a long position when the fast moving average is higher that the slow moving average and vice versa. Every time a trading condition is true (In this case fast MA > slow MA or vice versa), the Expert Advisor opens a position. In the START icon you can control the maximum number of open positions. If you want to learn the difference between using shift 0 or 1 in this ea, read the explanation in our MT5 examples page.

 

2. Multi-Currency Simple moving average

Download strategy for MetaTrader 4 now!

This EA is similar to the Simple moving average example above but it trades two currency pairs at the same time.

 

Tip: Use the Current Symbol option if you are not creating multi currency EAs - This way your EA will work on any currency pair.

 

Multi currency EAs CANNOT be backtested in MT4. It is not possible. This ea will work fine but backtesting results are misleading. MT4 can backtest one currency at a time. Thus create separate EAs for backtesting and then put them together for trading.

 

3. Multi-timeframe Simple moving average

Download EA for MT4 now!

This EA opens a long position when the fast moving average (timeframe 1 minute) is higher that the slow moving average (timeframe 1 minute) and the fast moving average (timeframe 5 minute) is higher that the slow moving average (timeframe 5 minute)  and vice-versa. Thus the ma conditions are evaluated in two different timeframes for a doble confirmation. Both conditions have to be true to open/close positions.

 

Tip: Use the Current Timeframe option if you are not creating multi timeframe EAs - This way your EA will work on any timeframe.

 

Multi timeframe EAs CAN be backtested in MT4. Make sure you have all data available for all the timeframes in the EA.

 

4. Multi-timeframe Advanced Simple moving average

Download EA example for MT4 now!

Similar to the previous example but this EA opens a new position looking at both the 1 minute and the 5 minute timeframe; and closes it evaluating the trading condition at the 1 minute timeframe.

Close Long (CL) and Close Short (CS) icons are used to close the position when the 1 minute chart shows a change in trend direction.


5. Moving Average Crossover

Download MA Crossover now!

An MA Crossover is the change from MA slow>MA fast to MA slow<MA fast and vice versa. MA Crossovers can be defined in several ways. We use the definition from the MT5 article which reduces flickering.

 

6. Intersection of the Main and Signal Line of MACD

Download EA for MT4 now!

Buy signal: If the signal line crosses the main one from top downwards.

Sell signal: If the signal line crosses the main one bottom-up.

 

7. RSI indicator Overbuying/Overselling strategy

Download EA for MetaTrader 4 now!

Buy signal: RSI  falls lower than a certain level (30) and then rises above it.

Sell Signal: RSI rises higher than a certain level (70) and then falls below it.

 

8. Exit from the Overbuying/Overselling Zones of CCI

Download EA for MT4 now!

Buy signal: CCI  falls lower than -100 level and then rises above it.

Sell signal: CCI  rises above 100 level and then falls below it.

 

9. Exit from the Overbuying/Overselling Zones of Williams Percentage Range

Download EA for MetaTrader 4 now!

Buy signal: Williams %  falls lower than -80 level and then rises above it.

Sell signal: Williams % rises above -20 level and then falls below it.

 

10. Bounce from the Borders of the Bollinger Channel

Download EA for MT4 now!

Sell signal: If the price pierces or touches the upper border of the Bollinger band and then returns back, it is a signal to sell.

Buy signal: If the price pierces or touches the lower border of the Bollinger band, then it is a signal to buy.

 

11. Strategies that use custom indicators

You can import custom indicators into the strategy builder to create complex EAs. Go to this post in our forum to learn how.

 

12. Simple moving average with MetaTrader variables for the ma periods 
Download Simple MA strategy with variables for MT4 now!

Simple strategy that uses 2 moving averages.

13. Simple moving average with next trade management 
Download Simple MA strategy with next trade management for MT4 now!

Simple strategy that uses 2 moving averages and the new trade management feature so it behaves likes the the ma crossover example.

14. Moving average crossover with MetaTrader variables for the ma periods
Download MA Crossover strategy for MT4 now!

A basic moving average crossover

 

Examples Created with the EA Signal Builder icon


These examples use the EA Signal Builder icon. Examples do not use the current bar, they trade at the open of the current bar. Indicator calculations are made at the close of the previous bar (one tick before the open price)


15. Moving Average Crossover
Download MA strategy for MT4 now!

Buy if MA slow>MA fast changes to MA slow<MA fast - this condition is created with the EA Signal Builder icon, using 2 indicator lines in the line panels
Sell if MA slow<MA fast changes to MA slow>MA fast - this condition is created in the bar panel, bars are ignored since they do not have any color marker and the option to generate code that describe bull/bear bars is off (on code generation settings)
MA slow and MA fast are MT4 variables that can be adjusted during backtesting

16. Moving Average Crossover with ADX

Download MA strategy with ADX for MT4 now!

The same EA as the previous example but trades only take place if ADX>30
It includes 2 additional variables to control the ADX period and the number used in the comparison.
With the ADX you get less signals. ADX>30 is considered a nice indicator of a trend, and MA EAs should be used in trending markets.

17. Some Basic candle patterns and signals

Download candle patterns for MT4 now!

This is not an EA but has some patterns for you to use in your EAs:
-Engulfing Pattern (Long signal in several versions: Simple, with 3 bearish bars, and with 3 bearish bars making new lows)
-Harami
-Three new highs with three new lows
-Three White Soldiers
-Average price (open+close)/2 higher than previous open
-Average price (open+close)/2 higher than previous average price
-Open higher than previous open

 

18. Moving Average Crossover with dynamic stops based on ATR

Download MA strategy with ATR stops for MT4 now!

Stops use the formula Round number of (ATR in pips * Multiplier)

 

19. Moving Average Crossover Alert

Download MA Cross Alerts for MT4 now!

This Moving Average Crossover alerts every time there is a crossover. It uses the Alert icon.

 

 

Quick Links