
この戦略は,スティーブ・カーニッシュが開発した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)