
이 전략은 다이아몬드 변동률 지표에 기반한 단선 거래 시스템을 설계하고, 주로 시장의 단선 변동을 포착하기 위해 사용된다. 이 전략의 주요 아이디어는 다이아몬드 변동률 지표에 지정된 경계를 넘거나 넘을 때 구매 또는 판매 작업을 수행하는 것이다.
다이아몬드 변동률 지표는 증권의 최고 가격과 최저 가격의 범위를 계산하여 변동률을 정량적으로 측정한다. 최고 가격과 최저 가격의 차이는 확대될 때 변동률이 상승하는 것을 나타낸다.
이 전략의 구체적인 논리는 다음과 같습니다.
이 전략은 다음과 같은 장점을 가지고 있습니다.
이 전략에는 몇 가지 위험도 있습니다.
위험의 해결책은 다음과 같습니다.
이 정책은 다음과 같은 측면에서 최적화될 수 있습니다.
이 전략의 전체적인 아이디어는 명확하고 간결하며, 짧은 선의 조작 특성을 가지고 있다. 파라미터를 설정하는 것은 유연하며, 필요에 따라 조정할 수 있다. 또한 일부 파라미터가 너무 잘 맞출 수 있고 거래 빈도가 너무 높다는 위험도 있다. 추가적인 최적화를 통해 전략의 파라미터 로버스티를 더 강화하여 더 안정적인 성과를 얻을 수 있다.
/*backtest
start: 2023-11-20 00:00:00
end: 2023-12-04 00:00:00
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version = 2
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 01/12/2016
// Chaikin's Volatility indicator compares the spread between a security's
// high and low prices. It quantifies volatility as a widening of the range
// between the high and the low price.
// You can use in the xPrice1 and xPrice2 any series: Open, High, Low, Close, HL2,
// HLC3, OHLC4 and ect...
// 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="Chaikin Volatility Strategy Backtest")
Length = input(10, minval=1)
ROCLength = input(12, minval=1)
Trigger = input(0, minval=1)
reverse = input(false, title="Trade reverse")
hline(0, color=purple, linestyle=line)
hline(Trigger, color=red, linestyle=line)
xPrice1 = high
xPrice2 = low
xPrice = xPrice1 - xPrice2
xROC_EMA = roc(ema(xPrice, Length), ROCLength)
pos = iff(xROC_EMA < Trigger, 1,
iff(xROC_EMA > Trigger, -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(pos == -1 ? red: pos == 1 ? green : blue )
plot(xROC_EMA, color=blue, title="Chaikin Volatility Strategy")