OPEN-SOURCE SCRIPT
Lucy โ 3-Bar Reversal with EMA50 Trend Filter

๐ Lucy โ 3-Bar Reversal with EMA50 Trend Filter
Purpose:
To detect and highlight bullish and bearish 3-bar reversal patterns on the chart, but only when they align with the dominant trend, defined by the EMA 50.
โ How It Works
๐ข Bullish 3-Bar Reversal (Buy Setup):
Bar 1 is bearish (close < open)
Bar 2 makes a lower low than Bar 1
Bar 3 is bullish (close > open) and closes above Bar 2โs high
Price must be above EMA 50 (trend filter)
โ Result: Shows a green triangle below the bar
๐ด Bearish 3-Bar Reversal (Sell Setup):
Bar 1 is bullish (close > open)
Bar 2 makes a higher high than Bar 1
Bar 3 is bearish (close < open) and closes below Bar 2โs low
Price must be below EMA 50
โ Result: Shows a red triangle above the bar
๐ What It Plots:
๐ผ Green triangle below bullish signal bar
๐ฝ Red triangle above bearish signal bar
๐ Orange line = EMA50 (trend filter)
๐ Built-in Alerts:
Youโll get an alert if:
A bullish reversal pattern forms above EMA50
A bearish reversal pattern forms below EMA50
๐ง Use Cases:
Great for trend-following traders who want clean, price-action entries
Works well on intraday (15m/1h) or swing (4h/daily) timeframes
Can be used for manual entries, or converted to strategy for automation
Purpose:
To detect and highlight bullish and bearish 3-bar reversal patterns on the chart, but only when they align with the dominant trend, defined by the EMA 50.
โ How It Works
๐ข Bullish 3-Bar Reversal (Buy Setup):
Bar 1 is bearish (close < open)
Bar 2 makes a lower low than Bar 1
Bar 3 is bullish (close > open) and closes above Bar 2โs high
Price must be above EMA 50 (trend filter)
โ Result: Shows a green triangle below the bar
๐ด Bearish 3-Bar Reversal (Sell Setup):
Bar 1 is bullish (close > open)
Bar 2 makes a higher high than Bar 1
Bar 3 is bearish (close < open) and closes below Bar 2โs low
Price must be below EMA 50
โ Result: Shows a red triangle above the bar
๐ What It Plots:
๐ผ Green triangle below bullish signal bar
๐ฝ Red triangle above bearish signal bar
๐ Orange line = EMA50 (trend filter)
๐ Built-in Alerts:
Youโll get an alert if:
A bullish reversal pattern forms above EMA50
A bearish reversal pattern forms below EMA50
๐ง Use Cases:
Great for trend-following traders who want clean, price-action entries
Works well on intraday (15m/1h) or swing (4h/daily) timeframes
Can be used for manual entries, or converted to strategy for automation
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.