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 Code Library for MetaTrader 4 - 37

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

24-hour analog GMT(UTC) market clock displaying in background. The clock displays the Greenwich Mean Time and shows the status of all main stock exchanges according to their schedule.

The indicator displays the values of the Moving Averages (MA), deltas between the values and deltas between МАs.

Arrangement of the pending orders at equal intervals (steps).

Tick chart of the price/spread/volume. Saves tick data in a file.

The Moving Average indicator data is used for trading. If the price goes away from the Moving Average by a certain number of points, then an order is placed in the direction of the Moving Average line.

RSI Bollinger Bands are used to establish overbought and oversold RSI regions for generation of short and long trading signals.

Trades on price spikes around important financial announcements.

Price(%)Range is the indicator for the MetaTrader 4, which calculates the price movement based on percentage High (Highest) and Low (Lowest) price on 100 bars.

This is a simple indicator showing pivot only for H1, H4, daily, weekly and monthly.

This code has some functions to close all opened orders once the drawdown reaches a specific percentage of the account balance.

SBVolumeAvg is a Forex Indicator (MetaTrader 4) for calculating Average Volume on the Swing Bars by a ZigZag trend line that is bounded by two vertical lines.

This script plots MQL signal history on a MetaTrader 4 chart.

Easy EA for closing positions with profit or loss. All positions of chart's symbol are counted separately.

This indicator helps you display spread on a chart.

It synthesizes any symbol if you have the source symbols and then makes a real time virtual chart. Same concept with Triangle Hedge (SymbolSynthesizer.mq5 https://www.mql5.com/en/code/909) but for chart display in MetaTrader 4.

Draw your preferred pivot formulas: Standard, Fibonacci, Camarilla, Woody’s and DeMark with 4 Support and Resistance lines.

Close, Delete or Clean values from all orders by your choice.

Calculates volume for each currency on pair based on price movement.

Moving average with some extra features.

Simple indicator to show two levels of Standard Deviation Channel on your chart.

This indicator helps determine the end and the beginning of trends based on the inclination of the matches.

The Expert Advisor moves the Stop Loss in the direction of the price movement using various methods.

This indicator will Draw Fibonacci Tools such as Retracement, Arc, Fan, Expansion, Time Zones. Based on ZigZag indicator.

This Expert Advisor uses three indicators: MA(150), RSI(3) with the levels of 80 and 20, Stochastic(6, 3, 3) with the levels of 70 and 30. The direction of opening deals is based on MA. Entry by RSI and Stochastic. Exit by Stochastic.

The Expert Advisor reverses the orders after closing.

A simple indicator, which informs the trader about the appearance of "Bullish Engulfing" or "Bearish Engulfing" candlestick patterns on all timeframes.

Opens orders using the martingale and a virtual trailing stop.

The script analyzes the market based on two criteria: the moving averages and the support and resistance levels.

The function returns the lot size, which is calculated based on the stop loss size and the risk specified in the variable.

The function closes all locked orders. This really saves money on the spread.

Implementation of a trading system based on divergence detection.

The indicator registers the price level breakout moments and the significance of these levels.

The indicator shows the High, Close and Low of the previous day, week or month with time shift.

The function allows the execution of the specific code in the specified time interval.

The Expert Advisor trades based on the support/resistance levels set by the user, while trailing the Stop Loss order.

The Expert Advisor places a grid of pending orders in both directions several minutes before the specified time and trails the Stop Loss order after the orders trigger.

Tick volumes drawn by days as a histogram of clusters.

Tick volumes of a specified interval drawn as histogram of clusters.

An indicator template that draws arrows on the chart.

Script that closes orders and (or) deletes pending orders.

1...303132333435363738394041424344...101