パラボリック・ピリオドとボリンジャー・バンドの組み合わせ 移動ストップ・ロスの戦略

作者: リン・ハーンチャオチャン開催日:2024年2月2日11時05分57秒
タグ:

img

概要

この記事では,パラボリック期間の指標とボリンガー帯の指標を組み合わせて移動ストップ損失戦略を設定する定量的な取引戦略を紹介します. 市場のトレンド方向を判断するためにパラボリック期間の線を計算し,ボリンガー帯の上下レールを用いてストップ損失ポジションを動的に設定することで,戦略は利益をロックするために移動ストップ損失を実現します.

戦略原則

まず,この戦略は,現在の市場動向を判断するためにパラボリック指標を使用します.今日の閉盤価格が昨日のパラボリック期間線を超えると,市場は上昇傾向に逆転し,ロングに進む可能性があると考えられます.今日の閉盤価格が期間線を下回ると,市場の見通しは下落し,ショートに進む可能性があります.

第二に,この戦略はボリンジャーバンド指標を組み合わせて動的なストップ損失ポジションを設定する.ボリンジャーバンドの上部レールはオーバーバイトゾーンとして見られ,下部レールはオーバーセールゾーンである.ロングした後,価格がボリンジャーバンドの下部レールの下に下がれば,ストップ損失を閉じる;ショートした後,価格が再び上部レールの上に上昇した場合,ストップ損失を退出する.したがって,ボリンジャーバンドの上部と下部レールは移動するストップ損失ラインになります.

この戦略は,上記の原則を通じて,利益を追跡するために動的なストップ損失メカニズムを設定しながら,市場の方向性を判断することを実現します. これにより,主要なトレンドの上昇と低下を把握することができ,リスクを避けるためにストップ損失を介して利益をロックすることができます.

戦略 の 利点

ストップ・ロスの戦略は,ストップ・ロスの線としてボリンジャー・バンド・インディケーターを使用し,ストップ・ロスの線が価格変動に合わせて移動できるようにする.これは比較的大きな動きでより多くの利益をロックすることができます.また,パラボリック・ペリオド・ラインのみを使用すると比較して,この戦略はボリンジャー・バンド・インディケーターを追加して,過剰購入および過剰販売領域を決定し,より正確にすることができます.

リスク と 解決策

この戦略の主なリスクは,パラボリック指標のトレンドが強くないことである.振動する市場では,価格はパラボリック周期線を数回横断し,戦略の頻繁な但し小規模な収益性のある取引を引き起こす可能性がある.この時点で,取引手数料とスリップコストは大きな割合を占め,戦略の収益性を低下させる可能性がある.

上記のリスクに対処するために,パラボリック周期線の変化度を増やすためにパラメータを調整し,誤判の確率を減らすか,入場タイミングをフィルターするために他の指標を組み合わせることを検討することができます.例えば,不必要な取引を減らすために市場の傾向または振動かどうかを判断するために波動性指標を追加することができます.

戦略の最適化

この戦略は,次の側面で最適化できます.

  1. パラボリック指標のパラメータを最適化して指標の変化率を調整し,誤判の確率を減らす

  2. 他の技術指標のフィルタリングを増加させ,例えば,市場タイプを決定するためにMACD,KDを追加し,振動市場における仲介を避ける

  3. ボリンガーバンドのパラメータを最適化して,バンド幅パラメータを調整して,ボリンガーバンドが価格変化に近い状態に留まるようにします.

  4. 取引量,ポジションなどのボリューム指標を増加させ,偽のブレイクを避けるための判断を助ける

  5. 株式の基本要素を組み合わせて,株の収益戦略を保持する問題を避ける

概要

この戦略は,パラボリックインジケーターで市場トレンドの方向性と強さを判断し,その後ボリンジャーバンドの上下レールを移動ストップ損失ポジションとして利用してストップ損失戦略を設定し,トレンド追跡とリスク管理の組み合わせを達成する.この戦略は,伝統的な固定ストップ損失戦略と比較して,より大きな動きでより高いリターンを達成することができます.パラメータを最適化し,他の補助判断指標を追加することで,戦略の安定性がさらに強化され,不要な取引が減少することができます.


/*backtest
start: 2024-01-02 00:00:00
end: 2024-02-01 00:00:00
period: 3h
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/
// © maxencetajet

//@version=5
strategy("HA_RSI", overlay=true, initial_capital=1000, default_qty_type=strategy.fixed, default_qty_value=0.5, slippage=25)

closeHA = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, close)

useDateFilter = input.bool(true, title="Filter Date Range of Backtest",
     group="Backtest Time Period")
backtestStartDate = input(timestamp("5 June 2022"), 
     title="Start Date", group="Backtest Time Period",
     tooltip="This start date is in the time zone of the exchange " + 
     "where the chart's instrument trades. It doesn't use the time " + 
     "zone of the chart or of your computer.")
backtestEndDate = input(timestamp("5 July 2022"),
     title="End Date", group="Backtest Time Period",
     tooltip="This end date is in the time zone of the exchange " + 
     "where the chart's instrument trades. It doesn't use the time " + 
     "zone of the chart or of your computer.")

inTradeWindow = true

swingHighV = input.int(10, title="Swing High", group="number of past candles")
swingLowV = input.int(10, title="Swing Low", group="number of past candles")

emaV = input.int(200, title="Ema Period", group="EMA")

rsiV = input.int(14, title="RSI Period", group="RSI")

start = input(0.02, group="Parabolic SAR")
increment = input(0.02, group="Parabolic SAR")
maximum = input(0.2, "Max Value", group="Parabolic SAR")

ema = ta.ema(closeHA, emaV)
rsi = ta.rsi(closeHA, rsiV)
SAR = ta.sar(start, increment, maximum)

myColor = SAR < low?color.green:color.red

longcondition = closeHA > ema and rsi > 50 and closeHA[1] > SAR and closeHA[1] < SAR[1] 
shortcondition = closeHA < ema and rsi < 50 and closeHA[1] < SAR and closeHA[1] > SAR[1]

float risk_long = na
float risk_short = na
float stopLoss = na
float entry_price = na
float takeProfit = na

risk_long := risk_long[1]
risk_short := risk_short[1]

swingHigh = ta.highest(closeHA, swingHighV)
swingLow = ta.lowest(closeHA, swingLowV)

if strategy.position_size == 0 and longcondition and inTradeWindow
    risk_long := (close - swingLow) / close
    strategy.entry("long", strategy.long, comment="Buy")
    
if strategy.position_size == 0 and shortcondition and inTradeWindow
    risk_short := (swingHigh - close) / close       
    strategy.entry("short", strategy.short, comment="Sell")
    
if strategy.position_size > 0

    stopLoss := strategy.position_avg_price * (1 - risk_long)
    entry_price := strategy.position_avg_price
    strategy.exit("long exit", "long", stop = stopLoss)
    
if strategy.position_size < 0 

    stopLoss := strategy.position_avg_price * (1 + risk_short)
    entry_price := strategy.position_avg_price
    strategy.exit("short exit", "short", stop = stopLoss)

if closeHA[1] < SAR and close > strategy.position_avg_price
    strategy.close("long", comment="Exit Long")
    
if closeHA[1] > SAR and close < strategy.position_avg_price
    strategy.close("short", comment="Exit Short")

p_ep = plot(entry_price, color=color.new(color.white, 0), linewidth=2, style=plot.style_linebr, title='entry price')
p_sl = plot(stopLoss, color=color.new(color.red, 0), linewidth=2, style=plot.style_linebr, title='stopLoss')
fill(p_sl, p_ep, color.new(color.red, transp=85))

plot(SAR, "ParabolicSAR", style=plot.style_circles, color=myColor, linewidth=1)
plot(ema, color=color.white, linewidth=2, title="EMA")

もっと