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

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

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.

Indicator with several Moving Averages.

Tick volume of the candlestick drawn as clusters.

The Expert Advisor is based on the "On the MaZi" strategy.

The converter of the tick files created with the Ticks collector into different data representation formats.

Signal based on the ZigZag indicator.

A small improvement of the little known TVI indicator (https://www.mql5.com/ru/code/7804).

Collection of ticks with writing data to a file and plotting non-standard charts.

The idea behind the Expert Advisor is based on the volatility explosion in the pulse waves.

The Expert Advisor based on the "New Trading Dimensions" book by Bill Williams.

The virtual trailing stop can place stop loss, take profit and trail the order in a way that they are not visible to the broker.

Simple Expert Advisor based on the RSI indicator.

A trend strategy based on moving averages with colors as in a traffic light. The purpose of writing the EA — to test the strategy on history and pick working parameters.

The channel indicator. It also displays the current channel levels as price labels and the type of the signal for making trading decisions.

The indicator displays the series of waves, breakthrough points and targets for Take Profit.

The indicator performs the calculation of the derivative of the price.

The lookup and display of the divergences of different classes based on the data of the base indicator.

The Expert Advisor watches the market orders and generates a sound signal after a predefined time from the moment of order opening.

Elementary trailing stop able to distinguish its "own" orders among others by comment and/or Magic number. It also distinguishes the financial instrument that needs to be trailed.

The indicator marks the pin bars on the chart based on the parameters set.

The Expert Advisor is based on the Williams Percent Range indicator. It sells in the overbought zone and buys in the oversold zone. Trailing Stop and operation timer are attached to it.

1...313233343536373839404142434445...102