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

Demo_FileWriteArray - MetaTrader 5 Expert - MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |

The Expert Advisor gets the values ​​of the bid and ask prices at each price change and writes them into the "prices" structure array. Every twentieth price tick, the Expert Advisor writes the structure object data to a file using the following command: filewritearray () function. The data will be logged in a binary file in a subdirectory of the local terminal folder. The following command can be called to obtain the terminal local folder location terminal information string () function.

 Printing format ( "Path of terminal local folder: %s\\Files\\" , terminal information string ( terminal data path ));
When deleting the Expert Advisor from the chart, unwritten data will be written to the file, and then the Expert Advisor will terminate its work.

Code:


Attachment download

📎demo_filewriterarray.mq5 (3.13 KB)

Source: MQL5 #1620

Verification code Refresh