Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Save OHLCV data from chart to CSV file - MetaTrader 5 Script - MT4/MT5 Resources

author blogger | 153 reads | 0 comments |

Save OHLCV Data from Chart to CSV File - script for MetaTrader 5

Save OHLCV Data from Chart to CSV File - script for MetaTrader 5

Save OHLCV Data from Chart to CSV File - script for MetaTrader 5

Save OHLCV Data from Chart to CSV File - script for MetaTrader 5

The standard way to get historical data in metatrader5 is to use the "View > Symbol > Request" tool, as shown in the image below:

Save OHLCV Data from Chart to CSV File - script for MetaTrader 5

However, this sometimes Does not return all available data on the chart.

The script saves all available historical data to a CSV file located in the Files folder within the Public Data Path directory.

Note: Make sure the "Maximum number of bars in chart" in "Tools > Options > Chart" is set to "Unlimited" (see image below).

Save OHLCV Data from Chart to CSV File - script for MetaTrader 5


Attachment download

📎script_ohlcv_to_csv.mq5 (4.25 KB)

Source: MQL5 #51567

Saving OHLCV data from chart to CSV file - MetaTrader 5 script usage and filtering suggestions

Saving OHLCV data from chart to CSV file - MetaTrader 5 Script is a resource related to trading scripts. Before downloading or referencing, it is recommended to confirm the platform version, transaction type, time period, whether DLL is required, whether source code is included, parameter description and historical update records.

Both automated trading tools and foreign exchange indicators should first undergo backtesting, simulated account observation, and small capital verification. Pay special attention to spreads, slippages, maximum drawdowns, position opening frequency, stop loss methods, trading periods and broker rules, and avoid direct real-time execution based on titles or short-term profit descriptions.

Refresh