forked from LengKundee/MQL5-Google-Onedrive
💡 **What:** Added a guard clause to the `OnTick()` function to exit early if a new bar has not yet formed. 🎯 **Why:** The `OnTick()` function was executing expensive calculations (like `CopyRates` and `CopyBuffer`) on every incoming price tick, even when the underlying chart data hadn't changed. This caused unnecessary CPU load, especially in volatile markets. 📊 **Impact:** This change drastically reduces the number of times the core trading logic is executed, limiting it to once per bar. This leads to significantly lower CPU usage and a more efficient Expert Advisor. 🔬 **Measurement:** The improvement can be verified by adding logging statements to the `OnTick()` function and observing that the main logic is now only executed once per bar, instead of multiple times per second. |
||
|---|---|---|
| .. | ||
| SMC_TrendBreakout_MTF_EA.mq5 | ||