Hi I was wondering if it was possible to convert such indicator for PRT: this is a useful tool to build a portfolio by ranking stocks by strength based on Andreas Clenow’s book “Stocks on the Move” . Here’s the strategy: 1. Determine the 90 day annualized exponential regression slope for each stock 2. Determine the 90 day R-squared value for each of the stock 3. Multiply #1 * #2 and then sort from highest to lowest —> screener PRT 4. Buy the top stocks based on the formula ((AccountValue * 0.001)/ATR(20)) Thanks. //@version=4 // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // Exponential Regression Slope Annualized with R-squared Histogram // by SparkyFlary study(title="Exponential Regression Slope Annualized with R-squared Histogram", shorttitle="Exponential Regression Slope Annualized with R-squared", format=format.percent, overlay=false) length = input(90, title="Slope length") rSquaredThreshold = input(0.0, title="R-squared threshold", minval=0, maxval=1) withRsquared = input(true, title="Multiply by R-squared?") withAnnualize = input(true, title="Annualize slope?") daysInYear = input(252, title="Number of bars in a year(if slope is annualized)") src = input(close, title="Source") //natural log of price nlPrice = log(src) //alexgrover's regression slope code x = bar_index y = nlPrice x_ = sma(x,length) y_ = sma(y,length) mx = stdev(x,length) my = stdev(y,length) c = correlation(x,y,length) slope = c * (my/mx) //inter = y_ - slope*x_ //reg = x*slope + inter exp_slope = slope annualized_slope = (pow(exp(slope),daysInYear) - 1) * 100 rSquared = pow(correlation(cum(1), nlPrice, length), 2) slopeAnnualized_with_Rsquared = withAnnualize ? annualized_slope * (withRsquared ? rSquared : 1) : exp_slope * (withRsquared ? rSquared : 1) trend = rSquared>rSquaredThreshold rising = slopeAnnualized_with_Rsquared>slopeAnnualized_with_Rsquared[1] falling = slopeAnnualized_with_Rsquared<slopeAnnualized_with_Rsquared[1] up = slopeAnnualized_with_Rsquared>0 down = slopeAnnualized_with_Rsquared<0 up_rising_color = color.new(color.green, 0) up_falling_color = color.new(color.green, 50) down_falling_color = color.new(color.red, 0) down_rising_color = color.new(color.red, 50) col = trend and up and rising?up_rising_color:trend and up and falling?up_falling_color:trend and down and falling?down_falling_color:trend and down and rising?down_rising_color : color.gray plot(slopeAnnualized_with_Rsquared, title="Annualized slope x R-squared", style=plot.style_histogram, color = col, linewidth=3)