HPotter

Commodity Selection Index

The Commodity Selection Index ("CSI") is a momentum indicator. It was
developed by Welles Wilder and is presented in his book New Concepts in
Technical Trading Systems. The name of the index reflects its primary purpose.
That is, to help select commodities suitable for short-term trading.
A high CSI rating indicates that the commodity has strong trending and volatility
characteristics. The trending characteristics are brought out by the Directional
Movement factor in the calculation--the volatility characteristic by the Average
True Range factor.
Wilder's approach is to trade commodities with high CSI values (relative to other
commodities). Because these commodities are highly volatile, they have the potential
to make the "most money in the shortest period of time." High CSI values imply
trending characteristics which make it easier to trade the security.
The Commodity Selection Index is designed for short-term traders who can handle
the risks associated with highly volatile markets.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 18/04/2014
// The Commodity Selection Index ("CSI") is a momentum indicator. It was 
// developed by Welles Wilder and is presented in his book New Concepts in 
// Technical Trading Systems. The name of the index reflects its primary purpose. 
// That is, to help select commodities suitable for short-term trading.
// A high CSI rating indicates that the commodity has strong trending and volatility 
// characteristics. The trending characteristics are brought out by the Directional 
// Movement factor in the calculation--the volatility characteristic by the Average 
// True Range factor.
// Wilder's approach is to trade commodities with high CSI values (relative to other 
// commodities). Because these commodities are highly volatile, they have the potential 
// to make the "most money in the shortest period of time." High CSI values imply 
// trending characteristics which make it easier to trade the security.
// The Commodity Selection Index is designed for short-term traders who can handle 
// the risks associated with highly volatile markets.
////////////////////////////////////////////////////////////
fADX(Len) =>
    up = change(high)
    down = -change(low)
    trur = rma(tr, Len)
    plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, Len) / trur)
    minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, Len) / trur)
    sum = plus + minus 
    100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), Len)

study(title="Commodity Selection Index", shorttitle="CSI")
PointValue = input(50)
Margin = input(3000)
Commission = input(10)
Length = input(14)
K = 100 * ((PointValue / sqrt(Margin) / (150 + Commission)))
xATR = atr(Length)
xADX = fADX(Length)
nADXR = (xADX + xADX[Length]) * 0.5
xCSI = K * xATR * nADXR
plot(xCSI, color=green, title="Commodity Selection Index")