CONVERSION INDICADOR TRADINGVIEW Relative Volatility Measure (RVM)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #231427 quote
    nautilus23
    Participant
    Average
    #231431 quote
    Iván González
    Moderator
    Master

    Buenos días
    Aquí tienes el código traducido.

    //------------------------------------------------------------//
    //PRC_RVM Relative Volatility Measure
    //version = 0
    //12.04.24
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //------------------------------------------------------------//
    //-----Inputs--------------------------------------------------//
    lookbackPeriod=15//Lookback Period
    showBgColor = 1//Show Background Color
    //------------------------------------------------------------//
    //-----Short Term ATRs calculation----------------------------//
    short1=averagetruerange[3]
    short2=averagetruerange[5]
    short3=averagetruerange[8]
    shortAvg=(short1+short2+short3)/3
    //------------------------------------------------------------//
    //-----Long Term ATRs calculation-----------------------------//
    Long1=averagetruerange[55]
    Long2=averagetruerange[89]
    Long3=averagetruerange[144]
    LongAvg=(Long1+Long2+Long3)/3
    //------------------------------------------------------------//
    //-----Combined ATR value-------------------------------------//
    combinedATR = (shortAvg + longAvg) / 2
    //------------------------------------------------------------//
    //-----Highest and lowest combined ATR over lookbackPeriod----//
    highestCombinedATR = highest[lookbackPeriod](combinedATR) 
    lowestCombinedATR = lowest[lookbackPeriod](combinedATR)
    //------------------------------------------------------------//
    //-----RVM Calculation----------------------------------------//
    rvm = (combinedATR - lowestCombinedATR) / max(highestCombinedATR - lowestCombinedATR, 0.001) * 100
    //------------------------------------------------------------//
    //-----Background color conditions----------------------------//
    if showBgColor and rvm>=0 and rvm <=10 then
    backgroundcolor(21,216,34,85)
    elsif showBgColor and rvm>10 and rvm<=20 then
    backgroundcolor(37,214,238,85)
    endif
    //------------------------------------------------------------//
    return rvm as "RVM"coloured("blue")style(line,2),50 as "Midpoint"coloured("grey")style(dottedline),20 as "Midpoint"coloured(37,214,238)style(dottedline),10 as "Midpoint"coloured(21,216,34)style(dottedline)
    nautilus23 thanked this post
    #231457 quote
    nautilus23
    Participant
    Average

    Muchas gracias Ivan por tu ayuda y tu rapidez.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

CONVERSION INDICADOR TRADINGVIEW Relative Volatility Measure (RVM)


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
nautilus23 @nautilus23 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by nautilus23
1 year, 10 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 04/12/2024
Status: Active
Attachments: No files
Logo Logo
Loading...