Menu

Writing an MQL5 trade journal to CSV with FileOpen so every EA fill is on record
📰

Writing an MQL5 trade journal to CSV with FileOpen so every EA fill is on record

DEV Community: tutorial·Omais Ali·10 days ago
#l3NI53eG
#devtotutorial#devto#dev#fields#trans
Reading 0:00
15s threshold

The Experts log scrolls away, and the terminal history does not record why the EA took a trade. A small CSV journal fixes both. Every time a deal is added, the EA writes one line with the time, symbol, direction, volume, price, profit, and a reason string. You can open the file in a spreadsheet, compare it with the backtest, and answer questions like "why did it buy here" a week later.

Where the file goes

FileOpen without FILE_COMMON writes to MQL5/Files inside the terminal data folder. In the Strategy Tester that becomes the agent's own sandbox folder, which is deleted or hard to find.

With FILE_COMMON the file lands in the shared Terminal/Common/Files folder. Every terminal on the machine and the tester agents can reach it, so it is the easiest place for a journal.

MQL5 cannot write outside these sandboxes.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.