EA not printing to journal

 

Hi,

I am toying with MQL5 and wanted to print some info to the journal.

This should happen in OnInit()

Print("Symbol selected: " + Symbol());

Now my expectation is that this msg is printed in the journal when I attach the EA.

However, nothing happens other than: 2020.09.20 13:26:23.209 Experts expert Ticker (USDJPY,H1) loaded successfully


When using debug, the information I expect is printed to the journal.

Could this be because the market is closed and OnInit() is, therefore, not called?

Any other explanation for this?


Thanks

 

Let's check.

Here is the code:

//+------------------------------------------------------------------+
//|                                                            1.mq5 |
//|                              Copyright © 2020, Vladimir Karputov |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2020, Vladimir Karputov"
#property version   "1.000"
//--- input parameters
input int      Input1=9;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   Print("Symbol selected: " + Symbol());
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
  }
//+------------------------------------------------------------------+


Here's the result:

2020.09.20 14:49:40.325 1 (USDJPY,M15)  Symbol selected: USDJPY

As you can see, everything works great.

Files:
1.mq5  3 kb
 

Thank you,

your version worked for me after putting the 1.mq5 file into the Advisors folder in the MetaEditor and compiling it.

My file was in a project under Experts and not in Advisors.

After I put my mq5 file into the Advisors dir and compiling it the messages showed up.

Not sure why the EA was actually selectable in MT5 although it was not in the Experts-Advisor dir.

Perhaps a leftover of previous trials with the same name which was compiled and then the mq5 file deletec?

 
jensallmer :

Thank you,

your version worked for me after putting the 1.mq5 file into the Advisors folder in the MetaEditor and compiling it.

My file was in a project under Experts and not in Advisors.

After I put my mq5 file into the Advisors dir and compiling it the messages showed up.

Not sure why the EA was actually selectable in MT5 although it was not in the Experts-Advisor dir.

Perhaps a leftover of previous trials with the same name which was compiled and then the mq5 file deletec?

I don't know where you got the ' Advisors' folder - all EA's are located in the ' Experts' folder :


 
What if I downloaded the 1.mql and added it to my expert/advisors folder and still don't see any logs. This is the first time I've had a problem with Print not showing in journal so not sure what is wrong.
 
laclance #:
What if I downloaded the 1.mql and added it to my expert/advisors folder and still don't see any logs. This is the first time I've had a problem with Print not showing in journal so not sure what is wrong.

Prints do not appear in the journal, they are in the Experts log/Experts tab.

 
Message boxes not showing up either, only comments.
 
I'm having this problem as well. I never had it before. It started a week ago. The print function is not working anymore.
 
Show your code if you want help.
Reason: