OPEN-SOURCE SCRIPT

EMA Break & Retest + Trend Table

60
This script is designed to identify potential buy and sell trading opportunities based on 21 EMA (Exponential Moving Average) break and retest patterns, with confirmation from multi-timeframe trend analysis. It combines actionable signal generation with a clean, real-time trend overview table.

✅ 1. EMA Break & Retest Logic
Detects when the price crosses above or below the 21 EMA and then closes in the direction of the breakout.

Generates buy signals on upward break/retest, and sell signals on downward break/retest.

✅ 2. Multi-Timeframe Confirmation
Filters signals using higher timeframe trends to avoid false entries.

Buy signals are shown only if the 1H or 4H trend is bullish.

Sell signals are shown only if the 1H or 4H trend is bearish.

✅ 3. Visual Signal Plotting
Displays green "BUY" labels below bars and red "SELL" labels above bars.

Users can toggle buy/sell signals on or off with checkboxes.

✅ 4. Alerts
Built-in alertcondition() functions allow traders to set real-time alerts when buy or sell signals are triggered.

✅ 5. Multi-Timeframe Trend Table
A dynamic table appears in the top-right corner showing trend status across:

Daily (D)

4 Hour (4H)

1 Hour (1H)

15 Minute (15M)

5 Minute (5M)

Each timeframe is marked as Bullish (green) or Bearish (red) depending on the current price vs. 21 EMA.

The latest signal (“BUY” / “SELL” / “—”) is displayed at the bottom of the table.

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.