动量商品选择指数(Commodity Selection Index,CSI)策略是一种追踪市场动量的短线交易策略。它通过计算商品的趋势性和波动性,来识别出具有强劲动量的商品进行交易。该策略由威尔斯·怀尔德(Welles Wilder)在他的书《新技术分析交易系统概念》中提出。
该策略的核心指标是CSI指数,它综合考虑了商品的趋势性和波动性。具体计算方法是:
CSI = K × ATR × ((ADX + ADX的n日均线)/2)
其中,K是缩放系数,ATR代表平均真实波动幅度,它衡量市场的波动性。ADX代表平均方向指数,它反映市场的趋势性。
通过计算每个商品的CSI指数值,并与其n日简单移动均线进行比较,当CSI高于其移动均线时产生买入信号,当CSI低于其移动均线时产生卖出信号。
该策略选择CSI指数较高的商品进行交易。因为这些商品有很强的趋势性和波动性,能在短期内获得更大的盈利潜力。
该策略具有以下几个优势:
该策略也存在一些风险:
为控制风险,应合理设定止损位置,控制单笔仓位规模,并适当调整参数以符合不同市场环境。
该策略可从以下几个方面进行优化:
动量商品选择指数策略通过捕捉市场中的趋势性强和波动性大的商品,实现了简单快速的短线交易。这种专门追踪动量的方法使其信号清晰,易于实施自动化。当然也需要注意控制风险,并持续改进升级以适应市场环境的变化。
/*backtest
start: 2023-10-28 00:00:00
end: 2023-11-27 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 20/03/2019
// 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.
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
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)
strategy(title="Commodity Selection Index Backtest", shorttitle="CSI Backtest")
PointValue = input(50)
Margin = input(3000)
Commission = input(10)
Length = input(14)
reverse = input(false, title="Trade reverse")
K = 100 * ((PointValue / sqrt(Margin) / (150 + Commission)))
xATR = atr(Length)
xADX = fADX(Length)
nADXR = (xADX + xADX[Length]) * 0.5
xCSI = K * xATR * nADXR
xMACSI = sma(xCSI, Length)
pos = 0.0
pos := iff(xCSI < xMACSI, 1,
iff(xCSI > xMACSI, -1, nz(pos[1], 0)))
possig = iff(reverse and pos == 1, -1,
iff(reverse and pos == -1, 1, pos))
if (possig == 1)
strategy.entry("Long", strategy.long)
if (possig == -1)
strategy.entry("Short", strategy.short)
barcolor(possig == -1 ? red: possig == 1 ? green : blue )
plot(xCSI, color=green, title="CSI")
plot(xMACSI, color=red, title="CSI SMA")