Kalman filtered RSI oscillator – from Tradingview

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #241430 quote
    JoshPhoenix
    Participant
    New

    https://www.tradingview.com/script/0YrX18dJ-Kalman-Filtered-RSI-Oscillator-BackQuant/

     

    Is anyone able to convert this indicator to PRC?

     

    It appears to be useful as a strategy, as outlined here:

     

    https://substack.com/home/post/p-152967438?source=queue&autoPlay=false

    #241523 quote
    JS
    Participant
    Senior

    Hi, I can’t translate the Pine code, but this is the ‘normal’ Kalman filter combined with the RSI…

    // 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)

    JoshPhoenix and Iván González thanked this post
    #241528 quote
    JoshPhoenix
    Participant
    New
    Perfect, thank you 🙂
    JS thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Kalman filtered RSI oscillator – from Tradingview


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by JoshPhoenix
1 year, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 12/15/2024
Status: Active
Attachments: 3 files
Logo Logo
Loading...