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

MQL4 Source Code Library for MetaTrader 4 - 3

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 will return the pair with the most growth in the user input start time and end time

Multi Selllimit and Sellstop orders are script files that enable traders to place multiple orders with ease. These orders allow traders to enter the market at a specific price level, or at a specified number of pips away from the current market price, with stop-loss and take-profit levels. By default, the pips value is set to 400, which means the trade will be placed 400 pips away from the current market price for a 5-digit broker. Moreover, the multi Selllimit and Sellstop orders offer traders the flexibility to customize their trading strategies. Traders can set the stop-loss level to zero if they do not use stop-loss, and can choose between a target price or a pip-based entry. This level of flexibility allows traders to tailor their trading strategies to their specific needs, which can result in better trading outcomes.

Multi buylimit and buystop orders are script files that enable traders to place multiple orders with ease. With just one command, traders can place multiple buylimit or buystop orders using either a target price or pips. By default, the pips value is set to 400, which means the trade will be placed 400 pips away from the current market price for a 5-digit broker. This setup includes stop-loss and take-profit levels, which can be adjusted based on the trader's preferences. Notably, these orders come with a level of flexibility that enables traders to fine-tune their trading strategies. For instance, a trader can opt to set the stop-loss level to zero if they do not use stop-loss.

To assist traders who wish to open multiple sell orders quickly, a script file has been developed that allows them to execute a large number of trades with just one command. The default take profit and stop loss values are set in 5-digit broker format, but for traders using a 4-digit broker, the default must be TP=40 and SL=20. Num_of_Sell is the number of trades to execute. This script file can be extremely useful for traders who want to take advantage of market conditions quickly and efficiently. By simplifying the process of opening multiple sell orders, it can save traders valuable time and allow them to focus on other aspects of their trading strategy.

To assist traders who wish to open multiple buy orders quickly, a script file has been developed that allows them to execute a large number of trades with just one command. The default take profit and stop loss values are set in 5-digit broker format, but for traders using a 4-digit broker, the default must be TP=40 and SL=20. Num_of_Buy is the number trades the trader wish to open instantly. This script file can be extremely useful for traders who want to take advantage of market conditions quickly and efficiently. By simplifying the process of opening multiple buy orders, it can save traders valuable time and allow them to focus on other aspects of their trading strategy.

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.

Th Expert will set the TP based on the SL manually set using the input multiplier. Using this you can set 2,3,4 etc times the SL set.

Connect your indicator to Telegram with 3 lines of code This sample code enables to connect your indicator to Ofir Blue, the first trading application for Telegram

The Expert will help you change the TP/SL of all open orders by setting the TP/SL based on the input percentage value.

One of the latest version of this indicator at the moment. Huge base of different modifications of moving averages, with multitimesframe function, sending signals to e-mail and push notifications.

Commodity Channel Index using exponential moving averages.

Move the stoploss as the trade moves in your direction at a specific distance.

Below you can find a super simple method to create a license based on MT4 account name. Place in your init function: CheckLicense(); The stringLower method makes sure the account name is in lowercase. Then you can check this value with the account name you want to check.

This is a simple EA that will buy/sell pullbacks while managing your given risk parameters. You need to decide on a direction, and the EA will do the rest.

This indicator paints the candlestick chart color according to the Elder Impulse System

Crypto EA for ETH/USD pair.

Find what are the highs and the lows that happened the last 60000 ms

Weighted deviation bands - metatrader 4 version

Weighted deviation - metatrader 4 version

This code will pause the trading for X minutes when there are N consecutive losses happen within Y minutes

Convert historical data from M1 to M1, M5, M15, M30, H1, H4, D1, W1 and MN, specifying the start date.

This EA can do Grid trading and has useful functions for Gridtrading included

This Indicator shows the potential breakout/stop levels.

An implementation of the Relative Strength Index indicator by John Welles Wilder Jr. as described in his book—New Concepts in Technical Trading Systems [1978].

An implementation of the original Average True Range indicator by John Welles Wilder Jr. as described in his book—New Concepts in Technical Trading Systems [1978].

This is an Expert Advisor code for counting open running orders for each type: OP_BUY or OP_SELL.

AK-47 Scalper EA is fully automated. It uses the strategy of entering the sell Stop order continuously and will modifythe order when the price is opposite to the pending order.

Forex Trade Manager MT4 simplifies managing open orders in MetaTrader 4.

Forex Trade Manager Grid MT4 helps you to managing orders and achieve the goal.

An indicator to see very easily the trend in a maxminband channel. (You need use Heiken Ashi to see the graph or change the parameter ti put the graph in front of the indicators)

- indicator for MetaTrader 4

Based on the original “Time Segmented Volume (TSV)” developed by Worden Brothers, Inc.

this Script will get content message from Popup Alert dialog

Simple indicator that will scan thru the symbols in the MarketWatch window to alert you if price is overbought or oversold based on RSI.

The trade strategy is based on 2 moving averages. To confirm the trend, it uses 2 moving averages crossing and 1 candlestick formation while the moving averages are still crossed.

Search for positive swaps.

This version of the 'Detrended Price Oscillator' shows the DPO in blue with a smoothed estimate of it as a histogram to view the length of price cycles from peak to peak and trough to trough.

Channel Indicator using SMA

Mean Reversion strategy works best on daily time frame major forex pairs .

12345678910...102