OPEN-SOURCE SCRIPT
Bias & Sweep Dashboard

1. Inputs & Configuration
Timeframes: Allows you to set the Higher Time Frame (HTF) (default: Daily / D) and the Intermediate/Lower Time Frame (ITF) (default: 4H / 240).
Sweep Settings: Features a customizable Swing Lookback input (default: 10 bars) to determine the structural swing points.
Table Settings: Allows configuration of the visual dashboard placement on the screen (Top Right, Bottom Left, etc.) along with background and text color styling.
2. Detection Logic
Pivots & Liquidity Sweeps:
Finds swing highs and swing lows using ta.pivothigh() and ta.pivotlow().
A Sweep is triggered when a candle's wick breaks past a key swing high/low, but the candle close returns back inside (denoting rejection of liquidity).
Uses request.security() to evaluate these sweeps on your defined HTF and ITF timeframes.
Inversions:
Tracks Fair Value Gaps (FVGs).
An Inversion is triggered when the price closes completely through a recent opposing FVG (e.g. closing above a Bearish FVG, or closing below a Bullish FVG).
Trend Bias:
Calculates trend direction using a standard EMA crossover (50 EMA vs 200 EMA) to decide if the baseline market environment is Bullish, Bearish, or Neutral.
3. Visual Dashboard (Table UI)
At the final bar (barstate.islast), the script builds a 2x4 table panel displaying:
Bias: Displayed as "Bullish" (green), "Bearish" (red), or "Neutral" (gray).
HTF Sweep: Shows ✅ if an HTF sweep is active, else ❌.
ITF Sweep: Shows ✅ if an ITF sweep is active, else ❌.
Inversion: Shows ✅ if an FVG Inversion has occurred, else ❌.
Timeframes: Allows you to set the Higher Time Frame (HTF) (default: Daily / D) and the Intermediate/Lower Time Frame (ITF) (default: 4H / 240).
Sweep Settings: Features a customizable Swing Lookback input (default: 10 bars) to determine the structural swing points.
Table Settings: Allows configuration of the visual dashboard placement on the screen (Top Right, Bottom Left, etc.) along with background and text color styling.
2. Detection Logic
Pivots & Liquidity Sweeps:
Finds swing highs and swing lows using ta.pivothigh() and ta.pivotlow().
A Sweep is triggered when a candle's wick breaks past a key swing high/low, but the candle close returns back inside (denoting rejection of liquidity).
Uses request.security() to evaluate these sweeps on your defined HTF and ITF timeframes.
Inversions:
Tracks Fair Value Gaps (FVGs).
An Inversion is triggered when the price closes completely through a recent opposing FVG (e.g. closing above a Bearish FVG, or closing below a Bullish FVG).
Trend Bias:
Calculates trend direction using a standard EMA crossover (50 EMA vs 200 EMA) to decide if the baseline market environment is Bullish, Bearish, or Neutral.
3. Visual Dashboard (Table UI)
At the final bar (barstate.islast), the script builds a 2x4 table panel displaying:
Bias: Displayed as "Bullish" (green), "Bearish" (red), or "Neutral" (gray).
HTF Sweep: Shows ✅ if an HTF sweep is active, else ❌.
ITF Sweep: Shows ✅ if an ITF sweep is active, else ❌.
Inversion: Shows ✅ if an FVG Inversion has occurred, else ❌.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。