OPEN-SOURCE SCRIPT
Telah dikemas kini Session Markers - JDK Analysis

Session Markers is a tool designed to study how markets behave during specific, recurring time windows. Many traders know that price behaves differently depending on the day of the week, the time of the day, or particular market sessions such as the weekly open, the London session, or the New York open. This indicator makes those recurring windows visible on the chart and then analyzes what price typically does inside them. The result is a clear statistical understanding of how a chosen session behaves, both in direction and in strength.
The script works by allowing the trader to define any time window using a start day and time and an end day and time. Every time this window occurs on the chart, the indicator highlights it with a full-height vertical band. These visual markers reveal patterns that are otherwise difficult to detect manually, such as whether certain sessions tend to trend, reverse, consolidate, or create large imbalances. They also help the trader quickly scan through historical price action to see how the market has behaved under similar conditions.
For every completed session window, the indicator measures how much price changed from the moment the window began to the moment it ended. Instead of using raw price differences, it converts these changes into percentage moves. This makes the measurement consistent across different price ranges and market regimes. A one-percent move always has the same meaning, whether the asset is trading at 100 or 50,000. These percentage moves are collected for a user-selected number of past sessions, creating a dataset of how the market has behaved in the chosen time window.
Based on this dataset, the indicator generates several statistics. It counts how many past sessions closed higher and how many closed lower, producing a directional tendency. It also computes the probability of an upward session by dividing the number of positive sessions by the total. More importantly, it calculates the average percentage movement for all sessions in the lookback period. This average move reflects not just the direction but also the magnitude of price changes. A session with frequent small upward moves but occasional large downward moves will show a negative average movement, even if more sessions ended positive. This creates a more realistic representation of true market behavior.
Using this average movement, the script determines a “Bias” for the session. If the average percentage move is positive, the bias is considered bullish. If it is negative, the bias is bearish. If the values are very close to zero, the bias is neutral. This way, the indicator takes both frequency and impact into account, producing a magnitude-aware assessment instead of one that only counts wins and losses. A sequence such as +5%, –1% results in a bullish bias because the overall impact is strongly positive. On the other hand, a series of small gains followed by a large drop produces a bearish bias even if more sessions ended positive, because the large move dominates the average. This provides a far more truthful picture of what the market tends to do during the chosen window.
All relevant statistics are displayed neatly in a small panel in the top-right corner of the chart. The panel updates in real time as new sessions complete and older ones fall out of the lookback range. It shows how many sessions were analyzed, how many ended up or down, the probability of an upward move, the average percentage change, and the final bias. The background color of the panel instantly reflects that bias, making it easy to interpret at a glance.
To use the tool effectively, the trader simply needs to define a time window of interest. This could be something like the weekly opening window from Sunday to Monday, the London open each day, or even a unique custom window. After selecting how many past sessions to analyze, the indicator takes care of the rest. The vertical session markers reveal the structure visually. The statistics summarize the historical behavior objectively. The magnitude-weighted bias provides a realistic indication of whether the window tends to produce upward or downward movement on average.
Session Markers is helpful because it translates repeated market timing behavior into measurable data. It exposes hidden tendencies that are easy to feel intuitively but hard to quantify manually. By analyzing both direction and magnitude, it prevents misleading interpretations that can arise from looking only at win rates. It helps traders understand whether a session typically produces meaningful moves or just small noise, whether it tends to trend or reverse, and whether its behavior has recently changed. Whether used for bias building, session filtering, or deeper market research, it offers a structured framework for understanding the market through time-based patterns.
The script works by allowing the trader to define any time window using a start day and time and an end day and time. Every time this window occurs on the chart, the indicator highlights it with a full-height vertical band. These visual markers reveal patterns that are otherwise difficult to detect manually, such as whether certain sessions tend to trend, reverse, consolidate, or create large imbalances. They also help the trader quickly scan through historical price action to see how the market has behaved under similar conditions.
For every completed session window, the indicator measures how much price changed from the moment the window began to the moment it ended. Instead of using raw price differences, it converts these changes into percentage moves. This makes the measurement consistent across different price ranges and market regimes. A one-percent move always has the same meaning, whether the asset is trading at 100 or 50,000. These percentage moves are collected for a user-selected number of past sessions, creating a dataset of how the market has behaved in the chosen time window.
Based on this dataset, the indicator generates several statistics. It counts how many past sessions closed higher and how many closed lower, producing a directional tendency. It also computes the probability of an upward session by dividing the number of positive sessions by the total. More importantly, it calculates the average percentage movement for all sessions in the lookback period. This average move reflects not just the direction but also the magnitude of price changes. A session with frequent small upward moves but occasional large downward moves will show a negative average movement, even if more sessions ended positive. This creates a more realistic representation of true market behavior.
Using this average movement, the script determines a “Bias” for the session. If the average percentage move is positive, the bias is considered bullish. If it is negative, the bias is bearish. If the values are very close to zero, the bias is neutral. This way, the indicator takes both frequency and impact into account, producing a magnitude-aware assessment instead of one that only counts wins and losses. A sequence such as +5%, –1% results in a bullish bias because the overall impact is strongly positive. On the other hand, a series of small gains followed by a large drop produces a bearish bias even if more sessions ended positive, because the large move dominates the average. This provides a far more truthful picture of what the market tends to do during the chosen window.
All relevant statistics are displayed neatly in a small panel in the top-right corner of the chart. The panel updates in real time as new sessions complete and older ones fall out of the lookback range. It shows how many sessions were analyzed, how many ended up or down, the probability of an upward move, the average percentage change, and the final bias. The background color of the panel instantly reflects that bias, making it easy to interpret at a glance.
To use the tool effectively, the trader simply needs to define a time window of interest. This could be something like the weekly opening window from Sunday to Monday, the London open each day, or even a unique custom window. After selecting how many past sessions to analyze, the indicator takes care of the rest. The vertical session markers reveal the structure visually. The statistics summarize the historical behavior objectively. The magnitude-weighted bias provides a realistic indication of whether the window tends to produce upward or downward movement on average.
Session Markers is helpful because it translates repeated market timing behavior into measurable data. It exposes hidden tendencies that are easy to feel intuitively but hard to quantify manually. By analyzing both direction and magnitude, it prevents misleading interpretations that can arise from looking only at win rates. It helps traders understand whether a session typically produces meaningful moves or just small noise, whether it tends to trend or reverse, and whether its behavior has recently changed. Whether used for bias building, session filtering, or deeper market research, it offers a structured framework for understanding the market through time-based patterns.
Nota Keluaran
Updated Version: The upcoming session is now highlighted as well. Its color reflects the current bias, which is calculated from the last N historical sessions, so you can see at a glance whether the next session is statistically more likely to be bullish, bearish, or neutral.Nota Keluaran
Fixed visuals.Nota Keluaran
Fixed calculations for next session bias.Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.