ウェイのボリンジャーバンド取引戦略


作成日: 2023-09-13 13:55:24 最終変更日: 2023-09-13 13:55:24
コピー: 2 クリック数: 942
1
フォロー
1617
フォロワー

この戦略は,ウェイスター波の指標とブリン帯の指標を融合し,市場のトレンド方向を判断し,重要なSUPORT位でブレイク取引を行う.これは典型的なトレンドブレイク戦略である.

戦略の原則:

  1. ウェイスター波を計算し,柱状図の動きから価格傾向を判断する.

  2. ブリン帯は軌道上下を計算し,価格が軌道突破したときに場に入ります.

  3. ウェイス波が多頭トレンドを示し,ブリンが軌道に乗った時,価格が突破する.

  4. ウェイス波が空頭トレンドを示し,価格がブリン帯下位軌道に突破すると空白する.

  5. 逆走勢の発生時にストップ・ストップ・損失を設定し,出場内ポジションを設定する.

この戦略の利点は

  1. ウェイスター波の指標は,主要トレンドの方向を効果的に判断する.

  2. ブリン帯は,重要なSUPORT抵抗点を発見する.

  3. 組み合わせた指標を用いて判断の正確さを向上させることができる.

この戦略のリスクは

  1. ウェイス・ウェーブとブリン・ベンドは,遅滞の問題を抱えており,入場ポイントは不十分である.

  2. 突破取引は容易で,ストップダメージ保護が必要である.

  3. 震災の状況の中で,継続的な傾向や明確な突破点を見出すのは困難です.

要するに,この戦略はウェイスター波とブリン帯を組み合わせて,トレンドの方向を判断し,重要なポイントで突破取引を行う.

ストラテジーソースコード
/*backtest
start: 2023-08-13 00:00:00
end: 2023-09-12 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/
// © sharatgbhat

//@version=4
// strategy("Weis BB Strategy", overlay=false, default_qty_type = strategy.percent_of_equity, default_qty_value = 10,max_lines_count = 500, max_labels_count = 500)
maxIdLossPcnt = input(1, "Max Intraday Loss(%)", type=input.float)
// strategy.risk.max_intraday_loss(maxIdLossPcnt, strategy.percent_of_equity)

method = input(defval="ATR", options=["ATR", "Traditional", "Part of Price"], title="Renko Assignment Method")
methodvalue = input(defval=14.0, type=input.float, minval=0, title="Value")
pricesource = input(defval="Close", options=["Close", "Open / Close", "High / Low"], title="Price Source")
useClose = pricesource == "Close"
useOpenClose = pricesource == "Open / Close" or useClose
useTrueRange = input(defval="Auto", options=["Always", "Auto", "Never"], title="Use True Range instead of Volume")
isOscillating = input(defval=false, type=input.bool, title="Oscillating")
normalize = input(defval=false, type=input.bool, title="Normalize")
vol = useTrueRange == "Always" or useTrueRange == "Auto" and na(volume) ? tr : volume
op = useClose ? close : open
hi = useOpenClose ? close >= op ? close : op : high
lo = useOpenClose ? close <= op ? close : op : low

if method == "ATR"
    methodvalue := atr(round(methodvalue))
if method == "Part of Price"
    methodvalue := close / methodvalue

currclose = float(na)
prevclose = nz(currclose[1])
prevhigh = prevclose + methodvalue
prevlow = prevclose - methodvalue
currclose := hi > prevhigh ? hi : lo < prevlow ? lo : prevclose

direction = int(na)
direction := currclose > prevclose ? 1 : currclose < prevclose ? -1 : nz(direction[1])
directionHasChanged = change(direction) != 0
directionIsUp = direction > 0
directionIsDown = direction < 0

barcount = 1
barcount := not directionHasChanged and normalize ? barcount[1] + barcount : barcount
vol := not directionHasChanged ? vol[1] + vol : vol
res = barcount > 1 ? vol / barcount : vol

plot(isOscillating and directionIsDown ? -res : res, style=plot.style_columns, color=directionIsUp ? color.green : color.red, transp=75, linewidth=3, title="Wave Volume")

length = input(14, minval=1)
src = input(close, title="Source")
mult = input(2, minval=0.001, maxval=50, title="StdDev")
basis = sma(src, length)
dev = mult * stdev(src, length)
upper = basis + dev
lower = basis - dev
offset = input(0, "Offset", type = input.integer, minval = -500, maxval = 500)
plot(basis, "Basis", color=#FF6D00, offset = offset)
p1 = plot(upper, "Upper", color=#2962FF, offset = offset)
p2 = plot(lower, "Lower", color=#2962FF, offset = offset)
fill(p1, p2, title = "Background", color=color.rgb(33, 150, 243, 95))

MomentumBull = close>upper
MomentumBear = close<lower

if (MomentumBull and directionIsUp)
	strategy.entry("Buy", strategy.long)
if (MomentumBear and directionIsDown)
	strategy.entry("Sell", strategy.short)
    strategy.exit("exit","Buy",when=directionIsDown,qty_percent=100,profit=20,loss=10)
    strategy.exit("exit","Sell",when=directionIsUp,qty_percent=100,profit=20,loss=10)