この戦略は,24周期唐津通路と200周期平均線を組み合わせて主要な取引信号として使用する.入場ポイントは,赤緑の波動を下方選択して空白し,波動上方選択して多めにする.
この戦略は以下の点に 基づいています.
24周期の最高値と最低値を使って唐通路を構成し,価格が通路を突破すると,大きな下落が起こりうることを示す.
200周期平均線は多空フィルター条件として,唐津通路を突破し,価格が平均線の反対側にある場合,トレードが逆転する可能性があると考える.
入口信号は
空白のストップ・ロスは,最近3つのK線の最高値であり,ストップ・プッシュ・価格は,空白の価格と空白の価格の差の3倍分のストップ・ロスを減算する.空白を多めにするストップ・プッシュ・価格の計算方法は,空白と逆である.
この戦略の優点は,唐通路+均線フィルター混合使用により,単一の技術指標の誤導を回避し,戦略の勝利率を大幅に向上させることです.
この戦略の利点は以下の通りです.
勝利率が高い:唐通路と均線指標の混合使用により,単一の技術指標の誤導による不必要な損失を効果的に回避できます.
リスク可控:最近の最高価格/最低価格をストップポイントとして使用し,単一の損失を効果的に制御する.ストップはストップの3倍であり,利益リスクは高い.
操作が簡単です. 指数と論理は非常にシンプルでわかりやすく,理解し,実行しやすいです.
適用性強:策略パラメータが少なく,異なる品種と周期で良好な安定性がある.
この戦略には以下のリスクがあります.
極端な状況のリスク: 巨大な一方的な状況に遭遇した場合,止損を誘発したり,損失を増加させたりする可能性があります. 適切な止損率の緩和,ポジションの減少などの方法で対応できます.
離場信号誤判リスク:新しい反方信号を離場信号として採用し,震動状況で頻繁に出場し,不必要な滑点損失が発生する可能性がある.離場論理を最適化することで解決できる.
パラメータ最適化リスク:唐津通路周期と平均線パラメータの不適切な設定は,信号の頻度または遅延を引き起こす可能性がある.このリスクを,パラメータ最適化と組み合わせテストで軽減することができます.
この戦略は以下の方向から最適化できます.
唐通路周期と均線周期は最適のパラメータ組み合わせを探して最適化することができる.
異なるストップ・ロスト・ストップ・ストップ比率,平衡の勝率および勝負比率をテストできます.
戦略の安定性を高めるために,MACD,KDなどの他の指標修正入場信号と組み合わせて試すことができます.
離場信号を最適化して,震動行情の不必要な出場を避ける。離場信号は,トレンド指標なども考慮できる。
この戦略の枠組みに基づいて,他のチャネル型の指標,リスト型の指標などと組み合わせて新しい戦略の組み合わせを開発できます.
このスロー・均線戦略の全体的な構想は明快で分かりやすく,唐津通路と均線を策略信号として混合して使用することで,戦略の安定性と勝率を効果的に向上させることができる.止損より止損の大きい設定は勝負比を良くし,パラメータ設定はシンプルで容易に実施できる.ある種の極端な状況と誤判のリスクは存在するが,複数の方法で戦略を最適化・改善することができる.非常に強力な拡張性と発展の可能性がある.
/*backtest
start: 2023-11-06 00:00:00
end: 2023-12-06 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Mysteriown
//@version=4
strategy("Lagged Donchian Channel + EMA", overlay = true)
//tradePeriod = time(timeframe.period,"0000-0000:1234567")?true:false
// ------------------------------------------ //
// ----------------- Inputs ----------------- //
// ------------------------------------------ //
period = input(24, title="Channel's periods")
Pema = input(200, title="EMA's periods ?")
ratio = input(3, title="Ratio TP", type=input.float)
loss = input(20, title="Risk Loss ($)")
lev = input(5, title="Leverage *...")
chan = input(title="Plot channel ?", type=input.bool, defval=false)
Bpos = input(title="Plot Bull positions ?", type=input.bool, defval=false)
bpos = input(title="Plot Bear positions ?", type=input.bool, defval=false)
labels = input(title="Plot labels of bets ?", type=input.bool, defval=true)
supp = input(title="Delete last labels ?", type=input.bool, defval=true)
// ------------------------------------------ //
// ---------- Canal, EMA and arrow ---------- //
// ------------------------------------------ //
pema = ema(close,Pema)
plot(pema, title="EMA", color=color.blue)
canalhaut = highest(period)[1]
canalbas = lowest(period)[1]
bear = close[1] > canalhaut[1] and close < open and high > pema
bull = close[1] < canalbas[1] and open < close and low < pema
canalhautplot = plot(chan? canalhaut:na, color=color.yellow)
canalbasplot = plot(chan? canalbas:na, color=color.yellow)
plotshape(bear, title='Bear', style=shape.triangledown, location=location.abovebar, color=color.red, offset=0)
plotshape(bull, title='Bull', style=shape.triangleup, location=location.belowbar, color=color.green, offset=0)
// ------------------------------------------ //
// ------------- Position Short ------------- //
// ------------------------------------------ //
SlShort = highest(3)
BidShort = close[1]
TpShort = BidShort-((SlShort-BidShort)*ratio)
deltaShort = (SlShort-BidShort)/BidShort
betShort = round(loss/(lev*deltaShort)*100)/100
cryptShort = round(betShort*lev/BidShort*1000)/1000
// if bear[1] and labels //and low < low[1]
// Lbear = label.new(bar_index, na, text="SHORT\n\nSL: " + tostring(SlShort) + "\n\nBid: " + tostring(BidShort) + "\n\nTP: " + tostring(TpShort) + "\n\nMise: " + tostring(betShort) + "\n\nCryptos: " + tostring(cryptShort), color=color.red, textcolor=color.white, style=label.style_labeldown, yloc=yloc.abovebar)
// label.delete(supp ? Lbear[1] : na)
var bentry=0.0
var bsl=0.0
var btp=0.0
if bear[1] and low < low[1]
bentry:=BidShort
bsl:=SlShort
btp:=TpShort
pbentry = plot(bpos? bentry:na, color=color.orange)
plot(bpos? (bentry+btp)/2:na, color=color.gray)
pbsl = plot(bpos? bsl:na, color=color.red)
pbtp = plot(bpos? btp:na, color=color.green)
fill(pbentry,pbsl, color.red, transp=70)
fill(pbentry,pbtp, color.green, transp=70)
// ------------------------------------------ //
// ------------- Position Long -------------- //
// ------------------------------------------ //
SlLong = lowest(3)
BidLong = close[1]
TpLong = BidLong + ((BidLong - SlLong) * ratio)
deltaBull = (BidLong - SlLong)/BidLong
betLong = round(loss/(lev*deltaBull)*100)/100
cryptLong = round(betLong*lev/BidLong*1000)/1000
// if bull[1] and labels //and high > high[1]
// Lbull = label.new(bar_index, na, text="LONG\n\nSL: " + tostring(SlLong) + "\n\nBid: " + tostring(BidLong) + "\n\nTP: " + tostring(TpLong) + "\n\nMise: " + tostring(betLong) + "\n\nCryptos: " + tostring(cryptLong), color=color.green, textcolor=color.white, style=label.style_labelup, yloc=yloc.belowbar)
// label.delete(supp ? Lbull[1] : na)
var Bentry=0.0
var Bsl=0.0
var Btp=0.0
if bull[1] and high > high[1]
Bentry:=BidLong
Bsl:=SlLong
Btp:=TpLong
pBentry = plot(Bpos?Bentry:na, color=color.orange)
plot(Bpos?(Bentry+Btp)/2:na, color=color.gray)
pBsl = plot(Bpos?Bsl:na, color=color.red)
pBtp = plot(Bpos?Btp:na, color=color.green)
fill(pBentry,pBsl, color.red, transp=70)
fill(pBentry,pBtp, color.green, transp=70)
// ------------------------------------------ //
// --------------- Strategie ---------------- //
// ------------------------------------------ //
Bear = bear[1] and low < low[1]
Bull = bull[1] and high > high[1]
if (Bear and strategy.opentrades==0)
strategy.order("short", false, 1, limit=BidShort)
strategy.exit("exit", "short", limit = TpShort, stop = SlShort)
strategy.cancel("short", when = high > SlShort or low < (BidShort+TpShort)/2)
strategy.close("short", when=bull)
if (Bull and strategy.opentrades==0)
strategy.order("long", true, 1, limit=BidLong)
strategy.exit("exit", "long", limit = TpLong, stop = SlLong)
strategy.cancel("long", when = low < SlLong or high > (BidLong+TpLong)/2)
strategy.close("long", when=bear)