Counting Relative Strength Days

Timeframe - 40 days

Is it possible to count how many days a stock has out performed SPX over the last 40 Days ?

Basically a RS Count over 40 days and then displaying this in a column to see in a watchlist which stock has the highest RS count.

Is this even possible ?

Sure - you can use the RIC() function for relative strength. If the RIC value is higher than yesterday then by definition the stock has outperformed the index.

Once you have that, you can then use the BARSTRUE() function to count over the 40 days:

// Is the Rel Strength higher?
V1=RIC() IsUp;
//Count the true results over X days;

In this example, $XLK has beaten the index 24 out of the last 40 days, and only 11 days for $XLE .

1 Like

Thanks so much. This is so helpful.

1 Like