Manual Trading Integration for MetaTrader Strategy Tester
Info
The Manual Trading Integration for MetaTrader Strategy Tester is a Expert Advisor for MetaTrader 5 that this document outlines a method for linking manual orders to the metatrader strategy tester. Standard chart events do not function within the Strategy Tester.
Usage
This tool is typically used for automated trading on major forex pairs and gold.
Platform
This Expert Advisor works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Experts folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Manual Trading Integration for MetaTrader Strategy Tester
1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.
2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.
3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.
4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.
Frequently Asked Questions
Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.
Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.
Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.
What this tool does
This document outlines a method for linking manual orders to the MetaTrader Strategy Tester.
Typical Use Case
This Expert Advisor excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Expert Advisor works on MetaTrader 5. Place the file in the MQL5/Experts folder and restart the terminal.
Description & Settings
Related: Tick Scalper Helper: Tick Chart and One-Click Trading Panel for MT5 - another powerful expert for MetaTrader 5 traders.
This document outlines a method for linking manual orders to the MetaTrader Strategy Tester. Standard chart events do not function within the Strategy Tester. Currently, the only objects that can be placed in the Strategy Tester using basic MQL5 code are labels and buttons. While labels can be attached without issue, buttons placed in the tester cannot have their click states detected without advanced programming and integration with other systems. The technique described here relies on a file detection process. The Expert Advisor (EA) acts as a standalone receiver. On every tick, the EA checks a specific folder for a file that will trigger an order. Upon detecting the required text file in the designated folder, the EA executes a command to process the order and then deletes the file. Therefore, the presence of a specific file in a folder serves as the primary trigger for executing a trade. Users can now command the EA to execute orders using any method they devise to place a specific file in a designated folder. In this implementation, placing an empty text file named "buy.txt", "sell.txt", or "close.txt" in the "...\common\files\" folder within MetaTrader 5 will trigger the EA to execute a corresponding order based on the filename. The filename and its presence in the folder are crucial; the file content is not used. Only one of these three files should appear in the folder at a time. If multiple files are present, the EA will process the first one it reads and then delete any files matching these three names. The EA requires an external application to create and place these command text files into the specified folder. While an example Visual Basic application was developed, it cannot be shared directly. Users are encouraged to create or find their own application for this purpose. Recommendations:Also recommended: Basket Pair Closer: Efficiently Close Trading Positions - similar expert with strong performance on MetaTrader 5.
To use custom indicators with the Strategy Tester, save or rename the indicator template to "strategytesterpracticetrade.tpl", matching the EA's name.
Ensure correct placement of command text files in the "...\metaquotes\terminal\common\files\" directory.
This file detection method can be adapted for use beyond the Strategy Tester, enabling external influences on other EA codings. For instance, instead of just detecting filenames, file reading operations can be implemented to retrieve data for take profit, stop loss, and lot sizes from file content. This allows external applications to provide diverse inputs for EA reactions.
You may also like: CME Equity Index Futures Holiday Calendar and Trading Halt Automation - excellent alternative for expert users on MetaTrader 5.
Source Code
#property copyright "robotfx"
#property link "https://robotfx.org"
#property version "1.00"
#property description "this code is educational. feel free to use, modify and upgrade as you wish. visit robotfx.org for professional trading tools"
#property description "this code is educational. feel free to use, modify and upgrade as you wish. visit robotfx.org for professional trading tools"
#property description "this code is educational. feel free to use, modify and upgrade as you wish. visit robotfx.org for professional trading tools"
/*
note: (please read, this is important!!!)
- in order for this ea to use its function on the strategy tester, a textfile command outside mt5's processing is needed for the manual order execution.
- the ea will take the "buy/sell/close" order command mainly on the existance of certain files as "buy.txt", "sell.txt", or "close.txt" at the mt5's common file folder.
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.