OPEN-SOURCE SCRIPT
Session Streaks [LuxAlgo]

The Session Streaks tool allows traders to identify whether a session is bullish or bearish on the chart. It also shows the current session streak, or the number of consecutive bullish or bearish sessions.
The tool features a dashboard with information about the session streaks of the underlying product on the chart.
🔶 USAGE

Analyzing session streaks is commonly used for market timing by studying the number of consecutive sessions over time and how long they last before the market changes direction.
We identify a bullish session as one in which the closing price is equal to or greater than the opening price, and a bearish session as one in which the closing price is below the opening price.
Each session is labeled according to its bias (bullish or bearish) and the number of consecutive sessions of the same type that conform the current streak.
🔹 Dashboard

The dashboard at the top shows information about the current session.
Under the "Streaks" header, historical information about session streaks is displayed, divided into bullish and bearish categories.
As the image shows, for this particular market, there are more bullish streaks than bearish ones. Bullish streaks have an average duration that is longer than that of bearish streaks, and both have the same most common streak duration.
If the current session is bullish and the median streak duration for bullish sessions is three, then we could consider scenarios in which the next two sessions are bullish.
🔶 DETAILS
🔹 Streaks On Larger Timeframes

On timeframes lower than or equal to Daily, the tool identifies each consecutive session, but this behavior changes on larger timeframes.
On timeframes larger than daily, the tool identifies the last session of each bar. Let's use the chart in the image as a reference.
At the top of the image, there is a daily chart where each session corresponds to each candle. One candle equals one day.
In the middle, we have a weekly chart where each session is the last session of each week, which is usually Friday for the Nasdaq 100 futures contract. The levels and labels displayed correspond to the last session within each candle, which is the last day of each week.
The levels and labels on the monthly chart correspond to the last session of each month, which is the last day of each month.
🔹 Gradient Style

Traders can choose between two different color gradients for the session background. Each gradient provides different information about price behavior within each session.
🔶 SETTINGS
🔹 Dashboard
🔹 Style
The tool features a dashboard with information about the session streaks of the underlying product on the chart.
🔶 USAGE
Analyzing session streaks is commonly used for market timing by studying the number of consecutive sessions over time and how long they last before the market changes direction.
We identify a bullish session as one in which the closing price is equal to or greater than the opening price, and a bearish session as one in which the closing price is below the opening price.
Each session is labeled according to its bias (bullish or bearish) and the number of consecutive sessions of the same type that conform the current streak.
🔹 Dashboard
The dashboard at the top shows information about the current session.
Under the "Streaks" header, historical information about session streaks is displayed, divided into bullish and bearish categories.
- Number: Total number of streaks.
- Median: The average duration of those streaks. We chose the median over the mean to avoid misrepresentation due to outliers.
- Mode: The most common streak duration.
As the image shows, for this particular market, there are more bullish streaks than bearish ones. Bullish streaks have an average duration that is longer than that of bearish streaks, and both have the same most common streak duration.
If the current session is bullish and the median streak duration for bullish sessions is three, then we could consider scenarios in which the next two sessions are bullish.
🔶 DETAILS
🔹 Streaks On Larger Timeframes
On timeframes lower than or equal to Daily, the tool identifies each consecutive session, but this behavior changes on larger timeframes.
On timeframes larger than daily, the tool identifies the last session of each bar. Let's use the chart in the image as a reference.
At the top of the image, there is a daily chart where each session corresponds to each candle. One candle equals one day.
In the middle, we have a weekly chart where each session is the last session of each week, which is usually Friday for the Nasdaq 100 futures contract. The levels and labels displayed correspond to the last session within each candle, which is the last day of each week.
The levels and labels on the monthly chart correspond to the last session of each month, which is the last day of each month.
🔹 Gradient Style
Traders can choose between two different color gradients for the session background. Each gradient provides different information about price behavior within each session.
-  Horizontal: Green indicates prices at the top of the session range and red indicates prices at the bottom.
-  Vertical: Green indicates prices that are equal to or greater than the open price and red indicates prices that are below the open price of the session.
🔶 SETTINGS
🔹 Dashboard
-  Dashboard: Enable or disable the dashboard.
-  Position: Select the location of the dashboard.
-  Size: Select the dashboard size.
🔹 Style
-  Bullish: Select a color for bullish sessions.
-  Bearish: Select a color for bearish sessions.
-  Transparency: Select a transparency level from 100 to 0.
-  Gradient: Select a horizontal or vertical gradient.
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
Get exclusive indicators & AI trading strategies: luxalgo.com
Free 150k+ community: discord.gg/lux
All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
Free 150k+ community: discord.gg/lux
All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
Get exclusive indicators & AI trading strategies: luxalgo.com
Free 150k+ community: discord.gg/lux
All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
Free 150k+ community: discord.gg/lux
All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
