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

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

Submit your code

Part 3 "Object Oriented Programming in MQL5" offers an immersion into the world of object-oriented programming (OOP) in the MQL5 language. Software development often involves the complexity related to the management of multiple entities, requiring advanced technology to improve programming convenience, productivity, and quality.

Alligator beginner tutorial to learn how to code in MQL5

This function allows you to retrieve and return the filling policy of a symbol in MetaTrader 5. This is useful for making trading decisions based on the filling policy of a specific financial instrument.

The default CCI in MT5 doesn't have the shift parameter. This script implements the shift.

This is an indicator with a rainbow-like display, both for trend or pullback prediction.

Multi_BreakEven is a script file that enables setting multiple entry positions to breakeven, either through pips or a target price, once the trade becomes favorable.

DCC / Piercing

This is a simple program to compare asynchronous and synchronous all close. It is a sample program, so feel free to modify it for your own testing purposes, such as adding conditions.

Show candle gain and candle loss in percent.

This is an indicator to calculate ATR Weighted moving averages.

Searches for Wick or Body based High low in visible bars of chart

Logarithmic Moving Average continuously calculates the logarithmic mean of highest price and lowest price within a period.

Here are some examples of codes for set counters based on "Count"

QuickTradeKeys 123 is a user-friendly Expert Advisor (EA) for MetaTrader 5, enabling traders to execute buy and sell operations quickly by simply pressing the numbers '1' and '2' on their keyboard. Pressing '3' closes all open positions. This EA is ideal for swift trading and testing purposes where manual intervention is required without using the mouse.

RMA Relative Moving Average is a variant of EMA

This Expert Advisor does not trade. A simple panel, implemented using the standard Canvas library, allows you to draw digits with the mouse. The trained mnist.onnx model is used to recognize the digits.

Here is my implementation of a colored Hull Moving Average.

In Part 6 of the "MQL5 Programming for Traders", we will study a key component of the MQL5 language – trading automation. We will start with a description of the fundamental entities, such as financial instrument specifications and trading account settings. These are prerequisites for creating properly operating Expert Advisors.

Monitoring of memory leaks in the strategy tester

This is an edit of the Mod_ATR_Trailing_Stop by MQL5 user @Scriptor found here https://www.mql5.com/en/code/20423 . MT5 indicator .mql5 and .ex5 files, report any bugs, I'll fix.

Envelopes beginner tutorial to learn how to code in MQL5

Trend Dashboard Indicator MetaTrader 5 indicator — a multi-timeframe indicator that is based on three standard indicators: Stochastic oscillator, RSI (Relative Strength Index), and CCI (Commodity Channel Index). It displays current trend directions for M1, M5, M15, M30, H1, H4, D1, W1, and MN1 timeframes. When you follow such an indicator you have a clear picture of the trends across all important timeframes. It doesn't matter which timeframe you attach this indicator to. The indicator can be downloaded for MT4 and MT5.

This Script collects all MQL5 built-in indicators buffers and stores them in a CSV file for analysis purposes

Super pass-band filter as described by John Ehlers

Let follow previous EA by this link https://www.mql5.com/en/code/46630

Checks if either upper or lower Wick range of a candlestick is greater than Body range of a candlestick and plot a wingding

Six bulls or six bear continuous candles

The MT5 custom indicator, named "wd.Multi_LineMA.mq5," is designed to offer traders valuable insights into Moving Average values from a higher timeframe (MTF Multi TimeFrame). It encompasses additional visual features for in-depth analysis, such as the ability to view trails for a specified number of bars and a dynamic MA horizontal price line.

MQL5 version of harmonic moving average

This code block detects a New Bar or a New Candle when it has received.

Dominant Candle is a a two candlestick set where the wicks intersect each other but body of the candles are either gapped up, gapped down or equal

Counter attack candlestick pattern

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 is the exact conversion of pivotshigh and pivotslow functions from pine script v4 as an mql5 indicator.

Set TakeProfit by just dragging and dropping script on the desired price level.

Keltner Channel for traders or young developers by William210

Candlestick Wick Imbalance

Horizontal Grid Controller with KeyEvents

While manually adjusting the stop-loss of a single trade to match its open price is a relatively simple task, managing numerous positions individually can be cumbersome and time-intensive. The Titik Impas Breakeven script for MT4/MT5 streamlines this process, providing efficiency and convenience for traders dealing with multiple positions.

This is the exact conversion of linreg function from pine script v4 as an mql5 indicator.

123456789...183