Sever

Firstorder recurrence smoother

Category: Indicators By: Sever Created: June 13, 2023, 8:26 AM
June 13, 2023, 8:26 AM
Indicators
3 Comments
Firstorder recurrence smoother

This smoother is controlled by a fraction of the difference between price and AFR.
The starting value for the fraction p vaue is set at 50%

m = 10
p = 50

FOR n = 1 TO m DO
ONCE $AFR[n] = medianprice
NEXT

IF Close > $AFR[1] THEN
$AFR[1] = $AFR[1] + (Close - $AFR[1]) * p/100
ENDIF
IF Close < $AFR[1] THEN
$AFR[1] = $AFR[1] + (Close - $AFR[1]) * p/100
ENDIF

FOR i = 1 to m DO
IF $AFR[i] > $AFR[i+1] THEN
$AFR[i+1] = $AFR[i+1] + ($AFR[i] - $AFR[i+1]) * p/100
ENDIF
IF $AFR[i] < $AFR[i+1] THEN
$AFR[i+1] = $AFR[i+1] + ($AFR[i] - $AFR[i+1]) * p/100
ENDIF
NEXT

IF Close > $AFR[m] THEN
DRAWPOINT(barindex, customclose, 1)coloured(0,0,255)
DRAWSEGMENT(barindex, high, barindex, low)coloured(0,0,255)
ELSE
DRAWPOINT(barindex, customclose, 1)coloured(255,0,255)
DRAWSEGMENT(barindex, high, barindex, low)coloured(255,0,255)
ENDIF

RETURN close, $AFR[m]

Download
Filename: Firstorder-recurrence-smoother.itf
Downloads: 82
Sever
Sever Average
This author is like an anonymous function, present but not directly identifiable. More details on this code architect as soon as they exit 'incognito' mode.
Author’s Profile

Comments

supertiti
3 years ago
#

Thanks you

Sever
3 years ago
#

AFR means Average Filter Regression

supertiti
3 years ago
#

Quand on parle d'AFR on parle de quoi ? merci

ProRealCode ProRealCode
Loading...