여러 가지 기술 지표 모멘텀 브레이크업 전략

저자:차오장, 날짜: 2023-11-22 15:56:43
태그:

img

전반적인 설명

이 전략은 여러 가지 기술 지표를 포괄적으로 고려하고 시장이 강한 상승 동력을 가지고 있다고 판단될 때 긴 지위를 취합니다. 구체적으로,이 전략은 MACD, RSI, ADX, 스토카스틱 및 볼린거 밴드 (STOCHAStic and Bollinger Band) 이 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")


더 많은