OPEN-SOURCE SCRIPT
Leviatan CVD - Aggression and Divergence

Technical Description and Methodology:
The Leviatã CVD (Cumulative Volume Delta) is an institutional-grade tool designed to track market aggression (Market Orders) by estimating the delta within each price bar. Since standard data feeds often lack tick-by-tick delta, this script uses an Intrabar Pressure Proxy based on the following mathematical logic:
1. Delta Calculation: It calculates the relative position of the Close within the High-Low range to estimate the balance of power.
Formula: ((Close - Low) - (High - Close)) / (High - Low) * Volume
2. Cumulative Accumulation: The delta is accumulated throughout the session. The user can choose to reset the values at the start of each daily session (ta.change(time("D"))).
3. Signal Line: A 21-period Simple Moving Average (SMA) is applied to the CVD to identify momentum shifts.
4. Divergence Engine: The script automatically detects "Hidden Whales" by finding divergences between Price and CVD:
*. Bullish Div: Price makes a lower low while CVD makes a higher low (Aggressive Buying).
*. Bearish Div: Price makes a higher high while CVD makes a lower high (Aggressive Selling).
How to use:
*. Green Columns: Buying Aggression.
*. Red Columns: Selling Aggression.
*. Optimized for Pine Script v6.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
🔱 LeviatanSignals® — automação de fluxo institucional (SMC) para Binance e MEXC Futures. Vídeos, app e mais: leviatansignals.com.br/
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
🔱 LeviatanSignals® — automação de fluxo institucional (SMC) para Binance e MEXC Futures. Vídeos, app e mais: leviatansignals.com.br/
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.