// K = 1000 ({1...2000})
K = 6
ONCE Pred = Close
Series=Close
IF BarIndex = 0 THEN
Kalman = Close
ELSE
Smooth = Pred + (Series - Pred) * SQRT((K / 10000) * 2)
Velo = Velo + ((K / 10000) * (Series - Pred))
Pred = Smooth + Velo
Kalman = Pred
ENDIF
// Kalman RSI
KalmanRSI=RSI[14](Kalman)
// NormalizedRSI
LowestRSI=Lowest[100](KalmanRSI)
HighestRSI=Highest[100](KalmanRSI)
normalizedRSI=(KalmanRSI-LowestRSI)/(HighestRSI-LowestRSI)-0.5
// Color Logic for Trend
IF normalizedRSI > 0 AND normalizedRSI > normalizedRSI[1] THEN
trendColorR = 0 //Bright Green
trendColorG = 255
trendColorB = 8
ELSIF normalizedRSI > 0 AND normalizedRSI < normalizedRSI[1] THEN
trendColorR = 0 //Light Blue
trendColorG = 187
trendColorB = 212
ELSIF normalizedRSI < 0 AND normalizedRSI < normalizedRSI[1] THEN
trendColorR = 255 //Red
trendColorG = 0
trendColorB = 0
ELSIF normalizedRSI < 0 AND normalizedRSI > normalizedRSI[1] THEN
trendColorR = 119 //Dark Red
trendColorG = 21
trendColorB = 21
ENDIF
// Plot NormalizedRSI
Return normalizedRSI Coloured(trendColorR,trendColorG,trendColorB) Style(Histogram)