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%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
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] |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Quand on parle d’AFR on parle de quoi ?
merci
AFR means Average Filter Regression
Thanks you