MoneyMagnet
Member
I've been working on a way to assess equities based on the "smoothness" of their price action. Smooth price action gives clearer signals and fewer false signals. This code is based on the concept of Extreme Range, which is similar to True Range, but captures a fuller picture of the maximum price change between each bar and the next; it's looking for the bar-bar choppiness while ignoring any tradeable swings or trends.
The method is to calculate the Extreme Range series, aggressively de-trend it, average it over time, then express it as a percentage of the stock price. By default, it averages over 50 bars and sets a threshold of 3% of stock price. All adjustable, of course.
I am using it to find stocks that have lower risk, though they may also have little tradeable price movement. That can be screened for using other tools.
Share link: http://tos.mx/3gzlJYK
The method is to calculate the Extreme Range series, aggressively de-trend it, average it over time, then express it as a percentage of the stock price. By default, it averages over 50 bars and sets a threshold of 3% of stock price. All adjustable, of course.
Code:
#-- XRI (Extreme Range Index)
#-- MoneyMagnet (2020)
declare lower;
input NoisePeriod = 3;
input ScorePeriod = 50;
input Threshold = 3;
def XR = CompoundValue(1, if AbsValue(low - XR[1]) > AbsValue(high - XR[1]) then low else high, high);
def Noise = Average(AbsValue(XR - MovingAverage(AverageType.Hull, ohlc4, NoisePeriod)), ScorePeriod);
plot XRI = Noise / ohlc4 * 100;
plot Thresh = Threshold;
plot Zero = 0;
Zero.AssignValueColor(Color.BLACK);
AddLabel(yes, XRI, Color.YELLOW);
I am using it to find stocks that have lower risk, though they may also have little tradeable price movement. That can be screened for using other tools.
Share link: http://tos.mx/3gzlJYK
Last edited by a moderator: