ドンチアン運河適応傾向戦略

作者: リン・ハーンチャオチャン, 日付: 2023年10月26日 15:58:52
タグ:

img

概要

この戦略は,ドンチアン・チャネル指標を使用して,トレンド・トレーディングの市場動向を適応的に追跡する.価格がドンチアン・チャネルを突破したときにトレンドを追跡し,価格がチャネルに戻ると損失を削減する.

戦略の論理

  1. 特定の期間の最も高い値と最も低い値を計算してドンチアン運河を形成します.チャネルの中央線は,最も高い値と最も低い値の平均です.

  2. 価格がチャネルの上部帯を超えるとロングポジションを開く.価格が下部帯を超えるとショートポジションを開く.

  3. ストップ・ロスはチャネルの中央線を追跡します. 利益を取ると,チャネルから一定の割合で価格が突破します.

  4. 損失を削減し 価格がチャネルに戻ると ポジションを閉じます

利点分析

  1. 戦略はドンチアンチャネルを利用して トレンド方向を決定し 突破率を迅速に把握します

  2. ストップ・ロスを追跡するチャネルの中間線を使うことで 利益は保護されます

  3. 利潤目標は,ユーザーによって定義された 利潤率によって増幅されます.

  4. konsolide, breakout, pullback などのような異なる市場条件に適応し,ポジションのサイズを柔軟に調整します.

  5. シンプルで明快な取引論理 分かりやすくマスターできます

リスク分析

  1. この戦略は 脱退のみで 統合を効果的に処理できない

  2. 誤った突破信号の危険性があり,検証に必要な他の指標がある.

  3. 誤ったストップ・ロースと取利益設定は,早期終了または不十分な利益につながる可能性があります.

  4. 間違ったチャネル期間設定は,取引信号の正確さに影響します.

  5. 過剰なポジションサイズ化により 市場の変動リスクが拡大します

  6. ロボットに予期せぬ中断が 起こる危険性があります システムの信頼性を確保します

改善の方向性

  1. 音量指標を追加して 偽のブレイクを追うのを避ける

  2. トレンドインジケーターフィルターを増やして 入力信号の精度を向上させる

  3. ダイナミックストップ・ロスト・アンド・テイク・プロフィートのアルゴリズムを最適化

  4. リアルタイム市場状況に基づいて ポジションサイズ戦略を調整する

  5. 夜間調査と市場投入前のデータにより より良いタイミングが 得られます

  6. 最適な組み合わせを見つけるために 異なるパラメータ期間をテストします

  7. オーバーフィッティングを防ぐためにモデル検証を追加します.

結論

一般的には,これはシンプルで実践的な適応傾向の戦略である.トレンドブレイクを迅速に捕捉し,利益を保護するなどの利点がある.また,統合中に非効率性や偽ブレイクによる損失などの欠点もある.将来の改善は,より多くのシグナルフィルタリング,ダイナミックストップ損失/利益を引き取り,より多くの市場状況に適応することを含む.


/*backtest
start: 2022-10-19 00:00:00
end: 2023-10-25 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//Noro
//2020

//@version=4
strategy(title = "Noro's Donchian Strategy", shorttitle = "Donchian str", overlay = true, default_qty_type = strategy.percent_of_equity, initial_capital = 100, default_qty_value = 100, commission_value = 0.1)

//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
tp = input(defval = 10, minval = 1, title = "Take profit")
lotsize = input(100, defval = 100, minval = 1, maxval = 10000, title = "Lot, %")
pclen = input(50, minval = 1, title = "Price Channel Length")
showll = input(true, defval = true, title = "Show lines")
showbg = input(false, defval = false, title = "Show Background")
showof = input(true, defval = true, title = "Show Offset")
fromyear = input(1900, defval = 1900, minval = 1900, maxval = 2100, title = "From Year")
toyear = input(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
frommonth = input(01, defval = 01, minval = 01, maxval = 12, title = "From Month")
tomonth = input(12, defval = 12, minval = 01, maxval = 12, title = "To Month")
fromday = input(01, defval = 01, minval = 01, maxval = 31, title = "From day")
today = input(31, defval = 31, minval = 01, maxval = 31, title = "To day")

//Price Channel
h = highest(high, pclen)
l = lowest(low, pclen)
center = (h + l) / 2
tpl = h * (100 + tp) / 100
tps = l * (100 - tp) / 100

//Lines
tpcol = showll ? color.lime : na
pccol = showll ? color.blue : na
slcol = showll ? color.red : na
offset = showof ? 1 : 0
plot(tpl, offset = offset, color = tpcol, title = "TP Long")
plot(h, offset = offset, color = pccol, title = "Channel High")
plot(center, offset = offset, color = slcol, title = "Cannel Center")
plot(l, offset = offset, color = pccol, title = "Channel Low")
plot(tps, offset = offset, color = tpcol, title = "TP Short")

//Background
size = strategy.position_size
bgcol = showbg == false ? na : size > 0 ? color.lime : size < 0 ? color.red : na
bgcolor(bgcol, transp = 70)

//Trading
truetime = time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)
lot = 0.0
lot := size != size[1] ? strategy.equity / close * lotsize / 100 : lot[1]
mo = 0
mo := strategy.position_size != 0 ? 0 : high >= center and low <= center ? 1 : mo[1]
if h > 0
    strategy.entry("Long", strategy.long, lot, stop = h, when = strategy.position_size <= 0 and needlong and truetime and mo)
    strategy.exit("TP Long", "Long", limit = tpl, stop = center)
    strategy.entry("Short", strategy.short, lot, stop = l, when = strategy.position_size >= 0 and needshort and truetime and mo)
    strategy.exit("TP Short", "Short", limit = tps, stop = center)
if time > timestamp(toyear, tomonth, today, 23, 59)
    strategy.close_all()
    strategy.cancel("Long")
    strategy.cancel("Short")

もっと