OPEN-SOURCE SCRIPT
Price Action Edge Finder [PUCHON]

📊 Price Action Edge Finder [PUCHON]
The Price Action Edge Finder is a powerful quantitative tool designed to turn standard candlestick patterns into actionable statistical data. Instead of just showing where a pattern occurs, this indicator calculates the **probability of success** and **expected return** over a specific lookahead period, giving traders a statistical edge.
✨ Key Features:
- 🕯️ Comprehensive Pattern Detection: Detects 15+ classic candlestick patterns including:
- Reversal: Engulfing, Morning/Evening Star, Harami, Piercing/Dark Cloud, Tweezers, Doji Stars, Three Inside Up/Down.
- Momentum: Three White Soldiers / Three Black Crows.
- 📊 Statistical Dashboard: A real-time table displaying:
- Count: Total occurrences of each pattern.
- Prob Up/Down %: Historical probability of price moving up or down after 'n' bars.
- Avg Return %: Average percentage return for winning moves.
- 📉 Trend Filter: Optional Moving Average (SMA/EMA) filter to trade with the trend.
- Bullish patterns are only valid above the MA.
- Bearish patterns are only valid below the MA.
- Visuals: Dynamic MA color (Green/Red) and background fill to clearly show trend direction.
- ⚙️ Fully Customizable: Enable/Disable specific patterns, adjust lookahead period, change table position, and more.
🧮 How It Works:
The indicator uses a "lookback" method to calculate performance without repainting.
1. Detection: Identifies if a pattern occurred on the current bar.
2. Lookahead: Checks the price action `n` bars later (user-defined).
3. Statistics: Updates the global stats (Count, Win Rate, Avg Return) based on the outcome.
Pine Script®
💡 Usage Tips:
- Use the Trend Filter to filter out low-probability counter-trend signals.
- Adjust the Lookahead Bars (n) to match your trading style (e.g., lower 'n' for scalping, higher 'n' for swing trading).
- Focus on patterns with high Prob % and Avg Return in the dashboard.
⚠️ Disclaimer:
Past performance is not indicative of future results. This tool provides historical statistics to aid decision-making but does not guarantee future profits. Always manage your risk.
The Price Action Edge Finder is a powerful quantitative tool designed to turn standard candlestick patterns into actionable statistical data. Instead of just showing where a pattern occurs, this indicator calculates the **probability of success** and **expected return** over a specific lookahead period, giving traders a statistical edge.
✨ Key Features:
- 🕯️ Comprehensive Pattern Detection: Detects 15+ classic candlestick patterns including:
- Reversal: Engulfing, Morning/Evening Star, Harami, Piercing/Dark Cloud, Tweezers, Doji Stars, Three Inside Up/Down.
- Momentum: Three White Soldiers / Three Black Crows.
- 📊 Statistical Dashboard: A real-time table displaying:
- Count: Total occurrences of each pattern.
- Prob Up/Down %: Historical probability of price moving up or down after 'n' bars.
- Avg Return %: Average percentage return for winning moves.
- 📉 Trend Filter: Optional Moving Average (SMA/EMA) filter to trade with the trend.
- Bullish patterns are only valid above the MA.
- Bearish patterns are only valid below the MA.
- Visuals: Dynamic MA color (Green/Red) and background fill to clearly show trend direction.
- ⚙️ Fully Customizable: Enable/Disable specific patterns, adjust lookahead period, change table position, and more.
🧮 How It Works:
The indicator uses a "lookback" method to calculate performance without repainting.
1. Detection: Identifies if a pattern occurred on the current bar.
2. Lookahead: Checks the price action `n` bars later (user-defined).
3. Statistics: Updates the global stats (Count, Win Rate, Avg Return) based on the outcome.
// Example: Updating stats for a Bullish Engulfing pattern
if show_bull_engulf and bull_engulf_detected[lookahead_n]
entry_price = close[lookahead_n]
exit_price = close
// Calculate % change and update probability stats
update_stats(stats_bull_engulf, entry_price, exit_price)
💡 Usage Tips:
- Use the Trend Filter to filter out low-probability counter-trend signals.
- Adjust the Lookahead Bars (n) to match your trading style (e.g., lower 'n' for scalping, higher 'n' for swing trading).
- Focus on patterns with high Prob % and Avg Return in the dashboard.
⚠️ Disclaimer:
Past performance is not indicative of future results. This tool provides historical statistics to aid decision-making but does not guarantee future profits. Always manage your risk.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.