
この戦略は,ドンチアンチャネルと200サイクルSMAを組み合わせたトレンド追跡取引システムである.この戦略は,価格がドンチアンチャネルを突破し,SMAの動きと組み合わせた上下軌道を見ることで,潜在的なオッズや空調の機会を識別する.同時に,この戦略は,チャネルの中央線に基づいたダイナミックストップ・メカニズムを設計し,リスクを制御する.
戦略の中核となるロジックは、次の主要な要素に基づいています。
リスク管理の提案:
信号の最適化:
ストップ・ローズ・オプティマイゼーション
ポジション管理の最適化:
タイム・最適化:
この戦略は,古典的な唐津通路と移動平均指標を組み合わせて,論理的に明確で,リスクが制御可能なトレンド追跡システムを構築している.戦略の主な優点は,信号が明確で,リスク管理が合理的であることにあるが,揺れ動いている市場では,不良なパフォーマンスを発揮することがある.取引量確認を追加し,損失停止機構を最適化し,ダイナミックポジション管理などの方法を導入することによって,戦略には大きな最適化の余地がある.トレーダーは,実況で適用する際にリスク管理をよくし,特定の取引品種と市場環境に応じてターゲットに最適化することを推奨している.
/*backtest
start: 2024-02-21 00:00:00
end: 2024-03-18 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"SOL_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ardhankurniawan
//@version=5
strategy("Donchian Channel Strategy with SMA 200 and Custom SL", overlay=true)
// Parameters
length = 20
smaLength = 200 // Changed SMA to 200
// Calculate Donchian Channel
upper = ta.highest(high, length)
lower = ta.lowest(low, length)
mid = (upper + lower) / 2 // Mid Line
// Calculate SMA 200
sma200 = ta.sma(close, smaLength)
// Plot Donchian Channel, SMA 200, and Mid Line
plot(upper, color=color.green, linewidth=2, title="Upper Line")
plot(lower, color=color.red, linewidth=2, title="Lower Line")
plot(mid, color=color.orange, linewidth=1, title="Mid Line")
plot(sma200, color=color.blue, linewidth=2, title="SMA 200")
// Long and Short logic based on SMA 200
longCondition = upper > ta.highest(upper[1], length) and close > sma200
shortCondition = lower < ta.lowest(lower[1], length) and close < sma200
// Calculate Stop Loss for Long and Short based on new conditions
longSL = mid - 0.45 * (mid - lower) // SL for Long when price crosses down mid line
shortSL = mid + 0.45 * (upper - mid) // SL for Short when price crosses up mid line
// Enter Long or Short position
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// Place Stop Loss
strategy.exit("Exit Long", from_entry="Long", stop=longSL)
strategy.exit("Exit Short", from_entry="Short", stop=shortSL)