Kalman Filter

Category: Indicators By: Jiacky Created: August 16, 2022, 8:38 AM
August 16, 2022, 8:38 AM
Indicators
0 Comments

Indicator Kalman Filter. It allows efficiently smoothing the noise, extracting the main trend from it.

This code is extracted from Average Filter Regression by laurenzo in PRC library and given signal according to the velocity. Go long if the velocity is above 0. Go short if the velocity is below 0.

// K = 500 ({1...2000})

Series = TotalPrice

ONCE Pred = Series

IF BarIndex = 0 THEN
KF = Series
ELSE
Smooth = Pred + (Series - Pred) * SQRT((K / 10000) * 2)
Velo = Velo + ((K / 10000) * (Series - Pred))
Pred = Smooth + Velo
KF = Pred
ENDIF

if velo > 0 then
g = 255
r = 0
else
g=0
r=255
endif

RETURN KF coloured(r,g,0) as "Kalman Filter" style (DOTTEDLINE4,3), Velo as "Velocity"

Download
Filename: Kalman-Filter.itf
Downloads: 172
Jiacky Junior
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

Logo Logo
Loading...