OPEN-SOURCE SCRIPT
NAJI EL HAJJ HASSAN ntraday Regime Index (NIRI) The Naji I

Naji Intraday Regime Index (NIRI)
The Naji Intraday Regime Index (NIRI) is an adaptive market activity and volatility regime indicator designed to identify whether the current trading session is behaving in compression, balance, expansion, or momentum conditions relative to its historical intraday behavior.
Unlike traditional volatility indicators such as ATR, NIRI compares the current session’s cumulative intraday movement against the average movement of the same exact time window across a user-defined historical sample.
The indicator measures the market’s real intraday activity using cumulative absolute price movement:
∑
∣
c
l
o
s
e
−
c
l
o
s
e
[
1
]
∣
∑∣close−close[1]∣
This approach captures actual market participation and directional activity more effectively than simple net price change, allowing traders to detect:
ranging environments,
volatility compression,
session expansion,
abnormal momentum conditions,
and statistically quiet or active trading periods.
NIRI dynamically compares:
the current day’s movement from a selected starting time (market open or custom time),
to a selected ending time (current time or custom time),
against the same intraday window over a configurable number of previous trading sessions.
The output is expressed as a relative activity percentage:
C
u
r
r
e
n
t
M
o
v
e
m
e
n
t
H
i
s
t
o
r
i
c
a
l
A
v
e
r
a
g
e
×
100
Historical Average
Current Movement
×100
Interpretation example:
Below 70% → Compression / low activity / ranging conditions
70%–100% → Normal session behavior
Above 100% → Expansion relative to historical norms
Above 130% → Strong momentum or abnormal volatility
The indicator is designed as a market regime filter rather than a directional signal generator. It helps traders adapt strategy selection based on current session conditions:
trend-following during expansion,
mean reversion during compression,
and risk reduction during abnormal volatility.
Key Features:
Adaptive intraday volatility comparison
Same-time historical session analysis
Automatic or manual session timing
User-defined lookback period
Relative movement normalization
Ranging and expansion regime detection
Instrument-independent behavior modeling
NIRI is especially effective for:
index futures,
forex,
crypto,
commodities,
and highly session-dependent markets where volatility behavior changes significantly throughout the trading day.
Created by Naji.
The Naji Intraday Regime Index (NIRI) is an adaptive market activity and volatility regime indicator designed to identify whether the current trading session is behaving in compression, balance, expansion, or momentum conditions relative to its historical intraday behavior.
Unlike traditional volatility indicators such as ATR, NIRI compares the current session’s cumulative intraday movement against the average movement of the same exact time window across a user-defined historical sample.
The indicator measures the market’s real intraday activity using cumulative absolute price movement:
∑
∣
c
l
o
s
e
−
c
l
o
s
e
[
1
]
∣
∑∣close−close[1]∣
This approach captures actual market participation and directional activity more effectively than simple net price change, allowing traders to detect:
ranging environments,
volatility compression,
session expansion,
abnormal momentum conditions,
and statistically quiet or active trading periods.
NIRI dynamically compares:
the current day’s movement from a selected starting time (market open or custom time),
to a selected ending time (current time or custom time),
against the same intraday window over a configurable number of previous trading sessions.
The output is expressed as a relative activity percentage:
C
u
r
r
e
n
t
M
o
v
e
m
e
n
t
H
i
s
t
o
r
i
c
a
l
A
v
e
r
a
g
e
×
100
Historical Average
Current Movement
×100
Interpretation example:
Below 70% → Compression / low activity / ranging conditions
70%–100% → Normal session behavior
Above 100% → Expansion relative to historical norms
Above 130% → Strong momentum or abnormal volatility
The indicator is designed as a market regime filter rather than a directional signal generator. It helps traders adapt strategy selection based on current session conditions:
trend-following during expansion,
mean reversion during compression,
and risk reduction during abnormal volatility.
Key Features:
Adaptive intraday volatility comparison
Same-time historical session analysis
Automatic or manual session timing
User-defined lookback period
Relative movement normalization
Ranging and expansion regime detection
Instrument-independent behavior modeling
NIRI is especially effective for:
index futures,
forex,
crypto,
commodities,
and highly session-dependent markets where volatility behavior changes significantly throughout the trading day.
Created by Naji.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.