Watch how to download trading robots for free
Find us on Facebook!
Join our fan page
Access the CodeBase from your MetaTrader 5 terminal
Couldn't find the right code? Order it in the Freelance section
How to Write an Expert Advisor or an Indicator

MQL4 Source Codes of Expert Advisors for MetaTrader 4

icon

Various applications to automate analysis and trading are available in the 'Expert Advisors' section. It features various applications based on different trading algorithms and provides different degrees of automation. You can find simple EAs and complex trading robots that can fully automate analysis and trading processes.

These applications can be downloaded and run in MetaTrader 4. It is recommended to test and optimize Expert Advisors in the Strategy tester. The Expert Advisors from the library can be accessed from the MetaTrader 4 platform and the MetaEditor development environment.

Submit your code

This EA monitors existing trades and automatically closes all profitable positions when a MA crossover signal is detected. Additionally, it provides real-time statistics for individual buy and sell profits, allowing traders to stay fully informed about their profits.

This EA provides traders with real-time overview of their trading activity directly on their chart. This powerful tool displays crucial metrics such as overall buy and sell profits, the number of open trades, and the current market spread, giving traders full visibility into their performance at a glance.

This EA works by automatically detecting all your profitable trades and closing them with a single click. Designed for traders who seek efficiency, this EA takes the hassle out of manually managing multiple positions and ensures your gains are locked in with precision.

"This is the Updated version of NoLoss EA" - As most of the indicators available in the market are lagging indicators that provide information after some time. This strategy eliminates the need to rely on indicators, candlestick patterns, chart patterns, or any price action. The EA employs a progressive system.

Smart MA Trailing Stop EA automatically adjusts stop losses based on your selected MA period and distance between SL and MA.

The Dual Profit Closer EA is a powerful automated tool designed to independently close all buy or sell orders once they reach your predefined profit thresholds.

This code can detect if its a friday of the first week of the month. It is usually to detect days with NFP. Sone trader dont want to trade at that day. Maybe this code can help some one who need it

A professional Grid advisor works according to RSI ( Relative Strength Index ) indicators. And has the function of Reducing the Drawdown on the account by overlapping unprofitable orders. The chart displays information about the profit. It can be a very useful tool, For manual trading.

This EA will scan all the closed trades and then print the nth trade from the end

This EA will scan all the open trades and then print the nth trade from the end

This is a simple code to mimic onTradeTransaction Event handler defined in MQL5

Classic & Virtual Trailing for MT4

Virtual SL TP Pending with SL Trailing for Symbol Chart

This MQL4 EA is designed to close positions for a basket of currency pairs based on certain profit and loss thresholds.

Trailing_StopLoss_for All_orders_and_symbols

Simple continuous trend-following strategy for buying and selling based on predefined conditions

Close_on_PROFIT_or_LOSS_inAccont_Currency

simple trail stop loss code example.

[@Buy_Sell_Close] Manual trading EA for trading newbies, EA can be used in backtesting visual mode, EA can also be used in live trading. You can practice your own trading system in backtesting.

this shortcode will calculate the drawdown of a particular ea, where it is applied to a specified symbol.

When we want to know how many times price will goes up and down 40 pips before breaking this channel, we will need Bounce Number tool.

This strategy eliminates the need to rely on indicators, candlestick patterns, chart patterns, or any price action. This EA employs a progressive system that I have been using for the past six months and have backtested for over three years.

a Simple Visual Strategy Tester / Manual Trade Training using Martingale.

Most EAs tend to close orders in take profit based on the distance in pips from the purchase price. However, this MQL4 code is based mainly on the current profit.

A Donchian Channel Strategy breakout EA Scalper. Best results at H1.

The Double Bollinger Band Strategy makes use of two Bollinger Bands in order to filter entries and exits in the forex market.

This is an mql5 Expert Advisor trading the breakouts and using Martin Gale risk management.

Low risk, max profit, winning strategy EA. Based upon Super Scalper EMAs indicator

This time, we're providing a sample that enters based on the Golden Cross and Dead Cross of the moving averages. If you want to see a sample where a long entry is made when the closing price of the candlestick crosses above the moving average, please refer to this article.

a Versatile automated trading tool for the MetaTrader 4 platform. This EA is designed to assist traders in managing their positions effectively by offering features such as setting a breakeven point, trailing stop, stop loss, and take profit levels. It works with various input parameters, allowing you to customize its behavior to fit your trading strategy.

The EA created sell/buy limit orders according to: - Grid number of orders - Trading range (computed automatically by uwing weekly highs and lows) - Current price

This is a grid trading algorithm idea.

KA-Gold Bot is an advanced trading advisor specifically designed for gold, utilizing the powerful combination of the Keltner channel strategy and two exponential moving averages (EMAs) - the 10-period EMA and the 200-period EMA. Principle of Operation: The 10-period EMA represents the average price cutting above/below the Keltner band, confirming an uptrend/downtrend. The price being above the 200-period EMA supports the uptrend/downtrend. This indicates that the uptrend/downtrend has been stronger than the previous 10 periods, considering the volatility over the last 50 periods.

This is a simple boolean function for the EA to detect if there is any previous open market orders without using the "OrdersTotal()" built-in function which might cause the EA to calculate positions not opened by each specific magicnumber provided by the EA.

Buys when price breaks above the MA and Sells when price breaks below the MA. User can choose the time range (server time) to trade in.

This class allows you to create buttons on the chart as if they were chart objects(have time and price coordinates) these objects can be dragged on the chart and when scrolling they stay at the same place. If you wan't to learn some Object Oriented Programming or if you wan't to understand how chartevents work or you wan't to create graphical interfaces, you can learn a lot from this.

Th Expert will set the TP based on the SL manually set using the input multiplier. Using this you can set 2,3,4 etc times the SL set.

The Expert will help you change the TP/SL of all open orders by setting the TP/SL based on the input percentage value.

Move the stoploss as the trade moves in your direction at a specific distance.

This is a simple EA that will buy/sell pullbacks while managing your given risk parameters. You need to decide on a direction, and the EA will do the rest.

1234567891011121314151617181920212223242526272829