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

Top MQL4 and MQL5 source codes based on user ratings - 6

Submit your code

The EA only trades buy positions and does not use SL and TP.

This indicator allows you to define a checklist for you to manually check and confirm your strategy before entering into a trade.

A simpler way to display Heikin Ashi

BreakRevertPro EA merges breakout and mean reversion strategies with adaptive SL/TP and multi-timeframe ATR trailing stops for flexible trading in volatile markets.

A very simple, efficient and non-obtrusive clock for your Chart. KISS compliant! :)

This is an indicator for showing volume profile on the chart, using simple calculations and very fast execution.

Calculate the cosine distance and similarity between 2 vectors . The cosine distance is 1-cosine_similarity and the cosine similarity is the dot product of two vectors by their magnitudes multiplied.

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.

Fair Value gaps are used in ICT's smart money concept where there is an imbalanace of 1 point or more between 1st candle's high and 3rd candle 's low in bullish and 1st candle 's low and 3rd candle's high in bearish

The indicator displays the current spread and the time till closing the bar (candlestick) at the same time.

MACD variation that uses Nonlag MA.

This is a RSI of High, Low, Open and Close displayed as color candles in it's own sub-window.

Provide simplest class to read and parse CSV file

The JSatl indicator with the timeframe selection option available in the input parameters.

It is made more up-to-date and multi time frame option added.

Stochastic that is using RSX as an input for calculations.

Export history of closed positions from MT5 retail hedging account selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software.

Recursive Median Oscillator - with floating levels

Here is my implementation of a colored Hull Moving Average.

The EA opens positions randomly (50/50 chance for Buy or Sell) when no position is open.

This is a script to print all open trades and their PnLs at a specific time in history.

Show candle gain and candle loss in percent.

This is an indicator to calculate ATR Weighted moving averages.

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

Linear Regression Value indicator

is a text for the neutral network would like to know your opinion.

A smoother line chart which cuts out a lot of the market noise and uses volume in the formula

It is an indicator used to determine the trend, support and resistance level of the market. When volume data is available, it calculates using MFI, if not, it calculates using RSI. Momentum: RSI and MFI Volatility: ATR

The Trend Equilibrium Indicator TrendEQ dynamically analyzes market movements by combining momentum and volatility. By scaling momentum with the market’s volatility, the TrendEQ provides a reliable measure of trend strength and direction.

Kuskus Starlight is an oscillator that utilizes a Fisher price transformation to identify trends and potential reversals. The original MT4 code by Scriptor is available at: https://www.mql5.com/en/code/8365.

Bollinger Squeeze Basic MetaTrader indicator — is a complex indicator based on Momentum, Bollinger bands, and Keltner channel. The indicator is drawn in the separate window of the chart as a Momentum histogram and a range of dots when show the relationship between the current Bollinger bands and Keltner channel values. This indicator is available for both MT4 and MT5 versions of the trading platform.

Flexible Momentum (MetaTrader indicator) — calculates the change of a currency rate during a given period (in seconds) and displays the result as a number of points and percentage in the main chart window of the platform. It offers highly customizable alerts based on thresholds for maximum momentum in points and percentage. Because this indicator uses ticks history to calculate momentum, it works only in MT5.

Gain/Loss Info MetaTrader indicator — displays the gains and losses for all candles where the given threshold is surpassed. The values are calculated in points and percentage. The indicator can calculate gain/loss in two modes: plain candlestick Close and Open difference, and as difference between current Close and previous Close. You can set minimum change limits (for pips and percentage), change modes, and you can also control font color of the output numbers. The indicator is available for both MT4 and MT5.

Keltner Channel (MetaTrader indicator) — is a classical technical analysis indicator developed by Chester W. Keltner in 1960. The indicator is somewhat similar to the Bollinger Bands and Envelopes. It uses three plot lines: the middle line is the 10-day simple moving average applied to the typical price ((high + low + close) / 3), the upper and the lower bands are produced by adding and subtracting the moving average of the daily price range (High and Low difference) from the middle line. This way, a volatility-based channel is built. In this version of the indicator you can modify all the parameters of the MA. The indicator is available both for MT4 and MT5 versions of the platform.

Pinbar Detector is a MetaTrader indicator that tries to detect Pinbars (also known as "Pin-bar" or "Pin bar") and marks them by placing a "smiling face" symbol below the bullish Pinbars and above the bearish Pinbars. It is a pure price action indicator, which is not using any standard technical indicators in its code. The configuration of Pinbar detection can be done via the indicator's input parameters. Pinbar Detector can issue platform alerts and email alerts on detection. The indicator is available both for MT4 and MT5 versions of the trading platform.

Point-and-Figure MetaTrader 5 indicator is an indicator that can plot a point-and-figure chart directly in the main window of your normal MT5 chart. You can set up all the point-and-figure method parameters, such as the box size and the reversal distance, according to your preference. In addition, you can control all the display parameters of the PnF chart. This point-and-figure indicator supports all sorts of alerts. It is based on real ticks data, and thus is available only for MT5.

Support and Resistance MetaTrader indicator — as the name of this indicator suggests, it displays the support and resistance levels. It shows them directly on the chart, providing an easy help when you want to set stop-loss or take-profit level, or when you want to see the next market target. This indicator uses the standard MetaTrader Fractals indicator (by Bill Williams' method) and has no changeable input parameters. This indicator is available for MetaTrader version 4 and 5.

Total Power Indicator (MetaTrader indicator) — is based on the two standard indicators — Bear Power and Bull Power. The indicator calculates how many bullish and bearish bars were there during a given look-back period and then calculates the proportional index for bears, bulls, and total (calculated as the absolute difference between bulls and bears) for the current bar. This way, we get continuous lines of the relative average bear and bull power over a period, removing the main disadvantage of the original Bear/Bull Power indicators — the lack of a long-term perspective. The original MetaTrader 4 version of Total Power Indicator was created by Daniel Fernandez of Asirikuy.com in 2011. The version for MT5 is now also available.

A script which when dragged onto the chart will print out in the experts window the number of bars that are on that chart - like magic.

A simple starting-point script to collect data and send to a CSV in oldest-newest ordering. In this example only the close price data is collected.

12345678910111213...189