input bool EnablePrint=true; void PrintMe(string s){ if(EnablePrint) Print(s); } : PrintMe( StringFormat("value=%f",value) );
enum status {SC_LIVE, SC_VISUAL, SC_OPTIMIZER }; status status_chart; int OnInit(){ if ( !IsTesting() ) status_chart = SC_LIVE; else if( IsVisualMode() ) status_chart = SC_VISUAL; else{ status_chart = SC_OPTIMIZER; } void PrintMe(string s){ if(status_chart != SC_VISUAL) Print(s); } : PrintMe( StringFormat("value=%f",value) );
Thaks WHRoeder!
winterz:
Use compile time defines. Saves having the overhead of doing "if" comparisons for every tick when not testing and EA is in production: https://docs.mql4.com/basis/preprosessor/conditional_compilation
Just wondering if I could pick anyone's brain with regards to prints across ones algorithm?
How would I turn all prints on and off with the "flick" of a button?
Any thoughts, ideas or shove in the right direction would be nice :)
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
Just wondering if I could pick anyone's brain with regards to prints across ones algorithm?
How would I turn all prints on and off with the "flick" of a button?
Any thoughts, ideas or shove in the right direction would be nice :)