Join our fan page
This script is a reference solution for mapping symbol names configured by users in MetaTrader 5 EAs or scripts to the actual names provided by the broker. It uses the Levenshtein distance algorithm to automatically identify the most similar symbol in Market Watch. Ideal for developers facing compatibility issues with prefixes or suffixes in symbol names. It is a customisable starting point to suit any specific need.
This is an example of ascending sort a struct list by a field. You can find out and customize the above algorithm depending on the purpose of use, this is the most basic example is also a direction to resolve the arrangement in an array of structure. The algorithm used in this example is Quick Sort and Merge Sort.
Unfortunately, I found that some brokers Changing the time on the server is a bit incorrect, which I didn't expect. and which surprised me a lot. Here is a script that anyone can use to check their broker.
Unfortunately I had to realise that some brokers are a bit careless with the server time changeover, which I had not expected and which surprised me a lot. Here is a script with which everyone can check their broker.
MQL5 script for MetaTrader 5 that adds two buttons to close all buy or sell positions for the current symbol.
This is a simple script file to compute lot size either using risk percentage approach or the actual amount to risk.
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.
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.
Population-based optimisation algorithms are collected here. The archive contains all necessary files to run the algorithms on test functions.
The function can be useful to not overload the server with trade requests at times when the market is closed for trading
The Auto SL TP by Risk Reward Ratio script is a simple yet powerful tool designed for MetaTrader 5 traders who want to streamline their risk management process. This script automates the process of setting Stop Loss (SL) and Take Profit (TP) levels for open positions based on a user-defined Risk:Reward ratio and Stop Loss in pips. Whether you're a beginner or an experienced trader, this script saves time and ensures consistent risk management.
It is taken into account that there are 30 days in a month, 365 days in a year The script demonstrates the counter of time until the beginning of the new year
Trading XAUUSD (Gold) is often influenced by major economic news events like USD, GBP, or EUR releases. To mitigate risks during these volatile periods, using a News Filter in your Expert Advisor (EA) is essential. In this article, I’ll share how to create a simple News Filter on MT5 and apply it to XAUUSD trading.
A simple and effective Expert Advisor based on Stochastic Oscillator reversal signals on the H1 timeframe. Buy signals are triggered when %K crosses above %D below the 20 level. Sell signals are triggered when %K crosses below %D above the 80 level. Risk is calculated based on the account balance, with the lot size set to 0.1 (adjustable as needed). Take Profit (TP) is set to 300 points for all positions. Stop Loss (SL) is dynamically calculated based on the opposite crossover signal. The position is closed when a crossover in the opposite direction occurs, as well as when TP or SL is reached
This CalculateHistoryProfit script version 1.0 is designed to calculate profit for a specified period using a chart panel.
These are some #define statements that are useful to perform operations in your EA. You only need to assign the name of your variables at the beginning of the file, and then let the other #define statements do the work. In order to use this file, add #include <DEFINE_statements.mqh> to the first line in your EA file.
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.
A script which when dragged onto the chart will print out in the experts window the number of bars that are on that chart - like magic.
Unfortunately, I discovered that some brokers are a bit sloppy with the server time change due to the daylight saving time (DST), which I did not expect and which surprised me a lot. Here is a script with which anyone can check their broker.
This script was developed for displaying saved Strategy report from the Strategy Tester into a chart.
This script is a reference solution for mapping symbol names configured by users in MetaTrader 5 EAs or scripts to the actual names provided by the broker. It uses the Levenshtein distance algorithm to automatically identify the most similar symbol in Market Watch. It is ideal for developers facing compatibility issues with prefixes or suffixes in symbol names. This is a customizable starting point to adapt to any specific needs.
The script MinMargins.mq5 is designed to help traders quickly calculate and document the minimum amount of money required to open a position with the smallest lot size for all symbols available in the Market Watch. This data is saved to a CSV file for easy review and analysis.
This service periodically checks swaps for predefined symbols and saves detected changes into CSV-files for further analysis and potential replay (not implemented here). Also it monitors and alerts swap changes of existing positions.
This script saves a predefined set of economic events from the MetaTrader's built-in economic calendar into CSV file.
This MQL5 script exports candlestick data for various timeframes into a CSV file, capturing essential market information like open, high, low, and close prices. It analyzes each candlestick's characteristics, including body and wick sizes, while calculating additional metrics such as candle gaps. After processing the latest 21 bars, it notifies the user upon successful data export.
Time-related functions for empirical detection of server time zone and daylight savings mode (DST) from history of quotes
- The script scans through the current chart for any available chart objects, - Counts and delete them accordingly - And log the the names of the objects on the chart respectively.
Translate risk percentages to the monetary figure based on the account balance
A script which when run displays the maximum lot size permitted on the asset.
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)
This script saves all the OHLCV data available on the chart to a CSV file.
It will delete all objects on the chart when the compiled executable is dragged onto the chart
Sample code to count consecutive no. of bull or bear bars.
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.