
この戦略は,唐通路の長期トレンド追跡戦略に基づいています.これは,唐通路の上線と下線を探して,価格の突破口を見つけ,突破口が発生したときに市場に参入します.同時に,通路の中線をストップラインとして使用して市場から退出します.この戦略は,明らかなトレンドがある市場に適用され,長期トレンドを捕捉して高額な利益を得ることができます.
この策略は20周期の長さの唐通路を使用する.通路の上線は,最近20周期の最高値であり,下線は最近20周期の最低値である.中線のデフォルトの長さは上下線の2倍であり,上下線と同じ長さに設定することもできる.価格が上線を突破すると,多;価格が下線を突破すると,空.価格が中線を突破すると,多を平らにする.価格が中線を突破すると,空を平らにする.
より長い中道長さの使用は,有利なポジションにより大きな動作スペースを与え,市場が傾向にあるときにより高い利益を得ることができます. 実際,上下道の2倍の長さの中道は,ウィルダーの推奨の3倍のATR移動ストップに非常に近いものです.
この戦略の利点は以下の通りです.
この戦略にはいくつかのリスクがあります.
中道長さを適切に短縮したり,他の止損指標と組み合わせたりしてリスクを軽減することができる.また,不要な取引を減らすために入場論理を最適化することもできる.
この戦略は以下の点で最適化できます.
この戦略は,全体として非常に単純な長期トレンド追跡戦略である.これは,トレンドの方向を判断する唐津通路指標を使用して,入場し,中軌道で移動ストップを行う.傾向が顕著な市場で,それはより高い利益を得ることができます.しかし,この戦略には一定のリスクがあり,パラメータとストップロジックを最適化して,より安定した効果を得る必要があります.
/*backtest
start: 2024-01-07 00:00:00
end: 2024-01-14 00:00:00
period: 15m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// Donchian Channels Strategy - Long Term Trend
// by SparkyFlary
//For Educational Purposes
//Results can differ on different markets and can fail at any time. Profit is not guaranteed.
strategy("Donchian Channels Strategy - Long Term Trend", shorttitle="Donchian Channels LT Strategy", overlay=true)
length = input(20, title="Donchian Channel length")
option = input("double", title="Middleband length: regular or double", options=["regular","double"])
upperband = highest(high, length)[1]
lowerband = lowest(low, length)[1]
middlebandLength = option=="double"?length*2:length
middleband = avg(highest(high, middlebandLength)[1], lowest(low, middlebandLength)[1])
//Plots
ubP = plot(upperband, title="Upperband", style=plot.style_line, linewidth=2)
lbP = plot(lowerband, title="Lowerband", style=plot.style_line, linewidth=2)
mbP = plot(middleband, title="Middleband", style=plot.style_line, color=color.maroon, linewidth=2)
//Strategy
buy = close > upperband
sell = close < middleband
short = close < lowerband
cover = close > middleband
strategy.entry(id="enter long", long=true, when=buy)
strategy.close(id="enter long", comment="exit long", when=sell)
strategy.entry(id="enter short", long=false, when=short)
strategy.close(id="enter short", comment="exit short", when=cover)