From 740b5606e57db7681447c71acbde0860ffa5e7b4 Mon Sep 17 00:00:00 2001 From: Toh4iem9 Date: Wed, 15 Oct 2025 10:43:24 +0200 Subject: [PATCH] refactor: Using Time+Rand for a truly unique instance ID --- Indicators/MyIndicators/Session_Analysis_Pro.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Indicators/MyIndicators/Session_Analysis_Pro.md b/Indicators/MyIndicators/Session_Analysis_Pro.md index f70eef2..9c78e5d 100644 --- a/Indicators/MyIndicators/Session_Analysis_Pro.md +++ b/Indicators/MyIndicators/Session_Analysis_Pro.md @@ -25,8 +25,9 @@ The indicator identifies bars belonging to a specific time window and performs f ## 3. MQL5 Implementation Details * **Modular, Object-Oriented Design:** The entire logic is encapsulated within a `CSessionAnalyzer` class. The main indicator file instantiates three separate objects of this class, one for each user-defined session (Pre-Market, Core, Post-Market). +* **Multi-Instance Support:** Each instance of the indicator generates a unique ID upon initialization (using a combination of a timestamp and a random number). This ID is used as a prefix for all graphical object names, ensuring that multiple copies of the indicator can run on the same chart without interfering with each other's drawings. * **Heikin Ashi Integration:** An inherited `CSessionAnalyzer_HA` class allows all calculations (VWAP, Mean, and LinReg) to be performed seamlessly on smoothed Heikin Ashi data. -* **Efficient "On New Bar" Updates:** The entire complex calculation and object redrawing process is only performed **once per bar**, preventing unnecessary CPU load. +* **Efficient "On New Bar" Updates:** The entire complex calculation and object redrawing process is only performed **once per bar**, preventing unnecessary CPU load on every tick. * **Robust Time Handling:** The indicator correctly identifies session boundaries regardless of the chart's timeframe and properly handles overnight sessions. * **Graphical Objects:** All visualizations are drawn using `OBJ_RECTANGLE` and `OBJ_TREND` objects for maximum flexibility.