Top scripts for MetaTrader 5 based on user ratings - 4

Submit your code

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 native MQL5 script that measures how concentrated a strategy's profit is — whether the edge is broad or rests on a few lucky trades. It reads a per-trade CSV (Date,Profit) and reports the share of net profit from the largest trades, the Gini coefficient of the winners, a concentration profile, a survival test that removes the best few trades and recomputes net profit and profit factor, and the largest single day versus a configurable consistency limit, combined into a concentration-and-consistency score (A+ to F) with recommendations. If no file is found it generates a sample set, so it runs out of the box. No external libraries, no Python, no AI. The helper ExportTrades.mq5 writes the file from your trade history.

Calculates the correct lot size for a planned trade from your risk (percent of equity or a fixed money amount) and stop-loss distance (points or a price level). Respects the symbol's contract specification - tick size and value, volume min/max/step - and estimates the required margin.

Reads a closed-position trade history (a CSV file, or one generated automatically from the current account's deal history by the companion RuinExport.mq5 script) and reports four independent risk fingerprints: volume escalation after a loss, overlapping same-direction exposure that averages into a worse price, payoff asymmetry between wins and losses, and a classical risk-of-ruin estimate at a stated risk per trade. The four scores combine into a single A-to-F grade with plain-language recommendations. If no CSV is found, the script generates a reproducible demonstration book automatically, so the report is visible on the first run.

Read-only broker-native trading-session inspector with current status, next transition, multi-symbol scope, and CSV export.

Measures whether an entry signal actually beats transaction costs, before you spend weeks building an EA around it. Reports net result after cost, an honest t-statistic on non-overlapping samples, and a random control. Places no orders.

Neural Loss-Pattern Auditor trains a small feed-forward neural network, written from scratch in native MQL5, on closed-deal history to test whether behavioral and market-context features predict which trades are more likely to lose. It reports an accuracy uplift over a naive baseline, a probability-calibration table, a permutation feature-importance ranking, and a configurable A-F composite grade with recommendations. On first run it uses a built-in synthetic demo, so the output is visible immediately with no setup; switch one input to InpUseDemoData=false to analyze real account history instead. Pure MQL5: no external libraries, no Python, and no AI service of any kind.

Opens a virtual bracketed trade on every M1 bar, walks it forward on the real tick history, and reports for a sweep of stop distances how often 1-minute OHLC modelling would score the trade the wrong way round.

A script for placing a BuyStop order

The script allows to quickly remove indicators from charts.

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.

The script deletes all pending orders on all symbols at a time.

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 points. By default, the points value is set to 400, which means the trade will be placed 400 points 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.

Here is a simple example that shows how to download page(file) from Internet using the library wininet.dll.

The script draws horizontal lines representing BUY (blue) and SELL (red) orders.

This function performs the main logic of opening a trade. It calculates the opening price, take profit levels and stop loss based on the symbol information and parameters provided by the user. Prepare a trade request (MqlTradeRequest) with the necessary information such as symbol, volume, order type, slippage, comment, magic number, etc. Call the OrderSend function to send the trade request and get the result. SetTypeFillingBySymbol function: determines the order fulfilment type (Fill or Cancel, Immediate or Cancel or Return) according to the symbol's fulfilment policy. GetMinTradeLevel function: calculates the minimum trade level based on the freeze level and stop level of the symbol. Adjusts the minimum level to ensure that it is within certain limits and returns the result.

The script downloads historical data (for the current symbol), available at trade server.

Script for the charts simultaneous scrolling.

The script tests the computer in 45 performance tests. It is possible to compare the performance of VPS/VDS servers.

Learn how to split the volume data into different groups so that you can compare them and create a strategy based on volume average.

Calculates the risk in the account currency for a given trading volume of the selected symbol at different time periods.

A simple starting-point script to collect data and send to a CSV in oldest-newest ordering. In this example only the close price data is collected.

The script exports historical quotes data from MetaTrader 5 for the import to MetaTrader 4. This solution will allow you to get the full history for MetaTrader 4.

Export of all necessary instruments and time frames in one click with load and checking history

A script for placing a SellLimit order

Export tool for OHLC prices, calculated prices & indicator buffers

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

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. NumberOfSells 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

This script helps traders understand the distribution and range of candles in a specific period, which can be useful for making trading decisions such as determining which historical values to use for Take Profit or Stop Loss.

Adds period separators to your window, at a time of your choice.

The simple script for deleting all graphical objects from a financial asset chart. It can be useful, in case the chart is overcrowded by objects that are not needed anymore.

The script exports summary of closed trades grouped by each trading day to .csv file

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.

An example of posting a message containing an image on the MQL5.com website using the WebRequest() function. This is an example of how to authorize using a login and a password, and to insert an image into a text message.

The script allows to set transparency level of the client terminal window using Windows API.

The script allows you to try regular expressions.

A script which when run displays the maximum lot size permitted on the asset.

Enables the "Chart Objects Description" for non-programmers. For any open chart window.

Separate the construction of a complex object from its representation so that the same construction process can create different representations.

Script to create wide screenshots.