该策略基于均线转换-发散指标(CMO)进行交易判断。CMO绝对值代表价格发散程度,策略以CMO三个周期绝对值的平均值判定超买超卖,属于典型的震荡指标交易策略。
该策略主要运用以下逻辑:
CMO指数反映价格变化的动量。其绝对值大小代表价格发散程度,超过一定幅度则进入超买超卖区域。该策略利用CMO的这一特性,采取多周期均值以平滑曲线,判断超买超卖状况,属于典型的震荡交易策略。
应对方法:
该策略可从以下几个维度进行扩展:
该策略利用CMO判定超买超卖进行反转交易,由于采用多周期均值,可以有效平滑曲线,避免错误信号。CMO指数本身理论基础稳固,可靠判定价格发散状况。通过参数优化、止损策略等扩展,可以将其优化成一个较为稳定的震荡指标交易策略。
/*backtest
start: 2023-09-11 00:00:00
end: 2023-09-14 07:00:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
////////////////////////////////////////////////7////////////
// Copyright by HPotter v1.0 21/02/2017
// This indicator plots the absolute value of CMO averaged over three
// different lengths. This indicator plots a classical-looking oscillator,
// which is really an averaged value based on three different periods.
//
// You can change long to short in the Input Settings
// Please, use it only for learning or paper trading. Do not for real trading.
////////////////////////////////////////////////////////////
strategy(title="CMOabsav", shorttitle="CMOabsav")
Length1 = input(5, minval=1)
Length2 = input(10, minval=1)
Length3 = input(20, minval=1)
TopBand = input(58, minval=1)
LowBand = input(5, minval=0)
reverse = input(false, title="Trade reverse")
hline(0, color=green, linestyle=hline.style_dashed)
hline(TopBand, color=purple, linestyle=hline.style_solid)
hline(LowBand, color=red, linestyle=hline.style_solid)
xMom = close - close[1]
xMomabs = abs(close - close[1])
nSum1 = sum(xMom, Length1)
nSumAbs1 = sum(xMomabs, Length1)
nSum2 = sum(xMom, Length2)
nSumAbs2 = sum(xMomabs, Length2)
nSum3 = sum(xMom, Length3)
nSumAbs3 = sum(xMomabs, Length3)
nRes = abs(100 * (nSum1 / nSumAbs1 + nSum2 / nSumAbs2 + nSum3 / nSumAbs3 ) / 3)
pos = iff(nRes > TopBand, 1,
iff(nRes < LowBand, -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(nRes, color=blue, title="CMOabsav")