MQL5-Google-Onedrive/mt5/MQL5
google-labs-jules[bot] e9f72697d0 Bolt: Optimize hot-path terminal API calls and memory management in SMC EA
This commit implements several performance optimizations in the `SMC_TrendBreakout_MTF_EA.mq5` Expert Advisor:
1.  **Lazy Account Info Retrieval**: Refactored `OnTick` to fetch `ACCOUNT_BALANCE`, `ACCOUNT_EQUITY`, and `ACCOUNT_MARGIN_FREE` only when a signal is confirmed and based on current risk settings. This significantly reduces terminal API calls.
2.  **Local Fixed-Size Arrays**: Replaced `static` dynamic arrays with local fixed-size arrays for `emaFast`, `emaSlow`, and `atr` data. This avoids the overhead of dynamic memory management and `ArraySetAsSeries`.
3.  **Redundant Calculation Removal**: Optimized `OpenBuyTrade` and `OpenSellTrade` by pre-calculating `slDistance` once and passing it to `CalculateTP` and `CalculateLots`.
4.  **Optimized Function Signatures**: Updated `CalculateTP` and `CalculateLots` to accept only the necessary metrics and pre-calculated values.

These changes result in a leaner "hot path" and reduced overhead during trade execution.
2026-02-10 10:55:01 +00:00
..
Experts Bolt: Optimize hot-path terminal API calls and memory management in SMC EA 2026-02-10 10:55:01 +00:00
Indicators Bolt: Optimized SMC_TrendBreakout_MTF indicator performance 2026-02-06 10:52:52 +00:00