OPEN-SOURCE SCRIPT
1M XAU Cumulative Delta Volume with OB Breakouts

### Overview
This is a **session-based CVD strategy** built around the **00:00–07:00 CEST range**. It finds the high/low of that session, turns them into **adaptive ATR-based support (yellow)** and **resistance (purple)** zones, and trades only **CVD-confirmed reversals** off those levels.
---
### How it Works
* For each day, the script:
* Builds a 00:00–07:00 CEST **profile high/low**.
* Creates a **support zone** around the session low and a **resistance zone** around the session high.
* Using lower timeframe data, it reconstructs **Cumulative Volume Delta (CVD)** and a **recent delta** filter.
* It arms “pending” states when price **enters a zone from the correct side**, then confirms:
* **BUY (long):** price reclaims above support and recent CVD is strongly positive.
* **SELL (short):** price rejects below resistance and recent CVD is strongly negative.
Only these two CVD signals (`buySignal` / `sellSignal`) open trades.
---
### Strategy Logic
* **Entries**
* `buySignal` → open **long** (if flat).
* `sellSignal` → open **short** (if flat).
* No pyramiding; one position at a time.
* **Exits (only TP & SL)**
* Long: TP at `avg_price * (0.5 + TP%)`, SL at `avg_price * (1 – SL%)`.
* Short: TP at `avg_price * (0.5 – TP%)`, SL at `avg_price * (1 + SL%)`.
* No opposite-signal exits.
---
### Extras
* **Reversal markers** on yellow/purple zones and **breakout/retest markers** are plotted for context and alerts but **do not trigger entries**.
* Zone width and “thickening” are ATR-based so important touches and near-touches are easy to see.
* Only suited for **1m intraday scalping** (e.g. XAU/USD), but can be tested on other markets/timeframes.
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.
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.