PROTECTED SOURCE SCRIPT

Live Repainting Swing Strategy (Trendlines + EMA)

58
🔍 How It Works
Swing High/Low Detection (Repainting):
Detects unconfirmed, live swing highs and lows using a user-defined lookback length. These pivots repaint, updating as the chart evolves — just like a discretionary trader would.

Buy Entry:

New swing low appears

No recent signal in the last X bars (cooldown)

Entry is placed at the swing low

Sell Entry:

New swing high appears

Cooldown condition met

Entry is placed at the swing high

Exit Logic:

Configurable Take Profit and Stop Loss percentages

A marker is plotted when TP is hit (green for longs, orange for shorts)

✳️ Visual Elements
Marker Meaning
🔺 Green Buy signal at swing low
đź”» Red Sell signal at swing high
🟢 Lime Circle TP hit on a long
đźź  Orange Circle TP hit on a short
đź”¶ EMA Line Trend context (default: 50 EMA)
📏 Trendlines Repainting lines from last swing high/low to current price

⚙️ Configurable Inputs
Swing Length: Sensitivity of pivot detection

Cooldown: Min bars between signals to prevent overtrading

SL % and TP %: Risk-reward settings

EMA Length: Dynamic trend filter overlay

🚦 Designed For
5-minute to 1-hour charts

Price action traders

Real-time analysis and visual confirmation

Use with alerts or manual scalping

Declinazione di responsabilitĂ 

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.