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
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.