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

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

hi, this code need your telegram token and telegram chat id . you can make robot by BotFather and then search in google how you can find telegram token and chat id then attach them to this code . now every trade would be signals on your telegram channel.

Time Left To New Bar Watch

The script obtains information about the number, types and sizes of input and output tensors in an ONNX model

Script gets information about input and output tensors of onnx-model, their types and shapes

This Script will Refresh All Open Charts in MT5, Usually custom symbols in MT5 needs to be Refresh sometime so this script will help to refresh all open chart at once. We can also use this Script anywhere where we need to refresh all open charts.

Pivots based on Bar Prediction.

Get commission of an active position in mt5 , its easy to use function.

The code defines a function "RangeHighs" that calculates the highest price of a financial instrument within a specified time range (start and end time). The time range is defined by 4 input parameters (hour and minute of start and end time). The highest price is found using the "CopyHigh" function and stored in an array, from which the maximum value is returned.

It is known that the market is mainly driven by two emotions: fear and greed. This should be seen as an attempt to implement these emotions in the form of a mathematical model.

he script estimates the bar's High-Low-Close, based on the stream similarity.

Service Script for aggregating Economic Calendar data to a .txt file

The script (not an Expert Advisor) sets and moves the Stop Loss for all positions on the current symbol to the specified price

This simple quick & dirty script code will output a CSV file of all the Signals' properties as reported by the MQL5 Trade Signals functionality.

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.

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.

123456789