OPEN-SOURCE SCRIPT
AlphaStrike: Volatility & Pinbar Reversion System

Description:
The Concept: Solving the "Context" Problem One of the hardest challenges in trading is identifying whether the market is in a "Trend State" or a "Mean Reversion State." Using trend indicators in a range leads to false breakouts, while using reversal indicators in a strong trend leads to catching falling knives.
This script solves this issue by combining an ATR-based Trend Filter with a conditional Price Action Reversion engine. It does not simply overlay two indicators; it uses a filtering logic to ensure that Reversal signals are only generated when Momentum, Volatility, and Candle Geometry all align at the same time.
How It Works (The Logic) This script functions as a "Hybrid" system with two distinct engines running simultaneously:
1. The Trend Engine (Bias Filter) We use an ATR-based SuperTrend calculation to determine the dominant market direction.
*Purpose: This acts as a "No Trade Zone" filter.
*Logic: If the Trend Line is Green, the statistical bias is bullish. If Red, the bias is bearish. This helps traders avoid shorting strong uptrends or buying weak downtrends.
2. The Reversal Engine (Signal Generator) This is where the script differentiates itself from standard "Bollinger + RSI" mashups. A signal is NOT generated just because price hits a band. The script requires a specific "Pinbar" candle pattern to validate the move.
The "Blue Dot" (Bullish Reversal) Logic:
*Condition A: Price must be below the Lower Bollinger Band (2 Standard Deviations).
*Condition B: RSI (14) must be Oversold (< 35).
*Condition C (The Filter): The candle must form a Bullish Pinbar. The script calculates the ratio of the lower wick to the body. If the wick is 2x longer than the body, it confirms that buyers actively rejected the lower prices.
The "Orange Dot" (Bearish Reversal) Logic:
*Condition A: Price must be above the Upper Bollinger Band.
*Condition B: RSI (14) must be Overbought (> 65).
*Condition C (The Filter): The candle must form a Bearish Pinbar (long upper wick), indicating buyer exhaustion.
Visual Guide & Usage
*Green/Red Line: Use this to trail your Stop Loss or determine trend direction.
*Triangles (Breakouts): These marks indicate a shift in volatility where the trend officially flips.
*Dots (Reversals): These are high-probability zones for scalps or entering on pullbacks.
Built-In Risk Management To assist with position sizing, a "Smart Risk" table is included in the bottom right corner.
*It automatically detects the nearest market structure (Swing Highs/Lows).
*It calculates the distance from the current price to that structure.
*It displays the suggested position size to maintain a fixed risk percentage (configurable in Settings).
*Note: You must input your Account Balance in the settings for this to work.
Settings
*Crypto: Default settings (Factor 3.5) are optimized for high-volatility assets like BTC/ETH to reduce noise.
*TradFi: For Forex or Stocks, consider lowering the Factor to 3.0.
Disclaimer This tool is designed for educational analysis and risk management assistance. It does not constitute financial advice. Past performance of signals (like those shown on the chart) does not guarantee future results. Always manage your risk.
The Concept: Solving the "Context" Problem One of the hardest challenges in trading is identifying whether the market is in a "Trend State" or a "Mean Reversion State." Using trend indicators in a range leads to false breakouts, while using reversal indicators in a strong trend leads to catching falling knives.
This script solves this issue by combining an ATR-based Trend Filter with a conditional Price Action Reversion engine. It does not simply overlay two indicators; it uses a filtering logic to ensure that Reversal signals are only generated when Momentum, Volatility, and Candle Geometry all align at the same time.
How It Works (The Logic) This script functions as a "Hybrid" system with two distinct engines running simultaneously:
1. The Trend Engine (Bias Filter) We use an ATR-based SuperTrend calculation to determine the dominant market direction.
*Purpose: This acts as a "No Trade Zone" filter.
*Logic: If the Trend Line is Green, the statistical bias is bullish. If Red, the bias is bearish. This helps traders avoid shorting strong uptrends or buying weak downtrends.
2. The Reversal Engine (Signal Generator) This is where the script differentiates itself from standard "Bollinger + RSI" mashups. A signal is NOT generated just because price hits a band. The script requires a specific "Pinbar" candle pattern to validate the move.
The "Blue Dot" (Bullish Reversal) Logic:
*Condition A: Price must be below the Lower Bollinger Band (2 Standard Deviations).
*Condition B: RSI (14) must be Oversold (< 35).
*Condition C (The Filter): The candle must form a Bullish Pinbar. The script calculates the ratio of the lower wick to the body. If the wick is 2x longer than the body, it confirms that buyers actively rejected the lower prices.
The "Orange Dot" (Bearish Reversal) Logic:
*Condition A: Price must be above the Upper Bollinger Band.
*Condition B: RSI (14) must be Overbought (> 65).
*Condition C (The Filter): The candle must form a Bearish Pinbar (long upper wick), indicating buyer exhaustion.
Visual Guide & Usage
*Green/Red Line: Use this to trail your Stop Loss or determine trend direction.
*Triangles (Breakouts): These marks indicate a shift in volatility where the trend officially flips.
*Dots (Reversals): These are high-probability zones for scalps or entering on pullbacks.
Built-In Risk Management To assist with position sizing, a "Smart Risk" table is included in the bottom right corner.
*It automatically detects the nearest market structure (Swing Highs/Lows).
*It calculates the distance from the current price to that structure.
*It displays the suggested position size to maintain a fixed risk percentage (configurable in Settings).
*Note: You must input your Account Balance in the settings for this to work.
Settings
*Crypto: Default settings (Factor 3.5) are optimized for high-volatility assets like BTC/ETH to reduce noise.
*TradFi: For Forex or Stocks, consider lowering the Factor to 3.0.
Disclaimer This tool is designed for educational analysis and risk management assistance. It does not constitute financial advice. Past performance of signals (like those shown on the chart) does not guarantee future results. Always manage your risk.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.