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 - 37

Submit your code

The EA trades using the Rectangle, EMA and SMA indicators.

MACD beginner tutorial to learn how to code in MQL5

This function performs the main logic of opening a trade. It calculates the opening price, take profit levels and stop loss based on the symbol information and parameters provided by the user. Prepare a trade request (MqlTradeRequest) with the necessary information such as symbol, volume, order type, slippage, comment, magic number, etc. Call the OrderSend function to send the trade request and get the result. SetTypeFillingBySymbol function: determines the order fulfilment type (Fill or Cancel, Immediate or Cancel or Return) according to the symbol's fulfilment policy. GetMinTradeLevel function: calculates the minimum trade level based on the freeze level and stop level of the symbol. Adjusts the minimum level to ensure that it is within certain limits and returns the result.

KA-Gold Bot is an advanced trading advisor specifically designed for gold, utilizing the powerful combination of the Keltner channel strategy and two exponential moving averages (EMAs) - the 10-period EMA and the 200-period EMA. Principle of Operation: The 10-period EMA represents the average price cutting above/below the Keltner band, confirming an uptrend/downtrend. The price being above the 200-period EMA supports the uptrend/downtrend. This indicates that the uptrend/downtrend has been stronger than the previous 10 periods, considering the volatility over the last 50 periods. - Time frame: M15

This is a basic library to create and manage grids.

Butterfly Strategy Expert Advisor This Expert Advisor (EA) implements the Butterfly harmonic trading pattern across multiple timeframes (M2 to D1) for automated forex trading. It detects bullish and bearish Butterfly patterns using pivot points and executes trades with customizable risk management and multiple take-profit levels.

A short format for storing ticks.

ASI was created by Wales Wilder as an ordinary fluctuations indicator that gets signals from previous maximums and minimums of price.

The Williams’ Percent Range Indicator (%R) is dynamic technical indicator, which determines whether the market is overbought/oversold.

The function allows checking whether a new bar has appeared on the specified timeframe.

The Dual Trix indicator with dual magnified Values in the Chart and in the Indicator window.

The panel simplifies manual trading and trailing of the opened position.

The Trend Magic indicator.

The DRAW_SECTION drawing style is used for plotting the values of the indicator's buffer as a sections.

The DRAW_COLOR_ZIGZAG style draws lines of different colors by values ​​of two indicator buffers. This is the color version of the DRAW_ZIGZAG style and allows you to specify individual color for each line from predefined color set.

Kaufman Efficiency Ratio (also called "generalized fractal efficiency") according to Perry Kaufman books "Smarter Trading" and "New Trading Systems & Methods".

Reference Fast Trend Line (RFTL).

JFatlAcceleration measures the current trend acceleration.

The indicator generates continuous lines of the relative average bullish and bearish power.

Vertical Horizontal Filter (VHF) shows, if there is a trend or a flat

The indicator displays colored candlesticks depending on the current trend and considering Fibonacci levels correction and also gives alerts or audio warnings in case of a trend change.

Enhanced version of Larry Williams' Percent Range.

This Expert Advisor is example of use of the Memory Mapping DLL for working with File Mapping functions. In this example the Expert Advisor create a virtual (memory-mapped) file and start to update the quotes on symbol. Using this way, Expert Advisors can exchange data (for example, quotes) using common memory-mapped file.

Trading signals module for MQL5 Wizard. The moment, when ColorJFatl indicator changes its color, indicates the time for market entry.

Enables the "Chart Objects Description" for non-programmers. For any open chart window.

This is the improved version of Price Channel indicator. Two additional price levels, trade signals and Stop Loss/Take Profit levels were added.

8 Stochastic oscillators (%K 6, 9, 12, 14, 16, 19, 21, 24).

This indicator calculates the classic historical volatility of a financial asset.

The indicator shows the opening price of the senior time frame (e.g., 1-day time frame) and draws line indents to the opening price, thus forming a range.

Disparity Index (difference index) displays the difference between the close price and chosen Moving Averages in percentage. It is recommended to use in combination with the other candlestick models

The Expert Advisor drawn on the basis of the TrendEnvelopes semaphore, signal indicator

Example of implementation of lines hash array with a string key.

This indicator measures the (smoothed) distance in pips between the close and an exponential moving average.

Negative Volume Index (NVI) with the timeframe selection option available in the input parameters.

Modified Donchian Channels indicator with Fibonacci levels.

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

The indicator shows correlation between currencies.

This indicator is an example of smoothing the Bears Power indicator timeseries by filtering high-order harmonics.

Indicator of daily extremum zones. Flexible parameter setting is allowed.

Byte-wise operation with structures and standard data types.

1...303132333435363738394041424344...196