How to read the Journal to trigger an EA? 'MqlJournalInfo' - undeclared identifier error.

 

Hello everyone,

I'm trying to create an EA that reads messages from the Journal (e.g., "GBPJPY diver for BUY") to trigger a trade. I've tried using the JournalRead() function with the MqlJournalInfo structure, but I'm getting the compiler error: `'MqlJournalInfo' - undeclared identifier'.

The strangest part is that I have asked several other users on this forum to try and compile sample code with this function, and they all get the exact same error.

Could someone please provide a simple and working code example that demonstrates the correct way to use JournalRead ? Which #include files are truly necessary, or what is the correct procedure for the compiler to recognize the MqlJournalInfo structure?

Thanks in advance for your help.

 

I don't see any mqlJournalInfo structure listed at Data Structures - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5.

However, I do see a free and highly detailed web-based solution at:

Articles

How to create a trading journal with MetaTrader and Google Sheets

Sara Sabaghi, 2024.10.07 17:14

Create a trading journal using MetaTrader and Google Sheets! You will learn how to sync your trading data via HTTP POST and retrieve it using HTTP requests. In the end, You have a trading journal that will help you keep track of your trades effectively and efficiently.