
이 전략은 스티브 카니쉬 (Steve Karnish) 가 개발한 CCT 볼링거 밴드 오시컬레이터 (CCT Bollinger Band Oscillator) 지표에 기반하여, 가격의 평균선을 뚫고 반전하는 것을 확인하고 반전하는 메커니즘을 결합합니다.
이 전략은 높은 가격을 소스 데이터로 사용하고, 그 다음 CCT 진동대 진동기의 값을 계산한다. 진동기의 값은 200에서 200 사이로 변동하며, 0은 평균 가격 2배의 표준 차이를 빼고, 100은 평균 가격 2배의 표준 차이를 더한다. 진동기가 EMA 평균선을 넘거나 넘을 때 거래 신호를 생성한다. 구체적으로, 진동기가 EMA 평균선을 넘어서서 둘 사이의 거리가 설정된 마이너스 값보다 크면 더 많이 한다. 진동기가 EMA 평균선을 넘어서서 둘 사이의 거리가 설정된 마이너스 값보다 작으면 더 많이 한다.
위험 관리 방법:
이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.
이 전략은 전체적으로 CCT 변동대 지표에 기반하여 가격 역전을 판단하는 양적 거래 전략이다. 장점이 있지만 개선의 여지가 있습니다. 변수 최적화, 필터 지표의 추가, 기능 엔지니어링의 사용, 기계 학습의 도입 등을 통해 전략의 안정성과 수익성을 더욱 강화 할 수 있습니다.
/*backtest
start: 2023-11-15 00:00:00
end: 2023-11-17 11:00:00
period: 45m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
// This strategy is based on the CCT Bollinger Band Oscillator (CCTBO)
// developed by Steve Karnish of Cedar Creek Trading and coded by LazyBear.
// Indicator is available here https://www.tradingview.com/v/iA4XGCJW/
strategy("Strategy CCTBBO v2 | Fadior", shorttitle="Strategy CCTBBO v2", pyramiding=0, precision=2, calc_on_order_fills=false, initial_capital=1000, default_qty_type=strategy.percent_of_equity, currency="USD", default_qty_value=100, overlay=false)
length_stddev=input(title="Stddev loopback period",defval=20)
length_ema=input(title="EMA period", defval=2)
margin=input(title="Margin", defval=0, type=float, step=0.1)
price = input(title="Source", defval=high)
digits= input(title="Number of digits",defval=2,step=1,minval=2,maxval=6)
offset = input(title="Trailing offset (0.01 = 1%) :", defval=0.013, type=float, step=0.01)
pips= input(title="Offset in ticks ?",defval=false,type=bool)
src=request.security(syminfo.tickerid, "1440", price)
cctbbo=100 * ( src + 2*stdev( src, length_stddev) - sma( src, length_stddev ) ) / ( 4 * stdev( src, length_stddev ) )
ul=hline(150, color=gray, editable=true)
ll=hline(-50, color=gray)
hline(50, color=gray)
fill(ul,ll, color=green, transp=90)
plot(style=line, series=cctbbo, color=blue, linewidth=2)
plot(ema(cctbbo, length_ema), color=red)
d = digits == 2 ? 100 : digits == 3 ? 1000 : digits == 4 ? 10000 : digits == 5 ? 100000 : digits == 6 ? 1000000 : na
TS = 1
TO = pips ? offset : close*offset*d
CQ = 100
TSP = TS
TOP = (TO > 0) ? TO : na
longCondition = crossover(cctbbo, ema(cctbbo, length_ema)) and cctbbo - ema(cctbbo, length_ema) > margin
if (longCondition)
strategy.entry("Long", strategy.long)
strategy.exit("Close Long", "Long", qty_percent=CQ, trail_points=TSP, trail_offset=TOP)
shortCondition = crossunder(cctbbo, ema(cctbbo, length_ema)) and cctbbo - ema(cctbbo, length_ema) < -margin
if (shortCondition)
strategy.entry("Short", strategy.short)
strategy.exit("Close Short", "Short", qty_percent=CQ, trail_points=TSP, trail_offset=TOP)