The Session Analysis Pro is an advanced, multi-faceted analytical tool designed to visualize and analyze price action within specific, user-defined trading sessions. It is particularly useful for traders who focus on the dynamics of the major market opens.
This powerful indicator can simultaneously display and analyze up to **three independent markets** (e.g., NYSE, LSE, TSE), each with its own customizable **Pre-Market, Core, Post-Market, and optional Full Day** sessions.
2.**Volume Weighted Average Price (VWAP):** The true average price for the session, weighted by volume, rendered using a high-performance, buffer-based drawing method for maximum speed and stability.
2.**Volume Weighted Average Price (VWAP):** Calculates the cumulative, volume-weighted average of the `Typical Price``(H+L+C)/3`, resetting at the start of each new session. The calculation is performed by a dedicated, optimized engine.
* **VWAP via Indicator Buffers:** All VWAP calculations are handled by a dedicated `CVWAPCalculator` engine. This engine writes its results directly into MQL5's fastest drawing mechanism: **indicator buffers** (`DRAW_LINE`). We use the **"double buffer" technique** to create clean visual gaps between sessions.
* **Boxes & Stats via Graphical Objects:** The Session Box, Mean, and Linear Regression lines are drawn using standard graphical objects (`OBJ_RECTANGLE`, `OBJ_TREND`). This is handled by a separate `CSessionAnalyzer` class, providing flexibility for these elements.
* **Unified Heikin Ashi Integration:** When `CANDLE_HEIKIN_ASHI` is selected, the indicator uses a unified approach. Both the `CVWAPCalculator` and the `CSessionAnalyzer` instantiate their respective `_HA` child classes, leveraging our optimized `HeikinAshi_Tools` library. This ensures that **all visual components** are consistently calculated using the smoothed Heikin Ashi data.
* **Robust Multi-Instance Support:** Each instance of the indicator on a chart generates a unique, stable ID for its graphical objects using the `ChartWindowFind()` method. This ID is used as a prefix for all object names, ensuring that multiple copies of the indicator can run on the same chart without any conflicts.
* **Stability via Full Recalculation on New Bar:** Given the complexity of managing multiple overlapping sessions and graphical objects, we employ a **full recalculation** strategy. However, to ensure high performance, this heavy calculation is executed **only once per new bar**.
* When a new bar opens, the indicator clears its buffers and recalculates the session logic from scratch.
* This "clean slate" approach guarantees absolute data integrity and visual stability, preventing any synchronization issues between the buffers and the objects, while keeping the chart responsive during the bar's formation.
* **History Optimization:** To keep template files small and chart loading fast, the indicator includes a `Max History Days` parameter. This limits the drawing of both graphical objects (boxes) and indicator buffers (VWAP lines) to the specified number of days, preventing the accumulation of thousands of obsolete objects in history.
*`InpMaxHistoryDays`: Limits the number of past days for which sessions and VWAP lines are drawn. Set to `0` to draw all history (warning: may result in large template files). Default is `5`.
**IMPORTANT:** All times are listed in various time zones for comparison. You must use the times that correspond to your **broker's server time** in the indicator settings. Be aware that you may need to adjust these times twice a year due to Daylight Saving Time (DST) changes.
* **Contextual Analysis:** The primary use is to understand the behavior of price during specific, high-volume trading sessions.
* **VWAP as a Benchmark:** The VWAP line is a key level for intraday traders. Price action above the session VWAP is generally considered bullish; price action below is bearish.
* **Mean and Linear Regression:** These lines provide a statistical "fair value" for the session. The slope of the regression line indicates the overall direction and strength of the session's trend.
* **Range Box:** The high and low of the session box become critical support and resistance levels for subsequent trading sessions.