This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community

Print() not working in expert during backtest.


Back to topics list  | 1 2
avatar
39
davidwt 2005.08.26 03:35 
I have Print() statements in my simple expert that successfully print to the experts log while running the expert on a chart. The exact same expert run during a backtest does not print anywhere that I can find (i've searched every file modified by today's date, no log file anywhere contains what should have been printed). This makes for difficult debugging if I cannot print anything during a backtest.
avatar
239
Shimodax 2005.08.26 11:51 

It should appear in the Journal tab of Back-Tester window, at least my prints do that here.

Markus
avatar
39
davidwt 2005.08.26 15:36 
I think I figured out when it does and does not print. It will print to the journal log when the optimization is disabled, and will not print when the optimization is enabled.

Maybe that is intentional to prevent huge journal log generation or slowing down the execution. I'm not sure, but its probably not a bug. Hopefully, someone from MQ will confirm this.
avatar
129
Vooch 2005.08.27 11:11 
I imagine it's to prevent a huge journal log during optimizations.
avatar
4464
Slawa 2005.08.28 01:05 
I imagine it's to prevent a huge journal log during optimizations.

you are right
"Testing Features and Limits in MetaTrader 4" - Special Features of Optimization Process
avatar
39
davidwt 2005.08.28 01:41 
Thank you, Slawa.

Also, nice page to have for reference.
avatar
85
bubo 2005.08.29 04:15 
I have a problem with printing as well - it does not even print to the journal during live sessions.

I used the syntax:

Print(variable1, variable2);

as in MT3 before. Does this not work on my computer for MT4 - do I need to do anything else?



avatar
239
Shimodax 2005.08.29 05:30 

@Bubo

If it's an Indicator or EA running real time it prints to the "Experts" tab of the Terminal pane.



Markus
avatar
85
bubo 2005.08.30 00:44 

@Bubo

If it's an Indicator or EA running real time it prints to the "Experts" tab of the Terminal pane.

Markus


Oh, it is in 'Experts' in MT4 - not 'Journal' as in MT3. Thank you !!
avatar
239
Shimodax 2005.08.30 02:37 

You're welcome :-)
avatar
85
bubo 2005.08.30 20:45 

You're welcome :-)


A related question - does anybody know how to print those results seen in 'Experts' to a file in MT4, for later viewing?
Back to topics list   | 1 2  
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets