HayeTrading

ROC Percentile

Rate Of Change Percentile calculates the current ROC (user defined length) as a percentile rank.

We use 2 separate arrays, one for all positive ROC values and one for all negative values within a defined lookback period. Then the current ROC value is compared to those arrays to find it's percentile ranking.
For example, a ranking of 75 means the ROC is in the 75th percentile of all POSITIVE ROC values over the lookback period.
A ranking of -80 is in the 80th percentile of all NEGATIVE ROC values over the lookback period.

Most ROC scripts use raw ROC values (or smoothed or otherwise altered), or have stochastic formula applied to them, I've not seen one that displays ROC as percentile ranking of previous positive/negative values.

What is the advantage?

Raw ROC data only gives half the picture. What we want to do is compare the ROC to previous ROC values, to give a sense of scale. Raw ROC values don't give you that context and you can only compare visually, usually limited to the number of bars you can see on your screen.
Using a percentile ranking gives us the context of current Rate of Change relative to the previous Rate of Change over a large lookback period, and not just visually but mathematically.

Why not using a long stochastic ROC? The problem with stochastics in general is that an outlier data point can ruin the data for the rest of the lookback period.
For example, imagine a huge outlier 8% ROC. The 2nd largest ROC is 4% and the 3rd largest is 2%, with all other values below this.
In this example, a stochastic ROC would display the 8% outlier as 100, the 4% as 50, the 2% as 25 and all other data would be squeezed down between 0-25.
Additionally, a value of 60 may have vastly different meaning depending on whether the lookback period contains a large outlier or not.

With a percentile ranking, that 8% outlier would still have a value of 100. But the 4% and 2% would be 99 and 98 respectively (this assumes 100 data points in the series, in reality values will usually be decimals).
This effectively flattens the curve and gives a more consistent and dependable experience, allowing you to more accurately assess the relative importance of the current ROC.

The line of circles is set at the 50 and -50 values for quick comparison.
Values > 50 represent ROC greater than 50% of previous positive ROC values.
Values < -50 represent ROC greater than 50% of previous negative ROC values.

discord.gg/mFYvr2bGtu - FREE Trading Chat Rooms
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?