//+------------------------------------------------------------------+ //| PrintVerbose.mqh | //| AnimateDread | //| https://www.mql5.com | //+------------------------------------------------------------------+ //| TWO LEVELS, BECAUSE ONE SWITCH MADE VERBOSE UNUSABLE. | //| | //| `VerboseMode` was all-or-nothing, so turning on ANY diagnostic | //| also turned on the per-tick tracing, and the journal stopped | //| being readable at exactly the moment someone needed to read it. | //| Measured on the 2026-09-06 tester log, 1,570,535 lines: | //| | //| 556,732 35.4% "Starting direction calculation..." | //| 556,731 35.5% "Final directional result: ..." | //| 247,146 15.7% the two open-rejected traces | //| ------------------------------------------------------------ | //| 1,360,609 86.6% of the log, from FOUR print statements. | //| | //| None of those four is a decision. Direction() runs on every tick | //| and recurses into every filter, so on this fleet it is ~8 calls a | //| tick; the two lines it emits carry a filter count and a number. | //| The rejection traces fire whenever the direction policy blocks a | //| side, which on a one-sided chart is every tick, forever. | //| | //| So: PrintVerbose() keeps its exact meaning and every one of its | //| ~40 call sites is untouched. PrintTrace() is the new, noisier | //| level for anything that can fire per tick, and it is OFF unless | //| the operator asks for it with TraceMode. | //| | //| BUILD THE ARGUMENT BEHIND THE GATE, NOT INSIDE THE CALL. These | //| are plain functions, so an argument is concatenated and formatted | //| on every call whether or not the level is on. The hot sites | //| therefore test WarriorTraceEnabled() themselves before building | //| a string, exactly as the existing sites test VerboseMode. | //+------------------------------------------------------------------+ #property copyright "AnimateDread" #property link "https://www.mql5.com" //--- Level 1: decisions, transitions, per-era summaries. Readable by a human. void PrintVerbose(string message) { if(VerboseMode) Print(message); } //--- Is the per-tick trace level on? Test this before building a trace string. bool WarriorTraceEnabled(void) { return TraceMode; } //--- Level 2: per-tick internals. Hundreds of thousands of lines per tester pass. void PrintTrace(string message) { if(TraceMode) Print(message); }