E-Close by Time: Automated Position and Order Management
Info
The E-Close by Time: Automated Position and Order Management is a Expert Advisor for MetaTrader 4 that automated position and order management by timethis expert advisor (ea) is designed to automatically close open positions, delete pending orders, and optionally close the metatrader terminal at a specified time. Unlike simple time-based closures, this EA allows you to set a precise date and time for closing positions.
Usage
This tool is typically used for automated trading on major forex pairs and gold.
Platform
This Expert Advisor works exclusively on MetaTrader 4 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL4/Experts folder via File ? Open Data Folder in MetaTrader 4.
How to Install and Use E-Close by Time: Automated Position and Order Management
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
Automated Position and Order Management by TimeThis Expert Advisor (EA) is designed to automatically close open positions, delete pending orders, and optionally close the MetaTrader terminal at a specified time.
Typical Use Case
This Expert Advisor excels in automated trading and technical analysis on MetaTrader 4.
Compatible Platform & Setup
This Expert Advisor works on MetaTrader 4. Place the file in the MQL4/Experts folder and restart the terminal.
Description & Settings
Related: folow line ea - another powerful expert for MetaTrader 4 traders.
Automated Position and Order Management by TimeThis Expert Advisor (EA) is designed to automatically close open positions, delete pending orders, and optionally close the MetaTrader terminal at a specified time.
Also recommended: bruno expert advisor - similar expert with strong performance on MetaTrader 4.
Unlike simple time-based closures, this EA allows you to set a precise date and time for closing positions. You can also filter which positions are affected based on the symbol, order type, and magic number.
Two distinct times can be configured. The first time can be used to delete pending orders if they have not yet been triggered. The second time can be used to close all open market orders.
The EA also draws vertical lines on the chart to visually represent the set closing times.
Configurable Parameters:
numberaccount
=0 — Specifies the trading account number where the EA is allowed to operate. If set to 0, the EA is permitted to run on any account.
symbol
="" — The trading instrument to manage. An empty string ("") means any symbol, and "0" refers to the current chart symbol.
operation
=-1 — The type of trade operation to manage. -1 means any operation, 0 means Buy, and 1 means Sell.
magicnumber
=-1 — The magic number used to identify specific positions or orders for management.
setvline
=true — If true, a vertical line will be drawn on the chart at the specified closing date and time.
colorline
=red — The color of the vertical line.
styleline
=0 — The style of the vertical line: 0 = Solid, 1 = Dashed, 2 = Dotted, 3 = Dash-Dot, 4 = Dash-Dot-Dot.
widthline
=3 — The width of the vertical line.
deleteorders
=false — If true, pending orders will be deleted at the specified time.
closeterminal
=false — If true, the MetaTrader terminal will be closed at the specified time.
showcomment
=true — If true, EA parameters will be displayed in the upper-left corner of the chart.
usesound
=true — If true, trading operations will be accompanied by sound alerts.
soundsuccess
="expert.wav" — The sound file to play upon successful operation.
sounderror
="timeout.wav" — The sound file to play upon encountering an error.
slippage
=15 — The price slippage allowed in points. This value is for 5-digit brokers; for 4-digit brokers, use 2 or 3 points.
numberoftry
=3 — The number of retry attempts in case of trading errors.
You may also like: ad x expert - excellent alternative for expert users on MetaTrader 4.
Source Code
#property copyright "RobotFX"
#property link "https://robotfx.org"
extern string _P_Expert="---------- Параметры советника";
datetime DateTime;//=D'2015.12.29 00:57'; // Дата и время закрытия
datetime DateTimeDelete;
extern int HourClose=3; // Торговая операция:
extern int MinuteClose=20; // Торговая операция:
extern int HourDelete=3; // Торговая операция:
extern int MinuteDelete=15; // Торговая операция:
extern int NumberAccount = 0; // Номер торгового счёта
.......
⚠ 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.