Watch how to download trading robots for free
Find us on Telegram!
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 Code Library for MetaTrader 4 - 18

icon

The largest library features codes of free trading Expert Advisors, technical indicators and scripts. With the available applications you can trade in automated mode and analyze price dynamics. Use the library of codes to learn more about financial market sentiments.

Download free applications, test them and run in your MetaTrader 4. You can access them from the MetaTrader 4 platform and the MetaEditor development environment.

Submit your code

This script will create, automatically, a CSV file with all your broker markets listed. We thought would be useful. We use it to integrate it with all our experts statistics. The CSV file will be created in MQL4/Files folder. Good Trading and good statistics!!

"Engulfing" EA Trades when there is an ENGULFING pattern has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

"Ichimoku Rretracement" EA Trades when there is a retracement from "ICHIMOKU" levels has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

"Pull Back" EA Trades when there is a pull back from the trend of 2 Moving Averages has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

"Donchain Channel" EA Trades when there is a retracement from "DONCHAIN CHANNEL" levels has Trailing Stop Loss works on all time frames major forex pairs and stocks NASDAQ.

"Bolinger Band Squeeze" EA Trades when there is an expansion after contraction of bollinger bands has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

"Pinbar" EA Trades when there is a PINBAR pattern,has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

"Fibonacci" EA Trades when there is a retracement from "FIBONACCI" levels has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

Rsi & Cci Divergence EA Trades when there is a divergence of "RSI" or "CCI" indicator has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

Execute pending order(s) according to lines in the chart you have drawn before.

Creates Fibonacci Retracement on the chart based on the ZigZag indicator. Tap the "X" or "Z" key to scroll through each swing in the ZigZag, to the right or to the left. For those who do not like clutter on their charts. The indicator can scroll to the right until it disappears from the chart, but it is still there. Scroll left to bring it back. This is one of the most useful tools in my trading toolbox!

This EA uses "Renko" box size on MetaTrader 4 chart. When the price reaches the level where there was a fractal, the EA enters a trade, has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

EA purposes to always win with cumulative profit and to manage volume.

This tool is for trading with keyboard input, it supports "Send order", "Set Stop Loss", "Set Take Profit", and "Close order".

AutoFibLinesMrVB indicator draws automatically the Fibonacci levels on the chart.

Changes the zoom level for all opened charts.

Change the timeframe for all opened charts simultaneously.

Set all opened charts to use auto scaling or fixed scaling simultaneously.

Library for defining schedules by weekday and time.

Tipu CCI is one of the popular indicators in the Market. The original code for Tipu CCI is modified by removing compatibility with Tipu Panel. This version of Tipu CCI is open for everyone who is interested in developing an Expert Advisor.

A low latency container for working with ticks

The script downloads the historical quotes data of the current chart symbol and timeframe.

Many developers need these functions, while working with different kinds of external APIs, like Bitcoin and altcoin exchanges where it is often necessary to send data with the confirmation of parameters validity through HMAC-SHA512, HMAC-SHA384 and HMAC-SHA256.

A martingale strategy, an old EA that was rebuilt to be efficient.

Calculate the average volume per hour in a 1 hour chart.

EA is run say once every minute and writes the status of IsConnected, spread, stop and freeze level to a file.

This Martingale EA trades with one moving average, it is considered relatively safe because it takes a single trade at a time.

Calculate Pivot Points based on H1 bar, according to normal formula and Fibonacci, with color filling.

This indicator is based on original RSI, but more features are added to general signals and watch the strength of the price movement. The main purpose is to general buy/sell signals using smoothed RSI and its MA.

This is my version of Zone Recovery Hedging Strategy Ea with two moving averages. It works on any time frame, you should try it on demo account.

Script to start an external program.

Close all positions on a basket of currencies when the profit target has been reached.

MT4 Expert Advisor based on ADX indicator.

A fast library for combinations and permutations in MQL.

Expert Advisor which trades signals from MACD indicator.

The indicator is based on the idea that before the price and the indicator itself turn, the indicator rate slows down first and only then turns.

This is the semaphore indicator with arrows based on BB and RSI.

This is a not big assistant for trading with limit orders.

This script provides quick work with a large number of pending orders in the market and contains functions for placing, changing, and deleting of orders within the your price range.

This is the semaphore indicator of candles that highlights the candles on the chart, which have same direction like all candles for your chosen timeframes.

1...111213141516171819202122232425...102