Watch how to download trading robots for free
Find us on Twitter!
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 - 4

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

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

One of the latest version of this indicator at the moment. Huge base of different modifications of moving averages, with multitimesframe function, sending signals to e-mail and push notifications.

Commodity Channel Index using exponential moving averages.

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

Below you can find a super simple method to create a license based on MT4 account name. Place in your init function: CheckLicense(); The stringLower method makes sure the account name is in lowercase. Then you can check this value with the account name you want to check.

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.

This indicator paints the candlestick chart color according to the Elder Impulse System

Crypto EA for ETH/USD pair.

Find what are the highs and the lows that happened the last 60000 ms

Weighted deviation bands - metatrader 4 version

Weighted deviation - metatrader 4 version

This code will pause the trading for X minutes when there are N consecutive losses happen within Y minutes

Convert historical data from M1 to M1, M5, M15, M30, H1, H4, D1, W1 and MN, specifying the start date.

This EA can do Grid trading and has useful functions for Gridtrading included

This Indicator shows the potential breakout/stop levels.

An implementation of the Relative Strength Index indicator by John Welles Wilder Jr. as described in his book—New Concepts in Technical Trading Systems [1978].

An implementation of the original Average True Range indicator by John Welles Wilder Jr. as described in his book—New Concepts in Technical Trading Systems [1978].

This is an Expert Advisor code for counting open running orders for each type: OP_BUY or OP_SELL.

AK-47 Scalper EA is fully automated. It uses the strategy of entering the sell Stop order continuously and will modifythe order when the price is opposite to the pending order.

Forex Trade Manager MT4 simplifies managing open orders in MetaTrader 4.

Forex Trade Manager Grid MT4 helps you to managing orders and achieve the goal.

An indicator to see very easily the trend in a maxminband channel. (You need use Heiken Ashi to see the graph or change the parameter ti put the graph in front of the indicators)

- indicator for MetaTrader 4

Based on the original “Time Segmented Volume (TSV)” developed by Worden Brothers, Inc.

this Script will get content message from Popup Alert dialog

Simple indicator that will scan thru the symbols in the MarketWatch window to alert you if price is overbought or oversold based on RSI.

The trade strategy is based on 2 moving averages. To confirm the trend, it uses 2 moving averages crossing and 1 candlestick formation while the moving averages are still crossed.

Search for positive swaps.

This version of the 'Detrended Price Oscillator' shows the DPO in blue with a smoothed estimate of it as a histogram to view the length of price cycles from peak to peak and trough to trough.

Channel Indicator using SMA

Mean Reversion strategy works best on daily time frame major forex pairs .

This EA will Close All your current running Trades when Applied.

A Simple Trade Management Script

This Script Closed All Open Orders At Once (Except Pending Orders)

Time segmented volume (TSV) is a technical analysis indicator developed by Worden Brothers Inc. that segments a stock’s price and volume according to specific time intervals. The price and volume data is then compared to uncover periods of accumulation (buying) and distribution (selling). Time Segmented Volume was developed by Worden Brothers, Inc to be a leading indicator by comparing various time segments of both price and volume.

One code that works for both Mt4 and Mt5 combined. Salient features of the code: -Filter News by High, Low or Medium Volatility -Filter By currencies -Filter by News Keyword -Auto GMT offset check -Dashboard to show upcoming News (Can be enabled or disabled) -Lines on chart for all Upcoming events -Code can be easily modified to place trade at certain time before or after an event or to just stop trading during events.

Get notifications when hit price level

Draw trade history onto chart

Plot entry and exit as line objects from MQL5 signal CSV onto chart

1234567891011...102