価格ボリュームブレイクアウト購入戦略

SMA
作成日: 2024-05-17 14:54:13 最終変更日: 2024-05-17 14:54:13
コピー: 2 クリック数: 730
1
フォロー
1617
フォロワー

価格ボリュームブレイクアウト購入戦略

概要

“価格突破買取戦略”は,指定されたグラフ範囲で同時に価格と取引量の突破が起こるのを検出することによって買取機会を識別することを目的とした取引戦略である.この戦略は,まず,価格と取引量のチェックウィンドウとして特定の数の線を使用する.これらの値は,突破条件を識別するために基準として使用される.

戦略原則

  1. チェックウィンドウとして価格突破周期と取引量突破周期を設定します.
  2. 価格の突破期間の最高値と最低値を取得する.
  3. 取引量突破期間の最高取引量を取得する.
  4. 閉店価格が前期最高価格より高く,取引量が前期最高取引量より高く,閉店価格がトレンドライン長さのSMAより高く,現在開場取引がなく,注文方向が空白でないと設定されている場合,多額の取引を開始します.
  5. トレンドラインの長さ以下で5日間連続でSMAを閉じた場合,すべての多頭ポジションを平らにする.
  6. 閉盤価格が前期の最低価格より低く,取引量は前期の最高取引量より高く,閉盤価格がトレンドラインの長さのSMAより低く,現在開口取引がなく,注文方向設定が多すぎない場合,空白を開始します.
  7. 5日連続でトレンドラインの長さより高い終止価格のSMAがあれば,すべての空頭ポジションを平らにする.

戦略的優位性

  1. また,価格と取引量の突破を買い買い信号として使用することで,トレンドの転換をよりよく確認できます.
  2. ポジションを開く前に,取引が主要市場のトレンドに合致していることを確認するために,価格が長期SMAより高くまたは低いかどうかをチェックします.
  3. SMAを横断した連続した多日間の閉店価格を平仓の信号として設定することで,トレンドの終わりを効果的に捉えることができます.
  4. ビットコインやイーサリアムなどの高波動性資産は,市場の突然の価格や取引量の変化を利用して利益を得ることができます.

戦略リスク

  1. 市場波動が小さい場合や,明らかなトレンドがない場合,この戦略は,取引の頻度を高め,取引コストを増加させる可能性があります.
  2. S&P500のような波動性少ない市場では,この戦略の効果は暗号通貨市場ではそれほど顕著ではないかもしれません.
  3. この戦略は,ほとんどの取引がより長い保有期間の傾向にあるため,より高い時間枠で取引信号を少なくする可能性があります.

戦略最適化の方向性

  1. 異なる市場特性に応じて,価格突破周期と取引量突破周期の長さを,異なる資産の変動特性に合わせたように調整する.
  2. 傾向判断の正確さを高めるために,指数移動平均,MACDなどの他の傾向確認指標を使用してみてください.
  3. 戦略にリスク管理措置を組み込む.例えば,ストップ・ロスの設定,ポジションの動的な調整など.単一取引のリスクのを減らす.
  4. 持久期間が長い取引では,既得利益をより保護するために,移動停止戦略を導入することを検討することができます.

要約する

“価格突破買取戦略”は,価格と取引量の突破を同時に考慮し,長期のSMAをトレンドフィルターとして組み合わせることで,強い状況での取引機会をより良く捕捉することができる.しかし,この戦略は,トレンドが目立たないまたは波動が少ない市場ではうまく機能しない可能性があり,頻繁に取引されるリスクがあります.したがって,実際のアプリケーションでは,異なる市場特性と個人の取引スタイルに応じて,この戦略を適切に最適化して調整して,安定性と収益性を高める必要があります.

ストラテジーソースコード
/*backtest
start: 2023-05-11 00:00:00
end: 2024-05-16 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tradedots

//@version=5
strategy("Price and Volume Breakout Buy Strategy [TradeDots]", overlay=true, initial_capital = 10000, default_qty_type = strategy.percent_of_equity, default_qty_value = 70, commission_type = strategy.commission.percent, commission_value = 0.01)

input_price_breakout_period = input.int(60, "Price Breakout Period")
input_volume_breakout_period = input.int(60, "Volume Breakout Period")
input_trendline_legnth = input.int(200, "Trendline Length")
input_order_direction = input.string("Long", options = ["Long", "Short", "Long and Short"], title = "Order Direction")

price_highest = ta.highest(input_price_breakout_period)
price_lowest = ta.lowest(input_price_breakout_period)
volume_highest = ta.highest(volume, input_volume_breakout_period)

// Long Orders
if close > price_highest[1] and volume > volume_highest[1] and close > ta.sma(close, input_trendline_legnth) and strategy.opentrades == 0 and input_order_direction != "Short"
    strategy.entry("Long", strategy.long)
    // line.new(bar_index[input_price_breakout_period], price_highest[1], bar_index, price_highest[1], color = #9cff87, width = 2)
    // label.new(bar_index,low, "🟢 Breakout Buy", style = label.style_label_up, color = #9cff87)

// Close when price is below moving average for 5 consecutive days
if close < ta.sma(close, input_trendline_legnth) and close[1] < ta.sma(close, input_trendline_legnth) and close[2] < ta.sma(close, input_trendline_legnth) and close[3] < ta.sma(close, input_trendline_legnth) and close[4] < ta.sma(close, input_trendline_legnth) and strategy.opentrades.size(strategy.opentrades - 1) > 0
    strategy.close("Long")
    // label.new(bar_index, high, "🔴 Close Position", style = label.style_label_down, color = #f9396a, textcolor = color.white)

// Short Orders
if close < price_lowest[1] and volume > volume_highest[1] and close < ta.sma(close, input_trendline_legnth) and strategy.opentrades == 0 and input_order_direction != "Long"
    strategy.entry("Short", strategy.short)
    // line.new(bar_index[input_price_breakout_period], price_lowest[1], bar_index, price_lowest[1], color = #f9396a, width = 2)
    // label.new(bar_index,high , "🔴 Breakout Sell", style = label.style_label_down, color = #f9396a, textcolor = color.white)

// Close when price is above moving average for 5 consecutive days
if close > ta.sma(close, input_trendline_legnth) and close[1] > ta.sma(close, input_trendline_legnth) and close[2] > ta.sma(close, input_trendline_legnth) and close[3] > ta.sma(close, input_trendline_legnth) and close[4] > ta.sma(close, input_trendline_legnth) and strategy.opentrades.size(strategy.opentrades - 1) < 0
    strategy.close("Short")
    // label.new(bar_index, low, "🟢 Close Position", style = label.style_label_up, color = #9cff87)

plot(ta.sma(close, input_trendline_legnth), color = color.white, linewidth = 2)
plotcandle(open, high, low, close, title='Candles', color = (close > ta.sma(close, input_trendline_legnth) ? #9cff87 : #f9396a), wickcolor=(close > ta.sma(close, input_trendline_legnth) ? #9cff87 : #f9396a), force_overlay = true)