複数のテクニカル指標の勢いの突破戦略


作成日: 2023-11-22 15:56:43 最終変更日: 2023-11-22 15:56:43
コピー: 0 クリック数: 629
1
フォロー
1617
フォロワー

複数のテクニカル指標の勢いの突破戦略

概要

この戦略は,複数の技術指標を総合的に考慮し,市場の多頭動力が強いことを判断するときに買い操作を行う.具体的には,戦略は,MACD,RSI,ADX,Stochastic,Brinの5つの指標を同時に考慮し,これらの指標が同時に多頭条件を満たすときに買い信号を生成する.

戦略原則

この戦略の核心的な論理は,市場が多頭動力の強いと判断した後に購入することです.具体的判断ルールは以下の通りです.

  1. 5分,15分と60分 MACDの現在の柱は上昇しています
  2. RSIは60以上です
  3. ADXは12より大きいです.
  4. ストキャスティック %K 線を%D 線に穿越します.
  5. ブルインはを軌道に乗せました

上記の5つの条件が同時に成立すると,市場多頭動力が強いと考えられ,この時に買入操作が行われる.

取引退出ルールは5分閉盘価格を下回る5分EMAを破ると現在のポジションを退出する.

優位分析

この戦略には以下の利点があります.

  1. 複数の指標を統合して,市場の全体的な多角的傾向を判断し,単一の指標に誤って導かれないようにする
  2. 市場動向の持続性を判断するために,高低時間軸の指標の組み合わせを使用する
  3. 退出手続きは厳格で,損失を拡大しないように
  4. 取引頻度が適度で密集しない

概して,この戦略は正確で,リスクは適切に管理され,短線を捕捉するのに適しています.

リスク分析

この戦略にはいくつかのリスクがあります.

  1. 複数の指標の組み合わせによる判断により,入場誤差の確率が増加
  2. 退出メカニズムが厳しすぎて,正しい取引を早めに退出するかもしれない
  3. 取引の頻度が高いため,取引が頻発すると手数料が負担されます.

全体として,この戦略のリスクは,主に入場ミスと早期退出の累積であり,パラメータの最適化と規則の調整によって軽減する必要があります.

最適化の方向

この戦略は以下の方向から最適化できます.

  1. MACDパラメータを最適化して,市場法則に適合するパラメータの組み合わせを見つける
  2. RSIのパラメータを調整して,よりよい超買超売区間を探します.
  3. ストキャスティックのパラメータを最適化して,よりよい交差組合せを見つけます.
  4. ブリン帯のパラメータを調整し,市場変動をより反映させる
  5. 退出メカニズムのルールを最適化または代替することで,誤った退出の可能性を低減する

この戦略は,パラメータとルールの最適化によって,収益性のレベルとリスク管理能力をさらに向上させることができます.

要約する

この戦略は,複数の指標を考慮して市場多頭傾向を判断し,エクジットメカニズムがより厳格である.戦略判断は正確で,ショートラインの動きを捉えることができ,リスク管理もよりよい.パラメータと取引規則の継続的な最適化により,戦略の効果をさらに強化することができる.全体的に,この戦略は,強力な実用性を持っています.

ストラテジーソースコード
/*backtest
start: 2022-11-15 00:00:00
end: 2023-11-21 00:00:00
period: 1d
basePeriod: 1h
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/
// © makarandpatil

// This strategy is for Bank Nifty instrument and for intraday purpose only
// It checks for various indicators and gives a buy signal when all conditions are met 
// Bank Nifty when in momentum gives 100-200 points in spot in 5-15 min which is how long the trade duration should be
// Issues - The custom script as per TradingView Pinescripting has an issue of repaint
// More information on repainting issue in this link - https://www.tradingview.com/pine-script-docs/en/v5/concepts/Repainting.html
// Use the script alert only to get notified, however check all the parameters individually before taking the trade
// Also, please perform a backtesting and deep backtesting of this strategy to see if the strategy gave correct buy signals in the past
// The script is made for testing purposes only and is in beta mode. Please use at own risk.

//@version=5
strategy("BankNifty_Bullish_Intraday", overlay=true, margin_long = 100, margin_short = 100)

// Variables
StochLength = input(14, title="Stochastic Length")
smoothK = input(3, title="%K Smoothing")
smoothD = input(3, title="%D Smoothing")
 
 
//INDICATOR CALCULATIONS
 
// 1. MACD
[macdLine, signalLine, histLine] = ta.macd(close[0],12,26,9)
 
macd5 = request.security(syminfo.tickerid, "5", macdLine)
macd15 = request.security(syminfo.tickerid,"15",macdLine)
macd60 = request.security(syminfo.tickerid,"60",macdLine)
 
// 2. RSI Calculation
xRSI = ta.rsi(close, 14)
 
// 3. ADX calculation
[diplus, diminus, adx] = ta.dmi(14,14)
// plot(adx,color = color.black)
 
// 4. Stochastic Calculation
k = ta.sma(ta.stoch(close, high, low, StochLength), smoothK)
d = ta.sma(k, smoothD)
 
// 5. Bollinger Band calculation
[middle, upper, lower] = ta.bb(close, 20, 2)
 
 
//CONDITIONS
 
// 1. Conditions for MACD
macd5Uptick = macd5[0] > macd5[1]
macd15Uptick = macd15[0] > macd15[1]
macd60Uptick = macd60[0] >= macd60[1]
 
// 2. Condition for xRSI
RSIStrong = xRSI > 60
 
// 3. Condition for ADX
ADXUngali = adx >= 12
 
// 4. Condition for Stochastic
StochPCO = k > d
 
// 5. Condition for Bollinger Band
BBCU = upper > upper [1]
 
//Evaluate the long condition
// longCondition = macd5Uptick and macd15Uptick and RSIStrong and ADXUngali and StochPCO and BBCU
longCondition = macd5Uptick and macd15Uptick and macd60Uptick and RSIStrong and ADXUngali and StochPCO and BBCU
// longCondition = macd5Uptick and macd15Uptick and RSIStrong and ADXUngali and StochPCO and BBCU

if (longCondition)
    strategy.entry("Buy", strategy.long,alert_message = "BankNifty_Buy_Momentum")

shortCondition = close < ta.ema(close,5)
if (shortCondition)
    strategy.entry("BuySquareoff", strategy.short, alert_message = "BankNifty_Closed_Below_5EMA")