Welles Wilder introduced the CSI (Commodity Selection Index) in his bestseller “New concepts in technical trading” and uses this indicator to screen the commodities that are “strong” enough to be traded with a trend following system. The bigger the CSI the stronger the trend.
The index created originally by Wilder though is made for commodities and is not reliable for stocks. I tried to upgrade this indicator also for stocks by changing a little the formula and by redesigning the ATR formula.
I am attaching the original version and the modified version.
Blue skies!!
Code for commodities
Leverage=50
Margin=1000
Commissions=20
fact1=Leverage/(sqrt(Margin))
fact2=1/(150+Commissions)
csi=ADXR[14]*AverageTrueRange[14](close)*fact1*fact2*100
return csi as "Commodity Selection Index"
Code for stocks
//period=14
//MM=3
a=range/close[1]
b=abs(high-close[1])/close[1]
c=abs(low-close[1])/close[1]
TRbalanced=100*max(a,max(b,c))
ATRbalanced=Average[period,MM](trbalanced)
csi=ADXR[14]*atrbalanced
return csi as "Commodity Selection Index"