다중 기술 지표 모멘텀 돌파 전략


생성 날짜: 2023-11-22 15:56:43 마지막으로 수정됨: 2023-11-22 15:56:43
복사: 0 클릭수: 629
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

다중 기술 지표 모멘텀 돌파 전략

개요

이 전략은 여러 가지 기술 지표를 고려하여 시장에 강한 다중 동력이 있다고 판단 할 때 구매 작업을 수행합니다. 구체적으로, 전략은 MACD, RSI, ADX, Stochastic 및 Brin을 포함한 5 개의 지표를 동시에 고려하여 다중 조건이 동시에 충족되면 구매 신호를 생성합니다.

전략 원칙

이 전략의 핵심 논리는 시장에 강한 다중 동력이 있다고 판단한 후에 구매하는 것이다. 구체적인 판단 규칙은 다음과 같다:

  1. 5분, 15분, 60분 MACD의 현재 기둥은 올라갑니다.
  2. RSI가 60보다 크면
  3. ADX는 12보다 크다.
  4. Stochastic %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")