Session Vector [Gimmigela]

1. Description
Session Vector [Gimmigela] breaks each trading day into two sessions: An opening session window (default: first 15 minutes) and the remainder of the session to measure how they relate by combining price with volume participation into vectors. Designed to run exclusively on the daily timeframe, its primary objective is to determine if the intraday price action supported or opposed the opening move, as well as how much market participation was behind the movement.
2. Features
Session Vector [Gimmigela] breaks each trading day into two sessions: An opening session window (default: first 15 minutes) and the remainder of the session to measure how they relate by combining price with volume participation into vectors. Designed to run exclusively on the daily timeframe, its primary objective is to determine if the intraday price action supported or opposed the opening move, as well as how much market participation was behind the movement.
2. Features
- Work Done (columns)
The opening session and rest-of-day session uses Δ Price × Volume as a proxy for Work Done ("Mass"). When both move in the same direction, their contributions combine. When they move in opposite directions, their contributions offset one another. The resulting score represents a volume weighted measure of the relationship between the opening move and the subsequent follow on for the day. - Cosine Similarity & Scalar Projection (stepline, diamonds)
The second calculation uses vector geometry to examine the relationship between the opening and rest-of-day sessions. Each session is represented as a 2D vector using price and volume as its components. First, the angle between the opening vector and the rest-of-day vector is measured using cosine similarity. Next, a scalar projection score is calculated by multiplying the cosine similarity of the two vectors by the magnitude (length) of the rest-of-day vector. This score represents how much of the rest-of-day vector is aligned with the direction of the opening vector.
3. Construct
a.) Session Decomposition
Indicator divides the trading day into two phases: the opening session (default: 15min), and the subsequent rest-of-day session. Using request.security, the script pulls the corresponding session close and volume for each day.
b.) Volume Normalization & Scaling
Volume is capped at three times its 180 day moving average to limit the influence of outliers, then expressed as a ratio to that average. Price delta is expressed as a percentage. Because these quantities have different scales, the volume component is adjusted using the ratio of their historical root-mean-square (RMS) magnitudes. This brings the two components into a more comparable numerical range before they are combined.
c.) Work Done
The opening session and rest-of-day session Work Done is defined as Δ Price × Volume. To accurately capture overnight market sentiment, the change in price (Δ Price) for the opening session includes the opening gap, calculated as the current session's price minus the previous day's close.
d.) Dot Product
Each session is represented by a 2D vector whose components are price delta and volume. The dot product combines the corresponding price and volume components of the two vectors. A positive dot product indicates that the vectors point generally in the same direction, while a negative dot product indicates opposing directions.Pine Script®
e.) Cosine Similarity
This calculates the cosine of the angle between the vectors. Measured between −1 and +1, it expresses how closely the price and volume patterns of the opening phase align with those of the rest of the session.Pine Script®
f.) Scalar Projection
Cosine similarity is combined with the magnitude ("length") of the rest-of-day session vector to calculate a scalar projection value. The projection measures the rest-of-day session alignment relative to the opening session. This value is further adjusted based on whether the session continues or reverses the opening move and; whether the day's close finishes above or below the previous close.Pine Script®
4. Application
Gimmigela is used to observe differences in successive session activity, including potential trend continuation and reversals. An unusually high Work Done value and/or Cosine Similarity Projection score, followed by an immediate reversal may indicate potential exhaustion. Conversely, continued alignment may suggest that the prevailing trend is likely to persist. Market behavior is dynamic and any reading should be interpreted in the context of the prevailing trend and overall price structure.
Note: The indicator is designed primarily for stocks, with daily session and fixed trading hours. Whilst the script will run on all instruments, it is presently not adapted for markets such as Future or Forex that trade continuously across the Asian, London and NY sessions. Such configurations require additional optimization and maybe considered in the future.
5. Default Settings
Opening Period: 15 minutes (30 / 60 minute optional)
Session Minutes: 540
Volume SMA Length: 180
日本語概要 (Japanese Summary)
Gimmigela(セッション・ベクトル)は、1日の取引セッションを「寄り付き区間」と「その後の取引時間」の2つに分割し、価格変動と出来高をベクトルとして組み合わせて分析する、日足チャート専用のテクニカル指標です。- 仕事量(Work Done ): 寄り付き区間とその後の値動きが同じ方向であれば「質量」が加算され、逆方向であれば相殺されます。物理学の「仕事(Work Done)」の概念を用いて、その日の市場の純粋な推進力(ネットの前進)を可視化します。
- コサイン類似度(Cosine Similarity): 2つのセッションをそれぞれ独立したベクトルとして捉え、方向性や価格・出来高の構造がどれだけ一致しているかを測定します。
中文概要(Chinese Summary)
Gimmigela (區段向量震盪指標) 將每個交易日拆分為「開盤區段」與「收盤時段」兩個階段,並將價格變動與成交量以向量方式結合分析,是專為日線圖設計的技術指標。- 作功向量(Work Done): 當開盤區段與收盤時段的方向一致時,兩者的「質量」相加;方向相反時則相互抵消,以物理學中「作功」的概念,呈現當日市場的淨推動力。
- 餘弦相似度(Cosine Similarity): 將開盤與收盤時段各自視為一個獨立向量,用以衡量兩者在方向與價量結構上的一致程度。
Disclaimer:
This script is a research tool for market structure analysis and educational purposes only. It does not constitute financial advice. Trading involves risk.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.