OPEN-SOURCE SCRIPT
Updated Ratio To Average - The Quant Science

Ratio To Average - The Quant Science is a quantitative indicator that calculates the percentage ratio of the market price in relation to a reference average. The indicator allows the calculation of the ratio using four different types of averages: SMA, EMA, WMA, and HMA. The ratio is represented by a series of histograms that highlight periods when the ratio is positive (in green) and periods when the ratio is negative (in red).
https://tradingview.sweetlogin.com/x/2frlVNR0/
What is the Ratio to Average?
The Ratio to Average is a measure that tracks the price movements with one of its averages, calculating how much the price is above or below its own average, in percentage terms.
https://tradingview.sweetlogin.com/x/CeOvky77/
USER INTERFACE
Lenght: it adjusts the number of bars to include in the calculation of the average.
https://tradingview.sweetlogin.com/x/oVPR1tT9/
Moving Average: it allows you to choose the type of average to use.
https://tradingview.sweetlogin.com/x/ihiuj30K/
Color Up/Color Down: it allows you to choose the color of the indicator for positive and negative ratios.
https://tradingview.sweetlogin.com/x/37b2zPAV/
https://tradingview.sweetlogin.com/x/2frlVNR0/
What is the Ratio to Average?
The Ratio to Average is a measure that tracks the price movements with one of its averages, calculating how much the price is above or below its own average, in percentage terms.
https://tradingview.sweetlogin.com/x/CeOvky77/
USER INTERFACE
Lenght: it adjusts the number of bars to include in the calculation of the average.
https://tradingview.sweetlogin.com/x/oVPR1tT9/
Moving Average: it allows you to choose the type of average to use.
https://tradingview.sweetlogin.com/x/ihiuj30K/
Color Up/Color Down: it allows you to choose the color of the indicator for positive and negative ratios.
https://tradingview.sweetlogin.com/x/37b2zPAV/
Release Notes
Code update to Pine Script V6Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.