OPEN-SOURCE SCRIPT
Aktualisiert Premium/Discount Retracement Indicator

The indicator works in four layers.
**The major swing** — it scans the chart for a significant impulse move using a pivot-based lookback. Once it finds a clear swing low and swing high (or high then low), it locks that range in and draws a horizontal 50% line across the middle. Everything above that line is premium, everything below is discount.
**The retracement zone** — after the major move, it watches for a smaller pullback forming within the range. When that pullback produces its own local high and local low, those two levels become the zone boundaries. The zone is drawn as a two-colour box: teal on top, red on the bottom, split at the midpoint. Only zones sitting in the discount area qualify for buys, and only zones in the premium area qualify for sells, so it automatically filters out setups that go against the structure.
**The entry** — a limit order line sits at the exact midpoint of the zone. Nothing happens until price returns to that level. If price dips into the zone but reverses before touching the midpoint and then closes back above the zone boundary, the zone is marked as rejected and the limit is cancelled automatically. This handles the scenario where price taps the upper portion of the zone but doesn't commit.
**Trade levels** — once the limit is hit, three levels are displayed. The stop loss is placed just beyond the outer zone boundary with a small buffer. The take profit is calculated at 1:2 risk-to-reward from the entry. A break-even line sits at the 1:1 level, and an alert fires when price reaches it so you know when to move your stop to entry.
There are also four alerts: zone created, order filled, zone cancelled, and move to break even.
**The major swing** — it scans the chart for a significant impulse move using a pivot-based lookback. Once it finds a clear swing low and swing high (or high then low), it locks that range in and draws a horizontal 50% line across the middle. Everything above that line is premium, everything below is discount.
**The retracement zone** — after the major move, it watches for a smaller pullback forming within the range. When that pullback produces its own local high and local low, those two levels become the zone boundaries. The zone is drawn as a two-colour box: teal on top, red on the bottom, split at the midpoint. Only zones sitting in the discount area qualify for buys, and only zones in the premium area qualify for sells, so it automatically filters out setups that go against the structure.
**The entry** — a limit order line sits at the exact midpoint of the zone. Nothing happens until price returns to that level. If price dips into the zone but reverses before touching the midpoint and then closes back above the zone boundary, the zone is marked as rejected and the limit is cancelled automatically. This handles the scenario where price taps the upper portion of the zone but doesn't commit.
**Trade levels** — once the limit is hit, three levels are displayed. The stop loss is placed just beyond the outer zone boundary with a small buffer. The take profit is calculated at 1:2 risk-to-reward from the entry. A break-even line sits at the 1:1 level, and an alert fires when price reaches it so you know when to move your stop to entry.
There are also four alerts: zone created, order filled, zone cancelled, and move to break even.
Versionshinweise
updated bugsVersionshinweise
fixedVersionshinweise
updateVersionshinweise
updatedOpen-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.