mirror of
https://github.com/softwaredevelop/mql5.git
synced 2026-08-12 20:08:05 +00:00
refactor: Fixed smoothing overflow bug
This commit is contained in:
@@ -25,9 +25,10 @@ By using percentage change, the indicator allows for a direct "apples-to-apples"
|
||||
|
||||
## 3. MQL5 Implementation Details
|
||||
|
||||
* **Universal Engine (`Symbol_Strength_Calculator.mqh`):** The core logic is encapsulated in a flexible engine that can handle any symbol string provided by the user. It includes robust error handling for missing data or synchronization delays.
|
||||
* **Dynamic Dashboard:** A custom-drawn dashboard panel in the indicator window provides a real-time, sorted list of the active symbols with their exact strength values (to 3 decimal places), color-coded to match the chart lines.
|
||||
* **Optimized Performance:** The indicator employs smart history limiting on the first load to prevent lag, and subsequent updates are incremental.
|
||||
* **Universal Engine (`Symbol_Strength_Calculator.mqh`):** The core logic is encapsulated in a flexible engine that can handle any symbol string provided by the user. It includes robust error handling for missing data or synchronization delays, ensuring the indicator doesn't freeze the terminal while waiting for data.
|
||||
* **Robust Data Handling:** The indicator includes advanced synchronization checks (`IsDataReady`). It ensures that historical data for all selected symbols is fully loaded and synchronized before performing calculations. This prevents the display of misleading or "glitchy" lines during chart startup or timeframe changes.
|
||||
* **Safe Smoothing Algorithm:** The smoothing logic is designed to handle data gaps and initialization phases gracefully, preventing mathematical overflows or "exploding" values that can occur when smoothing incomplete data series.
|
||||
* **Dynamic Dashboard:** A custom-drawn dashboard panel in the indicator window provides a real-time, sorted list of the active symbols with their exact strength values (to 3 decimal places), color-coded to match the chart lines. It automatically hides symbols that are disabled in the settings.
|
||||
|
||||
## 4. Parameters
|
||||
|
||||
@@ -49,6 +50,7 @@ This indicator is the "Strategic Compass" for multi-asset traders.
|
||||
1. **Risk On / Risk Off:**
|
||||
* **Risk On:** Equity indices (US500, USTEC, DE40) are rising and are at the top of the matrix. Safe havens (Gold, JPY) are falling or at the bottom.
|
||||
* **Risk Off:** Equities are falling. Safe havens (Gold, JPY) are rising and leading the matrix.
|
||||
* *Action:* If Gold spikes while Stocks drop, look for short setups on indices.
|
||||
|
||||
2. **Sector Rotation (US Indices):**
|
||||
* Compare **USTEC (Nasdaq)** vs. **US30 (Dow)**.
|
||||
@@ -57,6 +59,10 @@ This indicator is the "Strategic Compass" for multi-asset traders.
|
||||
|
||||
3. **Regional Rotation:**
|
||||
* Compare **US500 (USA)** vs. **DE40 (Europe)** vs. **JP225 (Asia)**.
|
||||
* Trade the index of the strongest region against the weakest region (if your broker allows) or simply focus your intraday trading on the strongest market.
|
||||
|
||||
4. **Commodity Correlations:**
|
||||
* Rising **Oil (WTI)** often supports energy-heavy indices (like UK100) but can weigh on consumer/tech sectors due to inflation fears.
|
||||
|
||||
## 6. Troubleshooting
|
||||
|
||||
@@ -64,4 +70,4 @@ If a line appears flat at 0.000% or shows "N/A":
|
||||
|
||||
1. **Check Symbol Name:** Ensure the symbol name entered in the parameters matches **exactly** what is listed in your Market Watch window (e.g., your broker might use "XAUUSD" instead of "Gold", or "SPX500" instead of "US500").
|
||||
2. **Check Experts Tab:** Look at the "Experts" tab in the Terminal toolbox. The indicator will print an error message if it cannot find a symbol (e.g., `Symbol 'Gold' not found!`).
|
||||
3. **Data Loading:** On the first load, it might take a few seconds for the indicator to download history for all 8 symbols.
|
||||
3. **Data Loading:** On the first load, it might take a few seconds for the indicator to download history for all symbols.
|
||||
|
||||
Reference in New Issue
Block a user