
이 전략은 차드 동력 흔들림 지표 ((CMO) 를 기반으로 한 트렌드 추적 거래 시스템이다. 이 전략은 가격 동력을 계산하고 분석하여 과매도 지역에서 구매 기회를 찾고 과매도 지역에서 판매 기회를 찾고 포지션 기간 제한과 함께 위험을 관리합니다. 이 방법은 가격의 역전 기회를 포착하고 흔들림 시장에서 자주 거래되는 것을 피할 수 있습니다.
전략의 핵심은 시장의 동력을 측정하기 위해 CMO 지표를 사용하는 것입니다. CMO는 상승과 하락의 차이와 총액의 비율을 계산하여 100에서 100 사이의 변동하는 지표 값을 생성합니다. CMO가 50보다 낮으면 시장이 초매 상태에 있음을 나타냅니다.
이는 동력에 기반한 트렌드 추적 전략으로, CMO 지표를 통해 시장의 과매매 기회를 포착한다. 전략 설계는 합리적이며, 명확한 거래 규칙과 위험 제어 장치가 있다. 일부 고유한 위험이 존재하지만, 최적화를 통해 전략의 안정성과 수익성을 더욱 향상시킬 수 있다. 전략은 특히 변동성이 큰 시장에 적합하며, 트렌드가 명백한 단계에서 더 나은 수익을 얻을 수 있다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-25 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Chande Momentum Oscillator Strategy", overlay=false)
// Input for the CMO period
cmoPeriod = input.int(9, minval=1, title="CMO Period")
// Calculate price changes
priceChange = ta.change(close)
// Separate positive and negative changes
up = priceChange > 0 ? priceChange : 0
down = priceChange < 0 ? -priceChange : 0
// Calculate the sum of ups and downs using a rolling window
sumUp = ta.sma(up, cmoPeriod) * cmoPeriod
sumDown = ta.sma(down, cmoPeriod) * cmoPeriod
// Calculate the Chande Momentum Oscillator (CMO)
cmo = 100 * (sumUp - sumDown) / (sumUp + sumDown)
// Define the entry and exit conditions
buyCondition = cmo < -50
sellCondition1 = cmo > 50
sellCondition2 = ta.barssince(buyCondition) >= 5
// Track if we are in a long position
var bool inTrade = false
if (buyCondition and not inTrade)
strategy.entry("Long", strategy.long)
inTrade := true
if (sellCondition1 or sellCondition2)
strategy.close("Long")
inTrade := false
// Plot the Chande Momentum Oscillator
plot(cmo, title="Chande Momentum Oscillator", color=color.blue)
hline(-50, "Buy Threshold", color=color.green)
hline(50, "Sell Threshold", color=color.red)