Kalman filtered RSI oscillator – from Tradingview

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #241430 quote
    JoshPhoenixJoshPhoenix
    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
    kalman-rsi.jpg kalman-rsi.jpg
    #241523 quote
    JSJS
    Participant
    Master

    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
    Scherm­afbeelding-2024-12-17-om-21.25.45.jpg Scherm­afbeelding-2024-12-17-om-21.25.45.jpg Scherm­afbeelding-2024-12-17-om-21.39.41.png Scherm­afbeelding-2024-12-17-om-21.39.41.png
    #241528 quote
    JoshPhoenixJoshPhoenix
    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 JoshPhoenixJoshPhoenix
1 year, 9 months ago.

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