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

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

The indicator based on the moving averages shifted to the left relative to the chart.

The presented indicator plots a fully-functional tick chart similar to the standard price charts, with the ability of the analysis using all the MetaTrader features.

The indicator was developed to help analyze the interesting strategies, and also to practice and gain experience in analyzing the signals on history data in the selected strategy.

The Expert Advisor which uses AO and AC. Buying and selling is performed when the colors of the indicators match.

The Expert Advisor based on the RSI indicator. МА and martingale are added in the new version.

The SuperTake implements the strategy of Martingale by Take Profit.

The Expert Advisor based on the Heiken Ashi indicator.

The indicator shows the identification (magic) number and the profit of the order.

The indicator displays the pairs with the current price most/least distant from the opening price.

The indicator points at the reverse bars based on the Profitunity system by Bill Williams excluding the angulation relative to the Alligator indicator mouth.

The script inserts the FXT-file of any custom chart, synthesized from real tick flow, into the strategy tester folder.

This indicator can be useful for arbitrageurs.

The Slope Direction Line trend indicator, used by the Hammering EA from the Market section.

The indicator uses Move Average to draw the level line of up and down.

The indicator shows: the remaining time on each candle, the changing value of the Bid price, tick by tick, the relative price position of the Bid/Ask spread.

A round-number horizontal web with continuous auto-adjusting.

View current and historical trends of every timeframe.

Non-optimized version of Kaufman's adaptive moving average.

Standard MACD diagram with bullish and bearish bars colored differently.

1 Click "Close All" button to close all open positions at current attached chart.

Multiple Timeframe Moving Average. It is set to look at H4 and H1 time frames. This code is for anyone who wants to use a different timeframe than on the current window.

The indicator places two price marks for the expected candle close, based on the candle range and the chart type.

Expert Advisor that will close all orders and disable another Expert Advisor / AutoTrading at desired level.

The main idea of this Expert Advisor is to trade by the basic concept of Stochastic oscillator in its basic parameters, with ability to change these parameters via the EA inputs.

Spread, its moving average (EMA), its maximum and minimum, and ticks per second (market speed) in the Comment. The version 1.01 is made with the normal average, instead of the moving average.

1 Click "Close All" button to close all your positions (regardless of the pair) will be closed at once.

This is my 1st published code, it is very simple code example: RSI 14 (price close) — open buy when it is < 25, close buy when it is > 50, open sell when it is > 75, close sell when it is < 50.

The indicator for the floating spread. Displays the change in spread of multiple currency pairs.

The multitimeframe version of the ChannelsFIBO indicator.

The indicator marks the bars, the size of which exceeds the value specified in the settings.

The arrow indicator that displays the potential market entry points based on the simultaneous presence of three Stochastic indicators with different periods in the overbought/oversold areas.

The indicator plots a channel based on fractals.

The Fibonacci channel display, the axis of which is the moving average line.

The library is intended to implement the font list in the input parameters. The library contains 208 fonts.

The indicator displays a channel based on the moving averages.

The EA searches the last upper and lower fractals and opens positions when the price exceeds these levels.

Display of the Heiken Ashi candlestick indicator in a subwindow.

One of the implementation variants of the Quantum trading system.

The EA opens trades at the intersection of the fast and the slow MAs. It has the function of outstaying the losses.

The EA closes orders when certain loss is reached by them in the account currency. It is possible to vary the loss by the volume of the order.

1...282930313233343536373839404142...102