Separate the diagnostic channels
Compiler diagnostics appear before execution. GetLastError exposes the terminal runtime layer. Trade requests add MqlTradeCheckResult and MqlTradeResult retcodes. A useful log names the channel instead of printing one unlabeled number.
| Layer | Read from | Example |
|---|---|---|
| Compiler | MetaEditor build output | 256 undeclared identifier |
| Terminal runtime | GetLastError | 4806 indicator data not found |
| Trade precheck | MqlTradeCheckResult.retcode | Request validation result |
| Trade server | MqlTradeResult.retcode | 10030 invalid filling type |
