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提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
