OPEN-SOURCE SCRIPT
PrecisionAlgoGuard

PrecisionAlgoGuard is a market condition and trap-related behavior framework that evaluates the current market environment before directional bias is applied. Rather than generating entry or exit signals, the model analyzes structural quality and participation to classify whether conditions are clean, unstable, or cautionary.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW IT WORKS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The model evaluates each bar through a set of structural and participation-based checks, producing a condition score from 0 to 100. Higher scores reflect cleaner, more participation-supported conditions, while lower scores reflect increased noise, instability, or structural inefficiency.
The condition score is derived from a weighted model combining multiple structural and participation-based factors. Thresholds and penalty values are calibrated to reflect relative changes in market behavior rather than fixed universal standards.
The following conditions are evaluated independently and contribute to the score:
• VWAP Pinning — Evaluates when price repeatedly stalls near VWAP with compressed range and body structure, indicating reduced directional conviction.
• Wick Trap / Sweep — Highlights conditions where price briefly exceeds a recent swing high or low but fails to hold, closing back within range with a pronounced wick.
• Failed Breakout — Evaluates when price moves beyond a recent structure level without sufficient participation or range expansion, then fails to maintain that level.
• Absorption — Highlights when elevated volume occurs within a compressed range with a mid-bar close, suggesting supply or demand is being absorbed rather than driving price.
• Churn / Wash — Evaluates periods of elevated cumulative volume over multiple bars that result in limited net price movement.
• Low Volatility Compression — Uses ATR percentile rank to identify when current volatility is within the lower range of recent activity.
• Squeeze Pressure — Highlights sustained directional closes with increasing volume and shallow pullbacks, indicating potential directional pressure building.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CONDITION STATES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Based on the score and active conditions, the model classifies the environment into one of five states:
• Elevated Risk Conditions — Absorption or failed breakout conditions are present, or the score is critically low.
• Caution — One or more warning conditions are active, or the score has declined into a cautionary range.
• Long Bias Active — Conditions are favorable and a majority of directional factors align on the bullish side.
• Short Bias Active — Conditions are favorable and a majority of directional factors align on the bearish side.
• Neutral Conditions — Conditions are favorable, but directional factors are mixed or inconclusive.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Use the condition score and state classification to assess the current market environment before forming a directional view. Elevated Risk and Caution states may reflect unstable or low-quality conditions, while bias states reflect alignment across multiple factors when conditions are more favorable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ADAPTIVE BEHAVIOR TUNING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Internal thresholds automatically adjust based on instrument type and market-cap profile. The same script responds differently on a nano-cap momentum stock, a large-cap equity, an ETF, or a crypto chart without requiring manual retuning.
Supported tiers: Nano Cap, Micro Cap, Small Cap, Mid Cap, Large Cap, ETF, Crypto.
ETF profiles apply tighter structure requirements and higher participation thresholds. Crypto profiles apply wider volatility tolerance and softer sensitivity to structural noise. Auto-detection is enabled by default, with manual override available in settings.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DISPLAY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The overlay label displays the condition score, active state, detection tags, bull/bear factor counts, and detected instrument tier. Label position, font size, candle highlighting, and bar coloring are configurable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ALERTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Alert conditions are available for state transitions and individual condition triggers, including Elevated Risk Conditions, Caution, Absorption, Failed Breakout, Wick Trap, Churn, Squeeze, Long Bias Active, and Short Bias Active.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
IMPORTANT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PrecisionAlgoGuard is designed to provide market context, not trading signals or recommendations. Condition states are descriptive and may update in real time as new bars develop. This script is provided for educational and informational purposes only and does not constitute financial advice. Always perform your own analysis before making trading decisions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW IT WORKS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The model evaluates each bar through a set of structural and participation-based checks, producing a condition score from 0 to 100. Higher scores reflect cleaner, more participation-supported conditions, while lower scores reflect increased noise, instability, or structural inefficiency.
The condition score is derived from a weighted model combining multiple structural and participation-based factors. Thresholds and penalty values are calibrated to reflect relative changes in market behavior rather than fixed universal standards.
The following conditions are evaluated independently and contribute to the score:
• VWAP Pinning — Evaluates when price repeatedly stalls near VWAP with compressed range and body structure, indicating reduced directional conviction.
• Wick Trap / Sweep — Highlights conditions where price briefly exceeds a recent swing high or low but fails to hold, closing back within range with a pronounced wick.
• Failed Breakout — Evaluates when price moves beyond a recent structure level without sufficient participation or range expansion, then fails to maintain that level.
• Absorption — Highlights when elevated volume occurs within a compressed range with a mid-bar close, suggesting supply or demand is being absorbed rather than driving price.
• Churn / Wash — Evaluates periods of elevated cumulative volume over multiple bars that result in limited net price movement.
• Low Volatility Compression — Uses ATR percentile rank to identify when current volatility is within the lower range of recent activity.
• Squeeze Pressure — Highlights sustained directional closes with increasing volume and shallow pullbacks, indicating potential directional pressure building.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CONDITION STATES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Based on the score and active conditions, the model classifies the environment into one of five states:
• Elevated Risk Conditions — Absorption or failed breakout conditions are present, or the score is critically low.
• Caution — One or more warning conditions are active, or the score has declined into a cautionary range.
• Long Bias Active — Conditions are favorable and a majority of directional factors align on the bullish side.
• Short Bias Active — Conditions are favorable and a majority of directional factors align on the bearish side.
• Neutral Conditions — Conditions are favorable, but directional factors are mixed or inconclusive.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Use the condition score and state classification to assess the current market environment before forming a directional view. Elevated Risk and Caution states may reflect unstable or low-quality conditions, while bias states reflect alignment across multiple factors when conditions are more favorable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ADAPTIVE BEHAVIOR TUNING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Internal thresholds automatically adjust based on instrument type and market-cap profile. The same script responds differently on a nano-cap momentum stock, a large-cap equity, an ETF, or a crypto chart without requiring manual retuning.
Supported tiers: Nano Cap, Micro Cap, Small Cap, Mid Cap, Large Cap, ETF, Crypto.
ETF profiles apply tighter structure requirements and higher participation thresholds. Crypto profiles apply wider volatility tolerance and softer sensitivity to structural noise. Auto-detection is enabled by default, with manual override available in settings.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DISPLAY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The overlay label displays the condition score, active state, detection tags, bull/bear factor counts, and detected instrument tier. Label position, font size, candle highlighting, and bar coloring are configurable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ALERTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Alert conditions are available for state transitions and individual condition triggers, including Elevated Risk Conditions, Caution, Absorption, Failed Breakout, Wick Trap, Churn, Squeeze, Long Bias Active, and Short Bias Active.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
IMPORTANT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PrecisionAlgoGuard is designed to provide market context, not trading signals or recommendations. Condition states are descriptive and may update in real time as new bars develop. This script is provided for educational and informational purposes only and does not constitute financial advice. Always perform your own analysis before making trading decisions.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
@MohaveTrader
Context First — Signals Second
Precision Trading Tools
Structure • Flow • Momentum
Context First — Signals Second
Precision Trading Tools
Structure • Flow • Momentum
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
@MohaveTrader
Context First — Signals Second
Precision Trading Tools
Structure • Flow • Momentum
Context First — Signals Second
Precision Trading Tools
Structure • Flow • Momentum
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。