Firstorder recurrence smoother

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

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: 81
Sever Average
Developer by day, aspiring writer by night. Still compiling my bio... Error 404: presentation not found.
Author’s Profile

Comments

Logo Logo
Loading...