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

MQL5 Source Codes of Scripts for MetaTrader 5 - 2

icon

Scripts perform one-time actions in MetaTrader 5 using an MQL5 program and are deleted from the chart immediately afterwards. Sample functions include uploading trading history, generating a report and sending it by email, downloading and processing data from a file. Scripts can also be used to create graphical interface or quickly execute single-type trading operations, for example, close all positions immediately.

You can download and launch offered scripts in MetaTrader 5. The library of scripts is also available directly from MetaEditor development environment allowing you to learn MQL5 programming.

Submit your code
latest | best

Export the history of transactions on the trading account.

Rates Version of a script https://www.mql5.com/en/code/30791

The script is best use to clean up all drawings ( Delete All Object, Comment, horizontal line, vertical line, arrows etc) on current chart. Please feel free to modify based on your needs.

SymbolInfo example script lacks margin and leverage data wich are nowhere to be found explicitely in Metatrader, the trader must search thoroughly into the broker site in order to find them. The aim of this script is to provide a remedy to it from a standard tool.

CloseAll script complying FIFO rules.

Script to download EVZ data for Euro FX Vix indicator

Building good trading habits by seeing things in terms of percentage not in terms of money.

This is a simple script that Closes all Orders and Positions available

3 fibo levels.

closing partially script and Stop loss to Break Even point

Risk Reward Tool calculates Risk reward like 1:2 1:3 1:4 and 1:5

This script draws Fibonacci Expansion OBJ_EXPANSION with options to add your own custom values

This script draws Fibonacci Fan OBJ_FIBOFAN with options to add your own custom values

This script draws Fibonacci Retracement OBJ_FIBO with options to add your own custom values

Aquarium Canvas Background for Chart This script adds cool live canvas background on the chart like aquarium

Building good trading habits by seeing things in terms of percentage not in terms of money.

Calculates the average range of prices (in points) for intraday periods.

This is a Script and Class for creating, evaluating and adding accounts to an encrypted license file for licensing an MQL EA or Indicator.

The currency strength meter is a trading tool that is used to identify trending and consolidating markets based on the percentage rate of change in price from one period to the next.

I find the lot calculation tedious so I just use this script and tell it the dollar amount to use. It then does the rest. This works for any currency.

I find the lot calculation tedious so I just use this script and tell it the dollar amount to use. It then does the rest. This works for any currency.

The breakout strength meter is a trading tool that is used to identify which currencies are the strongest to breakout, and which currencies are the weakest to breakout

This unit test frameworks eases the development of unit tests for more complex expert advisor programs. The MQL5 developer can test single components. The test framework starts the strategy tester so that there is test data available if required. I am using the framework to do test driven development (TDD) on my MQL5 programs.

Print info about a closed position by its position ticket or identifier.

The 8 effective steps to build a robust day trading plan using Fibonacci retracement

For day traders. 2 highly important indicators to turn strategies into extreme winning ones. The Win/Loss ratio and the Reward/Risk ratio will allow us to identify the best times and days our strategy works the best

For day traders, this is one of the important thing to consider in order to improve our strategy by calculating on average how much an asset moves, in which it will allow us to identify the best TIME during the day to trade when the market moves the most as well

This is one of the important thing to consider in order to improve our strategy by calculating on average how much an asset moves, in which it will allow us to identify the best days to trade when the market moves the most as well as the worst days to trade in order to prevent trading during these days.

Most traders keep losing money because they focus on money rather than planning their trades based on Percentage risk.

Are you tired and lost when it comes to creating an attractive market watch list ? You always see pro traders creating an attractive market watch list in which they draw support/resistance and create all possible scenario ? Well we will guide you step by step to create your own attractive market watch list for potential entries.

This script is to get the last deal history data, for example : profit, deal type, etc, and put the Comment on the chart.

This script displays useful information.

This strategy is the well known set & forget accompanied by the martingale system. It is very useful if you are very busy in which you don't have time, you want to trade the London session while you are sleeping in USA, etc.

This strategy is the well known set & forget accompanied by the anti-martingale system. It is very useful if you are very busy in which you don't have time, you want to trade the London session while you are sleeping in USA, etc.

Convert MqlTick-s into minified structures to free RAM or store tick arrays in a compact files.

This script downloads bars and ticks from EURUSD as required for the correct execution of Kiss on Billions on EURUSD from Saeid Irani.

This script opens order with maximal amount of volume available.

required margin and maximum volume calculator.

When I start learning about trading, I remember the trading pioneer Shawn Lucas (founder of Apiary-fund) saying "trading is simple, you go from bound range market to breakout market and vice versa". I looked at few charts and he was right. So I told myself, I have to always eyeball ranging market and trending market but with the help of an indicator. There are plenty for indicator that help us eyeball these ranging/trending market and they work really well, but I like using Pivot Points.

This script opens randomly selected charts and applies user-defined template.

1234567