Trading View to Pro Real time code

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #70936 quote
    Ritesh NayakRitesh Nayak
    Participant
    Junior
    Hi Everyone, I have just moved from using Tradingview to Prorealtime. Looking for help in converting one of the indicators I used there. Unfortunately, dont have the xperience to convert myself. Is there a way somebody can help? study(title=”RSI Divergence”, shorttitle=”RSI Divergence”) src_fast = close, len_fast = input(5, minval=1, title=”Length Fast RSI”) src_slow = close, len_slow = input(14,minval=1, title=”Length Slow RSI”) up_fast = rma(max(change(src_fast), 0), len_fast) down_fast = rma(-min(change(src_fast), 0), len_fast) rsi_fast = down_fast == 0 ? 100 : up_fast == 0 ? 0 : 100 – (100 / (1 + up_fast / down_fast)) up_slow = rma(max(change(src_slow), 0), len_slow) down_slow = rma(-min(change(src_slow), 0), len_slow) rsi_slow = down_slow == 0 ? 100 : up_slow == 0 ? 0 : 100 – (100 / (1 + up_slow / down_slow)) //plotfast = plot(rsi_fast, color=blue) //plotslow = plot(rsi_slow, color=orange) divergence = rsi_fast – rsi_slow plotdiv = plot(divergence, color = divergence > 0 ? lime:red, linewidth = 2) //band1 = hline(70,color=green) //band0 = hline(30,color=red) band = hline(0) Thanks Ritesh
    #70991 quote
    bolsatrilerabolsatrilera
    Participant
    Master
    Hi Ritesh Nayak , Maybe it’s something like this :
    REM RSI DIVERGENCE
    //on platform Traidngview by Shizaru
    //adapted for platfomr Prorealtime v 10.3 by bolsatrilera
    
    srcfast = close
    lenfast = 5 //minval=1, title="Length Fast RSI")
    srcslow = close
    lenslow = 14 //minval=1, title="Length Slow RSI")
    upfast =WilderAverage[lenfast](max(close-close[1],srcfast))
    downfast =WilderAverage[lenfast](min(close-close[1],srcfast))
    
    if downfast = 0 then
    rsifast =100
    elsif upfast =0 then
    rsifast = 0
    else
    rsifast =100 - (100 / (1 + upfast / downfast))
    endif
    
    upslow =WilderAverage[lenslow](max(close-close[1],srcslow))
    downslow =WilderAverage[lenslow](min(close-close[1],srcslow))
    
    if downslow = 0 then
    rsislow =100
    elsif upslow =0 then
    rsislow=0
    else
    rsislow =100 - (100 / (1 + upslow / downslow))
    endif
    
    divergence = rsifast - rsislow
    
    if divergence > 0 then
    r=0
    g=255
    b=0
    else
    r=255
    g=0
    b=0
    endif
    
    
    return divergence coloured (r,g,b)as "rsi divergence", 0 style(dottedline)as "0"
    
    IBX35-Diario.png IBX35-Diario.png
    #70993 quote
    bolsatrilerabolsatrilera
    Participant
    Master
    allow me a small correction, now if I give it for good :
    REM RSI DIVERGENCE
    //on platform Traidngview by Shizaru
    //adapted for platfomr Prorealtime v 10.3 by bolsatrilera
    
    srcfast = close
    lenfast = 5 //minval=1, title="Length Fast RSI")
    srcslow = close
    lenslow = 14 //minval=1, title="Length Slow RSI")
    upfast =WilderAverage[lenfast](max(close-close[1],srcfast))
    downfast =WilderAverage[lenfast](-min(close-close[1],srcfast))
    
    if downfast = 0 then
    rsifast =100
    elsif upfast =0 then
    rsifast = 0
    else
    rsifast =100 - (100 / (1 + upfast / downfast))
    endif
    
    upslow =WilderAverage[lenslow](max(close-close[1],srcslow))
    downslow =WilderAverage[lenslow](-min(close-close[1],srcslow))
    
    if downslow = 0 then
    rsislow =100
    elsif upslow =0 then
    rsislow=0
    else
    rsislow =100 - (100 / (1 + upslow / downslow))
    endif
    
    divergence = rsifast - rsislow
    
    if divergence > 0 then
    r=0
    g=255
    b=0
    else
    r=255
    g=0
    b=0
    endif
    
    
    return divergence coloured (r,g,b)as "rsi divergence", 0 style(dottedline)as "0"
    
    Nicolas thanked this post
    IBX35-Diario-1.png IBX35-Diario-1.png
    #71005 quote
    NicolasNicolas
    Keymaster
    Legend
    Thanks bolsatrilera! @Ritesh

    >> Please update your country flag in your profile. Thank you 🙂 <<

    #71025 quote
    Ritesh NayakRitesh Nayak
    Participant
    Junior
    Amazing work Nicholas. You are superb
Viewing 5 posts - 1 through 5 (of 5 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

Trading View to Pro Real time code


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by Ritesh NayakRitesh Nayak
8 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/20/2018
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...