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

Top scripts for MetaTrader 5 based on user ratings - 2

Submit your code

Candle Signature with Example | For Research and Development

Showing different ways of the Aroon values calculation

One-click CSV export of trade history with P&L, duration & stats

This CalculateHistoryProfit script version 1.0 is designed to calculate profit for a specified period using a chart panel.

This is a simple script file to compute lot size either using risk percentage approach or the actual amount to risk.

This is a simple program to compare asynchronous and synchronous all close. It is a sample program, so feel free to modify it for your own testing purposes, such as adding conditions.

The script shows the usage of L1 Trend Filter methods in MQL5 for float and double vectors on random walk simulated data.

It will delete all objects on the chart when the compiled executable is dragged onto the chart

A quick little script to make traders' lives easier. The one thing that always annoys me is resetting the properties like colors for a new chart, to make it look the way i like it. So Here is a script to make things smoother.

Provide simplest class to read and parse CSV file

Export history of closed positions from MT5 retail hedging account selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software.

This is a script to print all open trades and their PnLs at a specific time in history.

Script to determine whether your Broker follows the US, UK or AU daylight (DST) schedule.

Script for partially close active buy orders

Partially close active sell orders

MQL5 script for MetaTrader 5 that adds two buttons to close all buy or sell positions for the current symbol.

Provide simplest class to write CSV file

This script serves as a practical example of how developers can programmatically work with files using MQL5. One of its key objectives is to demonstrate effective project file organization, which is essential for developers working on large-scale systems or aiming to create portable, self-contained projects. The concept can be expanded further and refined with additional ideas to support more advanced development workflows.

Close Profit Positions

Diagnostic script that compares SYMBOL_TRADE_TICK_VALUE, SYMBOL_TRADE_TICK_VALUE_LOSS and SYMBOL_TRADE_TICK_VALUE_PROFIT for every symbol in Market Watch. Classifies each symbol into one of four categories (ALL_EQUAL, TV_MATCHES_PROFIT, TV_MATCHES_LOSS, ALL_DIFFER) and provides an aggregated summary plus interpretation tip. Useful for verifying which tick-value property to rely on when implementing risk-based lot sizing in EAs. Exports full per-symbol report to CSV in MQL5/Files.

Script to set Stop Loss on every open position based on a target loss in the account's currency (e.g. $50 per position). Works on any deposit currency and any forex symbol. Validates broker stops/freeze levels. Currency conversion handled automatically.

This script finds DeMark pivot points, displays them on the chart and indicates their dimensions.

This function performs the main logic of opening a trade. Calculates the opening price, take profit levels and stop loss based on symbol information and parameters provided by the user. Prepare a trade request (MqlTradeRequest) with the necessary information, such as symbol, volume, order type, deviation, comment, magic number, etc. Call the OrderSend function to send the operation request and get the result. SetTypeFillingBySymbol function: Determines the order fill type (Fill or Kill, Immediate or Cancel, or Return) based on the symbol's filling policy. GetMinTradeLevel function: Calculates the minimum operating level based on the freeze level and the symbol stops level. Adjusts the minimum level to make sure it is within certain limits and returns the result.

Sample code to count consecutive no. of bull or bear bars.

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

Script For Trap News High Impact

script to open a buy position at the current price in the MT5 window with a specified stop loss (in pips) and take profit (in pips)

Set StopLoss by just dragging and dropping script on the desired price level.

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.

A small example of the Mandelbrot fractal calculation in OpenCL. The OpenCL accelerates calculations of fractal approximately up to 100 times in comparison with the CPU calculations.

Simple script for apply template and/or timeframe to all charts opened.

The script controls the display of time and price scales for all open charts or only for one chart.

The script shows the trade volume in lots required to move the position to a desired level.

This is the version 2 of my script to export the trade history from MT5 selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software. More columns were added and fixed minor errors. The code for processing and exporting data was rewritten.

Display interactive HTML graph of the account balance inside the web browser.

Encapsulating a family of interchangeable algorythms which can be modified independently from the client.

Sec-WebSocket-Key Generator

The TradeReportExporter script is designed to export the history of trades (trades) into a convenient CSV file. It automatically collects data on all trades for the last year for the instrument it is installed on. The file includes such data as date and time, transaction type (buy/sell), price, volume, commission and profit/loss. The result is saved in a file that can be opened in Excel or any other spreadsheet editor.

A script for placing a BuyStop order

The script is useful for inspecting the structure of ONNX models, providing insights into the input and output, their names, and their properties. It is particularly helpful for debugging and understanding the characteristics of ONNX models used in machine learning applications.

123456789