バンドチャネルに基づくマルチタイムフレーム取引戦略


作成日: 2023-09-20 15:47:46 最終変更日: 2023-09-20 15:47:46
コピー: 0 クリック数: 776
1
フォロー
1621
フォロワー

概要

この戦略は,自己適応波帯通路に基づいて,2つの異なる追跡ストップ・ローズ戦略を設計し,複数の時間枠を体系的に反復検証し,トレンド追跡型の取引戦略に属している.

戦略原則

  1. 波帯通路の上下軌道を計算し,通路幅をパラメータで調整する.

  2. 突破追跡戦略は,価格が通路を突破した後にポジションを開き,通路内に止まる.

  3. 回帰逆転戦略は,価格が通路に到達したときにポジションを開き,価格が通路内に戻ったときにストップする.

  4. CCIの指標は多空線を判断するのに役立つ.

  5. 複数のタイムフレームの反射テストにより,両戦略の有効性が確認されました.

優位分析

  1. 波帯通路はシンプルで直感的で,価格の動向を効果的に捉えます.

  2. この2つの戦略は,異なる市場状況に適応し,安定性を高めます.

  3. CCIの指標は空き地について判断するのに役立ちます.

  4. 複数の時間枠で反省した結果がより説得力があります.

  5. 戦略のルールはシンプルでわかりやすく,実行しやすい.

リスク分析

  1. 波帯通路が機能しなくなる場合

  2. この2つの戦略には,早すぎる,あるいは遅すぎる,停止の危険性があります.

  3. CCI指標は誤った信号を発しているかもしれない.

  4. 測定の誤差は慎重に処理する必要があります.

  5. パラメータの最適化時に過適合がある可能性があります.

最適化の方向

  1. 異なるパラメータをテストし,最適なパラメータの組み合わせを探します.

  2. 他の指標を追加して信号フィルタリングを評価する.

  3. リスクの低減のためのストップ・ローズ戦略を最適化する

  4. 経路の幅を自律的に計算する方法を研究する.

  5. 更に多くの品種と周期で再検査を検証する.

  6. 機械学習による動的最適化パラメータ.

要約する

この戦略は,波帯通路に基づいて2つの追跡・止損戦略を設計し,複数の時間枠の反測検証を行います.パラメータ最適化,止損戦略改善などの方法によって,システムの安定性を強化し,成熟した信頼性の高いトレンド追跡取引システムとして開発することができます.

ストラテジーソースコード
/*backtest
start: 2022-09-13 00:00:00
end: 2023-09-19 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy(title = "Underworld Hunter", overlay=true)

len = input(75, minval=1, title="Length")
src = input(close, title="Source")
basis = 0.0
basis := na(basis[1]) ? sma(src, len) : ema(ema(ema(src,len),len),len)

mult = input(1.9, minval=0.001, maxval=50, title="Deviation")
dev = mult * stdev(src, len)
upper = basis + dev
lower = basis - dev

//CCI calculation and inputs

lengthcci = input(20, minval=1, title="Period for CCI")
ma = sma(close, lengthcci)
ccivalue = (src - ma) / (0.015 * dev(src, lengthcci))

//CCI plotting

cciover0 = ccivalue >= 100 and ccivalue <= 120
cciover1 = ccivalue > 120 and ccivalue <= 140
cciover2 = ccivalue > 140 and ccivalue <= 160
cciover3 = ccivalue > 160 and ccivalue <= 180
cciover4 = ccivalue > 180

cciunder0 = ccivalue <= -100 and ccivalue >= -120
cciunder1 = ccivalue <= -120 and ccivalue > -140
cciunder2 = ccivalue <= -140 and ccivalue > -160
cciunder3 = ccivalue <= -160 and ccivalue > -180
cciunder4 = ccivalue <= -180

plotshape(cciover0, title="CCIO0", location=location.abovebar, color=#c6ff1a, transp=0, style=shape.circle, size=size.tiny)
plotshape(cciunder0, title="CCIU0", location=location.belowbar, color=#c6ff1a, transp=0, style=shape.circle, size=size.tiny)
plotshape(cciover1, title="CCIO1", location=location.abovebar, color=#ffff00, transp=0,style=shape.circle, size=size.tiny)
plotshape(cciunder1, title="CCIU1", location=location.belowbar, color=#ffff00, transp=0, style=shape.circle, size=size.tiny)
plotshape(cciover2, title="CCIO2", location=location.abovebar, color=#ff9900, transp=0, style=shape.circle, size=size.tiny)
plotshape(cciunder2, title="CCIU2", location=location.belowbar, color=#ff9900, transp=0, style=shape.circle, size=size.tiny)
plotshape(cciover3, title="CCIO3", location=location.abovebar, color=#ff0000, transp=0, style=shape.circle, size=size.tiny)
plotshape(cciunder3, title="CCIU3", location=location.belowbar, color=#ff0000, transp=0, style=shape.circle, size=size.tiny)
plotshape(cciover4, title="CCIO4", location=location.abovebar, color=#cc00cc, transp=0,style=shape.circle, size=size.tiny)
plotshape(cciunder4, title="CCIU4", location=location.belowbar, color=#cc00cc, transp=0,style=shape.circle, size=size.tiny)

//plotting

plot(upper, title="Upper shadow", color=color.black, transp = 30, linewidth = 4)
plot(upper, title="Upper line", color=#FF2E00, transp = 0, linewidth = 2)
plot(lower, title="Lower shadow", color=color.black, transp = 30, linewidth = 4)
plot(lower, title="Lower line", color=#FF2E00, transp = 0, linewidth = 2)
plot(basis, title="Basic line", color=color.red, transp = 50, linewidth = 2)

mean = input(title="Test Reverse to the Mean instead", type=input.bool, defval=false)
test = input(title="Enable testing", type=input.bool, defval=true)

ordersize=floor(50000/close)

if(close>upper and strategy.opentrades==0 and not mean and test)
    strategy.entry("Hunt Up", strategy.long, ordersize)
if (close<upper and close[1]<upper and close[2]<upper)
    strategy.close("Hunt Up", qty_percent = 100, comment = "Hunt End")

if(close<lower and strategy.opentrades==0 and not mean and test)
    strategy.entry("Hunt Down", strategy.short, ordersize)
if (close>lower and close[1]>lower and close[2]>lower)
    strategy.close("Hunt Down", qty_percent = 100, comment = "Hunt End")

//bounce of bands

if(close>upper and strategy.opentrades==0 and mean and test)
    strategy.entry("Sneak Down", strategy.short, ordersize)
if (close<upper and close[1]<upper and close[2]<upper and close>high[1])
    strategy.close("Sneak Down", qty_percent = 100, comment = "SneakEnd")

if(close<lower and strategy.opentrades==0 and mean and test)
    strategy.entry("Sneak Up", strategy.long, ordersize)
if (close>lower and close[1]>lower and close[2]>lower and close<low[1])
    strategy.close("Sneak Up", qty_percent = 100, comment = "Sneak End")