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.
- Platform Logs - For Advanced Users - Getting Started
- Example of developing a program
- Additional Features - Price Charts, Technical and Fundamental Analysis
It should appear in the Journal tab of Back-Tester window, at least my prints do that here.
Markus
Markus
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.
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.
I imagine it's to prevent a huge journal log during optimizations.
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
Thank you, Slawa.
Also, nice page to have for reference.
Also, nice page to have for reference.
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?
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?
@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 !!
You're welcome :-)
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?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register