PROTECTED SOURCE SCRIPT
RRE Line

Step 1: Initialize Parameters
length: Period of the indicator (default: 99)
src: Source input, typically the close price
ama: Initialize at 0.0 (Adaptive Moving Average value)
Step 2: Calculate Highest High Signal (hh)
hh
=
max
(
sign
(
Δ
highest
(
n
)
)
,
0
)
hh=max(sign(Δhighest(n)),0)
Breakdown:
highest(n) finds the highest price over the last n periods
Δ calculates the change from the previous bar
sign() returns +1 if positive, -1 if negative, 0 if zero
max(..., 0) ensures result is either 1 or 0
Result: hh = 1 when a new highest high is made, otherwise 0
Step 3: Calculate Lowest Low Signal (ll)
ll
=
max
(
sign
(
Δ
lowest
(
n
)
×
−
1
)
,
0
)
ll=max(sign(Δlowest(n)×−1),0)
Breakdown:
lowest(n) finds the lowest price over the last n periods
Δ calculates the change from the previous bar
Multiply by -1 to invert the sign
sign() processes the inverted value
max(..., 0) ensures result is either 1 or 0
Result: ll = 1 when a new lowest low is made, otherwise 0
Step 4: Calculate Trend Coefficient (tc)
t
c
(
t
)
=
[
SMA
(
RegularitySignal
,
n
)
]
2
tc(t)=[SMA(RegularitySignal,n)]
2
Breakdown:
RegularitySignal = 1 if (hh = 1 OR ll = 1), else 0
Calculate simple moving average of the signal over n periods
Square the result to amplify adaptive behavior
Result: tc represents the squared average frequency of new highs/lows
length: Period of the indicator (default: 99)
src: Source input, typically the close price
ama: Initialize at 0.0 (Adaptive Moving Average value)
Step 2: Calculate Highest High Signal (hh)
hh
=
max
(
sign
(
Δ
highest
(
n
)
)
,
0
)
hh=max(sign(Δhighest(n)),0)
Breakdown:
highest(n) finds the highest price over the last n periods
Δ calculates the change from the previous bar
sign() returns +1 if positive, -1 if negative, 0 if zero
max(..., 0) ensures result is either 1 or 0
Result: hh = 1 when a new highest high is made, otherwise 0
Step 3: Calculate Lowest Low Signal (ll)
ll
=
max
(
sign
(
Δ
lowest
(
n
)
×
−
1
)
,
0
)
ll=max(sign(Δlowest(n)×−1),0)
Breakdown:
lowest(n) finds the lowest price over the last n periods
Δ calculates the change from the previous bar
Multiply by -1 to invert the sign
sign() processes the inverted value
max(..., 0) ensures result is either 1 or 0
Result: ll = 1 when a new lowest low is made, otherwise 0
Step 4: Calculate Trend Coefficient (tc)
t
c
(
t
)
=
[
SMA
(
RegularitySignal
,
n
)
]
2
tc(t)=[SMA(RegularitySignal,n)]
2
Breakdown:
RegularitySignal = 1 if (hh = 1 OR ll = 1), else 0
Calculate simple moving average of the signal over n periods
Square the result to amplify adaptive behavior
Result: tc represents the squared average frequency of new highs/lows
保護スクリプト
このスクリプトのソースコードは非公開で投稿されています。 しかし、無料かつ制限なしでご利用いただけます ― 詳細についてはこちらをご覧ください。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
保護スクリプト
このスクリプトのソースコードは非公開で投稿されています。 しかし、無料かつ制限なしでご利用いただけます ― 詳細についてはこちらをご覧ください。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。