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. اقرأ المزيد في شروط الاستخدام.