MQL5-Google-Onedrive/mt5
google-labs-jules[bot] a7726f398b Bolt: Optimize lot calculation in SMC EA
This commit optimizes the lot size calculation in `SMC_TrendBreakout_MTF_EA.mq5` by:
1. Pre-calculating the inverse of `SYMBOL_MARGIN_INITIAL` in `OnInit` to replace division with multiplication.
2. Refactoring `CalculateLots()` to apply margin clamping before normalization, ensuring a single execution path for rounding and limit checks.
3. Reducing redundant math operations in the trade execution path.

Performance Impact:
- Reduces redundant `MathFloor`, `MathMax`, `MathMin`, and multiplication operations in `CalculateLots`.
- Replaces expensive division with faster multiplication.
- Improves code readability and maintainability by applying the DRY principle.

Verification:
- Ran `python scripts/ci_validate_repo.py` and `python scripts/test_automation.py`.
- Manually verified the logic flow for both normal and margin-clamped scenarios.
2026-02-07 19:30:31 +00:00
..
MQL5 Bolt: Optimize lot calculation in SMC EA 2026-02-07 19:30:31 +00:00