Collect data (date, time and closing price) - MetaTrader 5 Script | Trading Script Download - MT4/MT5 Resources
As you can see, this is a short script that collects the closing prices and places them in a column after a date string and a time (hours and minutes) string.
By default, data is saved to comma-separated values (CSV) files in the MQL5/Files folder for external use on demand.
There are no frills, bells and whistles about this, and I'm not familiar enough yet to know if it would be better (or if it's even possible) to use the CopyTime and CopyRates built-in functions instead of the iClose and iTime functions.
As they say, there's more than one way to skin a cat.
Attachment download
📎 grabcloses.mq5 (3.9 KB)
Source: MQL5 #56064
Collect data (date, time and closing price) - MetaTrader 5 script | Trading script download - MT4/MT5 resource usage and filtering suggestions
This content can be used as a data entry for foreign exchange EA, indicators, trading systems or quantitative strategies. When reading, it is recommended to make a judgment based on the platform version, trading type, time period, risk control method and historical discussion background. Do not use it directly based on the title or a single point of view.
If the content involves MT4/MT5, ForexFactory, MQL source code, TradingView indicators or strategy discussions, you can give priority to the parameter logic, backtest environment, market stage, execution cost and failure conditions, and then decide whether to continue downloading, reviewing or secondary development.
Risk warning
For any EA, indicator or automatic trading strategy, it is recommended to first conduct historical backtesting, simulation account verification and small capital testing. Grid, Martin, high frequency, recovery and examination strategies especially require setting the account risk upper limit, single variety risk upper limit and manual deactivation conditions.
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •