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.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.