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.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。