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

Example of using CSV files as tables - Scripts for MetaTrader 5 - MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |

The example of the work with the CSV file as with a table - script for MetaTrader 5

This script demonstrates how the table works, where the only detail is that you need to know the number of columns.

news.txt should be converted to csv file with delimiter ";", or any other file but using the same code.

 File handle = file open ( "news.csv" , file read | file_CSV | file_ANSI , ';' );

Instead of ";" set the symbol.

This approach allows each row to be processed individually, and the first column "code" helps to understand where the search value is in the table.

The example of the work with the CSV file as with a table - script for MetaTrader 5


Attachment download

📎 news.txt (0.23 KB)

📎 working_with_csv.mq5 (1.62 KB)

Source: MQL5 #1380

Example of using CSV files as tables - Script usage and filtering recommendations for MetaTrader 5

Example of using a CSV file like a table - Scripts for MetaTrader 5 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.

Verification code Refresh