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.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.