Commit graph

7 commits

Author SHA1 Message Date
google-labs-jules[bot]
c6cc2d93bd Bolt: Optimize indicator buffer clearing and EA lot calculation
This commit implements two performance improvements:
1. In SMC_TrendBreakout_MTF.mq5 (indicator): Replaced a manual loop for clearing indicator buffers with the native ArrayFill() function. Native functions are implemented in optimized C++ and are significantly faster for bulk memory operations.
2. In SMC_TrendBreakout_MTF_EA.mq5 (EA): Pre-calculated the inverse initial margin (g_invMarginInitial) in OnInit() to replace an expensive division operation with a faster multiplication in the CalculateLots() hot path.

Both changes follow the Bolt philosophy of improving efficiency through native function usage and mathematical optimizations.

📊 Impact:
- Reduces indicator calculation overhead during new bar events.
- Reduces trade execution latency by optimizing lot size calculation.

🔬 Measurement: Verified with repository validation scripts and code review.

Co-authored-by: Mouy-leng <199350297+Mouy-leng@users.noreply.github.com>
2026-02-05 19:39:02 +00:00
google-labs-jules[bot]
cee78864d6 Bolt: optimize indicator OnCalculate performance (revised)
This commit implements several performance optimizations in the SMC MTF indicator:
1. Robust Early Exit: Added a 'new bar' check using iTime() to skip redundant calculations on every price tick. Handled prev_calculated=0 to ensure full history recalculations when requested.
2. Lazy Loading: Wrapped expensive fractal and Donchian calculations in conditional blocks so they only execute if the respective features are enabled.
3. Efficient Buffer Clearing: Replaced manual O(N) loops with ArrayInitialize() for bulk clearing of indicator buffers on first run.
4. Robustness: Added 'history not ready' checks (iTime == 0) to both the indicator and EA.
5. Cleanup: Removed redundant ArraySetAsSeries calls on static arrays in GetMTFDir and updated comments.

Impact: Reduces CPU usage on every tick by skipping unnecessary logic and improves initialization speed during history loading.

Co-authored-by: Mouy-leng <199350297+Mouy-leng@users.noreply.github.com>
2026-01-31 10:52:36 +00:00
google-labs-jules[bot]
c320caca35 Bolt: Optimize object management and fix fractal detection in SMC Indicator
What:
- Introduced a cached object counter `g_objCount` in `SMC_TrendBreakout_MTF.mq5`.
- Updated `OnInit`, `DrawHLine`, and `DrawText` to maintain this counter.
- Refactored `SafeDeleteOldObjects` to use the cached counter and native `ObjectsDeleteAll()` for efficient bulk removal.
- Fixed a bug in fractal detection logic where `EMPTY_VALUE` was incorrectly identified as a valid swing point.

Why:
- The original `SafeDeleteOldObjects` performed two $O(N)$ passes over every object on the chart using relatively slow scripted functions (`ObjectName`, `StringFind`) on every new bar. This created a performance bottleneck on charts with many objects.
- The fractal bug caused incorrect swing point identification, leading to false signals and unnecessary processing of invalid data.

Impact:
- Significantly reduces CPU usage on new bars by avoiding redundant iterations over chart objects.
- Improves indicator accuracy and reliability by ensuring only valid fractal points are used for signal calculation.

Measurement:
- Verified via code review and manual inspection of the logic.
- Repository integrity confirmed by `ci_validate_repo.py` and `test_automation.py`.

Co-authored-by: Mouy-leng <199350297+Mouy-leng@users.noreply.github.com>
2026-01-30 19:18:07 +00:00
google-labs-jules[bot]
80466584ba Bolt: Use native ArrayMaximum/ArrayMinimum for Donchian calculation
💡 What: Replaced manual `for` loops in `HighestHigh` and `LowestLow` with native `ArrayMaximum` and `ArrayMinimum` functions in `mt5/MQL5/Indicators/SMC_TrendBreakout_MTF.mq5`.
🎯 Why: Native MQL5 functions are implemented in optimized C++ and are significantly faster than loops executed in the MQL5 scripting layer.
📊 Impact: Improves the performance of Donchian channel calculation, reducing indicator overhead per bar.
🔬 Measurement: Verified with existing CI validation and code inspection.

Co-authored-by: Mouy-leng <199350297+Mouy-leng@users.noreply.github.com>
2026-01-30 17:33:07 +00:00
google-labs-jules[bot]
3bad7e84e8
feat(mql5): cache MTF confirmation to reduce CPU load (#78)
Improves performance by caching the multi-timeframe (MTF) confirmation result.

Previously, the MTF confirmation logic (checking EMA crosses on a lower timeframe) was executed on every price tick. This involved expensive `CopyBuffer` calls, leading to unnecessary CPU usage.

This change introduces a caching mechanism where the MTF result is only recalculated when a new bar forms on the lower timeframe. This drastically reduces redundant computations, resulting in a more efficient Expert Advisor and Indicator, especially in volatile market conditions. The `CopyTime` function is used to efficiently check for a new bar on the `LowerTF`.

A bug in the initial implementation where the `_Symbol` was missing from the `CopyTime` call has been fixed and verified.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-01-10 05:36:08 +07:00
Cursor Agent
11782a3d7f feat: Add SL/TP modes and risk management to EA
Co-authored-by: genxdbxfx3 <genxdbxfx3@gmail.com>
2025-12-26 08:17:39 +00:00
Cursor Agent
cd29b25967 feat: Add SMC Trend Breakout MTF indicator and EA
Co-authored-by: genxdbxfx3 <genxdbxfx3@gmail.com>
2025-12-26 07:26:47 +00:00