OPEN-SOURCE SCRIPT
DERYA Dynamic Efficiency Regime Yield Analyzer

DERYA: Dynamic Efficiency Regime Yield Analyzer
Mathematical Concept and Problem Statement
Most traditional trend and momentum indicators (e.g., RSI, ADX, MACD) focus on price displacement across a series of bars. However, they are mathematically "blind" to the internal structure of each individual bar. The DERYA indicator solves the "Velocity Trap" and "Lagging Confirmation" issues by shifting the measurement space from price displacement to intrabar efficiency. It quantifies the ratio between net price progress and the total effort (range) expended within the bar.
Logic and Components
The script does not reuse any existing open-source library logic; the methodology is derived from original research. However, it utilizes standard built-in Pine Script functions for structural stabilization:
Efficiency Metaphor: The core logic calculates a proxy for microstructural health using the formula |Close - Close[1]| / (High - Low).
Use of Exponential Moving Average (EMA): A standard ta.ema is applied to the raw efficiency data. Reason for use: Raw microstructural data is inherently noisy due to high-frequency fluctuations. The EMA is used here specifically as a low-pass filter to extract the underlying structural trend of efficiency without the overhead of more complex digital filters.
Use of Min-Max Normalization: The script utilizes ta.highest and ta.lowest over a lookback period. Reason for use: To convert an absolute efficiency metric into a bounded state variable (0-100). This ensures the indicator is adaptive to different volatility regimes, preventing the signal from becoming obsolete as market conditions change.
Interpretation
Expansion Regime (>60): Indicates a high-efficiency environment where price movement is achieved with minimal internal friction.
Collapse Regime (<40): Indicates a structural deterioration where price effort (range) significantly outweighs price progress (displacement), often signaling an imminent trend break.
Visual Integration: The script includes a barcolor feature that highlights bars where DERYA falls below 30, visually flagging points of extreme structural inefficiency directly on the price chart.
Compliance Note
This script is an original implementation of the DERYA methodology. It does not contain "copy-pasted" code from other public indicators. Standard functions (ta.ema, ta.highest, ta.lowest) are used only for their intended mathematical smoothing and normalization purposes as described above.
Scientific Documentation & Research Paper
This implementation is based on the following published research:
Title: DERYA: Dynamic Efficiency Regime Yield Analyzer - A New Microstructural State Variable for Financial Markets
Published on: Zenodo (CERN)
zenodo.org/records/18181902
DOI: 10.5281/zenodo.18181902
Author: Bülent Duman (Independent Researcher)
Copyright: (C) 2026 Bülent Duman
Mathematical Concept and Problem Statement
Most traditional trend and momentum indicators (e.g., RSI, ADX, MACD) focus on price displacement across a series of bars. However, they are mathematically "blind" to the internal structure of each individual bar. The DERYA indicator solves the "Velocity Trap" and "Lagging Confirmation" issues by shifting the measurement space from price displacement to intrabar efficiency. It quantifies the ratio between net price progress and the total effort (range) expended within the bar.
Logic and Components
The script does not reuse any existing open-source library logic; the methodology is derived from original research. However, it utilizes standard built-in Pine Script functions for structural stabilization:
Efficiency Metaphor: The core logic calculates a proxy for microstructural health using the formula |Close - Close[1]| / (High - Low).
Use of Exponential Moving Average (EMA): A standard ta.ema is applied to the raw efficiency data. Reason for use: Raw microstructural data is inherently noisy due to high-frequency fluctuations. The EMA is used here specifically as a low-pass filter to extract the underlying structural trend of efficiency without the overhead of more complex digital filters.
Use of Min-Max Normalization: The script utilizes ta.highest and ta.lowest over a lookback period. Reason for use: To convert an absolute efficiency metric into a bounded state variable (0-100). This ensures the indicator is adaptive to different volatility regimes, preventing the signal from becoming obsolete as market conditions change.
Interpretation
Expansion Regime (>60): Indicates a high-efficiency environment where price movement is achieved with minimal internal friction.
Collapse Regime (<40): Indicates a structural deterioration where price effort (range) significantly outweighs price progress (displacement), often signaling an imminent trend break.
Visual Integration: The script includes a barcolor feature that highlights bars where DERYA falls below 30, visually flagging points of extreme structural inefficiency directly on the price chart.
Compliance Note
This script is an original implementation of the DERYA methodology. It does not contain "copy-pasted" code from other public indicators. Standard functions (ta.ema, ta.highest, ta.lowest) are used only for their intended mathematical smoothing and normalization purposes as described above.
Scientific Documentation & Research Paper
This implementation is based on the following published research:
Title: DERYA: Dynamic Efficiency Regime Yield Analyzer - A New Microstructural State Variable for Financial Markets
Published on: Zenodo (CERN)
zenodo.org/records/18181902
DOI: 10.5281/zenodo.18181902
Author: Bülent Duman (Independent Researcher)
Copyright: (C) 2026 Bülent Duman
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.
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.
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.