ストカスティックオシレーターバンドブレイク戦略

作者: リン・ハーンチャオチャン, 日付: 2023-09-14 15:31:25
タグ:

戦略の論理

ストカスティック・オシレーター・バンド・ブレイクアウト戦略は,ストカスティック・オシレーター・バンドの上下を突破する高速線に基づいて取引を行う.

論理的には

  1. 追溯期間の (例えば7日) 速速ストカスティックオシレーター線を計算する.

  2. 高速線の上下帯を設定する (例: 80 と 20)

  3. 線が上部帯を超えると長引く

  4. 低帯を下に快線が切るとショート

  5. 選択的に信号を逆転します (ロングはショートになり,ショートがロングになります)

サポート/レジスタンスとしてスローストカスティックラインを持つ帯のブレイクアウトは,誤ったブレイクを効果的にフィルタリングすることができます.パラメータは,異なるサイクルに合わせて調整することもできます.

利点

  • シンプルで直感的なルール

  • 過剰購入/過剰売却のストキャスティクス

  • バンド + スローラインフィルター 誤差

リスク

  • 遅れているストカスティックは 機会を逃すかもしれない

  • 市場適応のためにパラメータの最適化が必要です

  • バンド設定は過度な取引を避けるために注意が必要です

概要

ストーカスティック・ブレイクアウト戦略は,高速/遅い線帯のブレイクを使用してトレンド機会をキャピタライズする.よく調整されたパラメータにより,市場リズムを効果的に把握できるが,遅延は重要なリスクである.他の確認指標と組み合わせることで戦略の強度が向上する.


/*backtest
start: 2023-09-06 00:00:00
end: 2023-09-13 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 05/10/2017
// This back testing strategy generates a long trade at the Open of the following 
// bar when the %K line crosses up UpBand line.
// It generates a short trade at the Open of the following bar when the %K line 
// crosses down DownBand line.
//
// You can change long to short in the Input Settings
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title="Strategy Stochastic", shorttitle="Strategy Stochastic")
Length = input(7, minval=1)
DLength = input(3, minval=1)
UpBand = input(20, minval=1)
DownBand = input(80, minval=1)
reverse = input(false, title="Trade reverse")
hline(50, color=black, linestyle=hline.style_dashed)
hline(UpBand, color=red, linestyle=hline.style_solid)
hline(DownBand, color=green, linestyle=hline.style_solid)
vFast = stoch(close, high, low, Length)
vSlow = sma(vFast, DLength)
pos = iff(vFast > UpBand, 1,
	   iff(vFast < DownBand, -1, nz(pos[1], 0))) 
possig = iff(reverse and pos == 1, -1,
          iff(reverse and pos == -1, 1, pos))	   
if (possig == 1) 
    strategy.entry("Long", strategy.long)
if (possig == -1)
    strategy.entry("Short", strategy.short)	   	    
barcolor(possig == -1 ? red: possig == 1 ? green : blue )  
plot(vSlow, color=blue, title="D")
plot(vFast, color=red, title="K")

もっと