
この戦略は,CCI指数に基づくトレンド追跡戦略である.これは,異なる周期の2つのCCI指数を使用して取引シグナルを生成する.具体的には,短期のCCI指数がより長い周期のCCI指数を突破するかどうかを監視し,突破の方向に応じて多額の取引を決定する.
この戦略の核心的な論理は:
具体的には以下の通りです.
具体的には以下の通りです.
この戦略は,短期のCCIの感度と長期のCCIの安定性を利用して,トレンドの識別と追跡を可能にすることが見られます.
この戦略の利点は以下の通りです.
この戦略にはいくつかのリスクがあります.
リスクに対する対処法:
この戦略をさらに改善できる分野は以下の通りです.
この戦略は,全体として,長期および短期のCCI指標の突破に基づいた単純なトレンド追跡戦略である.これは,トレンドの方向を効果的に識別し,トレンドを追跡することができる.同時に,ストップ・ロスなどの手段によってリスクを制御することができる.この戦略は,シンプルで実用的で,パラメータ調整が柔軟であり,量化取引の入門戦略として使用できる.さらに最適化および組み合わせることで,より強力な取引システムを形成することができる.
/*backtest
start: 2023-10-24 00:00:00
end: 2023-11-23 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
strategy(title="my work",calc_on_order_fills=true,currency=currency.USD, default_qty_type=strategy.percent_of_equity,commission_type=strategy.commission.percent)
source = close
shortlength=input(14)
longlength=input(56)
aa=input(2)
Ss=input(75)
//Cci part
ci1=cci(source,shortlength) //4시간봉의 기본 cci
ci2=cci(source,longlength) //4시간봉에서 12시봉의 cci 무빙측정
//오린간 선생님의 WT + ichimoku
len = input(10)
lenTurn = input(9)
lenStd = input(26)
wtm_e(so, l) =>
esa = ema(so, l)
d = ema(abs(so - esa), l)
ci = (so - esa) / (0.015 * d)
ema(ci, l*2+1)
alh(len) => avg(lowest(len), highest(len))
alh_src(src, len) => avg(lowest(src, len), highest(src, len))
wt = wtm_e(close,len)
turn = alh_src(wt, lenTurn)
std = alh_src(wt, lenStd)
cnt = 0
if wt > turn
cnt:=cnt+1
if wt > std
cnt:=cnt+1
//100,-100선
h0 = hline(100)
h1 = hline(-100)
//plot(ci,color=green)
// plot(k,color=green)
// plot(d,color=red)
plot(ci1,color=green)
plot(ci2,color=red)
plot(0,color=black)
plot(100,color=black)
plot(-100,color=black)
fill(h0,h1,color=purple,transp=95)
bgcolor(cnt==0 ? red : cnt==1 ? blue : cnt == 2 ? green : na, transp = Ss)
//기간조정
Fromday = input(defval=1, title="from day", minval=1, maxval=31)
FromMonth = input(defval=1, title="from month", minval=1, maxval=12)
FromYr = input(defval=2019, title="from yr", minval=1970)
Today = input(defval=13, title="to day", minval=1, maxval=31)
ToMonth = input(defval=12, title="to month", minval=1, maxval=12)
ToYr = input(defval=2019, title="to yr", minval=1970)
startDate = timestamp(FromYr, FromMonth, Fromday, 00, 00)
finishDate = timestamp(ToYr, ToMonth, Today, 00, 00)
Time_cond = true
/////롱
if crossover(ci1,ci2) and change(ci2)>0 and Time_cond
strategy.entry("go", strategy.long, comment="go")
strategy.close("go", (ci2<0 and ci1 <-50 and change(ci1)<0) or (crossunder(ci1,-100) and strategy.openprofit<0) and change(cnt)<0)
/////숏
if (crossunder(ci1,ci2) and change(ci2)<0 and falling(ci1,aa)) and Time_cond
strategy.entry("die", strategy.short, comment="die")
strategy.close("die", (ci2>0 and ci1 > 100 and change(ci1)>0) or (crossover(ci2,100) and strategy.openprofit<0) and change(cnt)>0)