변동성 돌파구 전략

저자:차오장, 날짜: 2023-12-13 14:36:04
태그:

img

전반적인 설명

변동성 돌파구 전략 (Volatility Breakthrough Strategy) 은 가격이 변동성 패턴의 주요 지지 또는 저항 수준을 넘어서면 구매 및 판매 작전을 수행하는 전략이다. 이 전략은 주요 거래 기회를 식별하기 위해 여러 기술적 지표를 결합합니다.

전략 원칙

이 전략은 주로 볼링거 중간 밴드, 48 일 간 간단한 이동 평균 (SMA), MACD 및 ADX 네 가지 기술 지표에 기반합니다. 구체적인 논리는 다음과 같습니다.

  1. 마감 가격이 48일 SMA 이상 또는 그 이하로 넘어가면 거래 기회를 고려해야 합니다.

  2. 클로징 가격이 볼링거 중부 대역을 넘을 때, 그것은 입시 신호로 사용됩니다.

  3. MACD가 0보다 크거나 0보다 작으면 트렌드 방향을 결정하는 보조 지표로 사용됩니다.

  4. ADX가 25보다 크면 트렌드가 아닌 시장을 필터링할 수 있습니다.

위의 네 가지 조건이 충족되면, 길게 또는 짧게 가십시오.

전략 의 장점

이 전략은 트렌드와 변동성 지표를 결합합니다. 주요 장점은 다음과 같습니다.

  1. 48일 SMA는 지나치게 빈번한 거래와 중장기 트렌드를 차단합니다.

  2. 볼링거 중위 폭 파업은 강력한 스톱 로스 함수와 함께 주요 지원/저항 파업 지점을 포착합니다.

  3. MACD는 주요 트렌드의 방향을 판단하고, 트렌드에 반하는 거래를 피합니다.

  4. ADX는 트렌드가 아닌 시장을 필터링하고 전략의 승률을 향상시킵니다.

요약하자면, 이 전략은 거래 주파수를 제어하고, 핵심 포인트를 파악하고, 트렌드 방향을 결정하고, 유효하지 않은 움직임을 필터링하는 데 최적화되어 상대적으로 높은 승률을 가지고 있습니다.

전략 의 위험

이 전략의 주요 위험은 다음과 같습니다.

  1. 변동성 있는 시장에서 볼링거 미들밴드는 너무 많은 거래 기회를 유발할 수 있고, 거래가 과도하게 될 수 있습니다.

  2. ADX 지표는 추세와 유효하지 않은 움직임을 결정하는 일부 오류를 가지고 있습니다.

  3. 상대적으로 큰 적립 위험, 특정 수준의 위험을 감당할 수 있는 투자자에게 적합합니다.

최적화 방향

이 전략은 다음과 같은 측면에서 더 이상 최적화 될 수 있습니다.

  1. ATR 표시기를 추가하여 스톱 손실 포인트를 설정하고 스톱 손실 당 줄이십시오.

  2. 중간 라인 트리거 빈도를 줄이기 위해 볼링거 매개 변수를 최적화합니다.

  3. 트렌드의 강도를 결정하기 위해 거래량 또는 트렌드 강도 지표를 추가하여 약한 반전 거래를 피합니다.

요약

요약하자면, 이 변동성 돌파구 전략은 전체적으로 상대적으로 성숙하여 변동성 시장의 주요 거래 지점을 효과적으로 포착합니다. 트렌드 및 변동성 지표를 결합하여 위험과 수익 사이의 균형을 맞추고 있습니다. 추가 최적화로 더 안정적인 초과 수익을 얻을 것으로 예상됩니다.


/*backtest
start: 2023-12-11 00:00:00
end: 2023-12-12 00:00:00
period: 10m
basePeriod: 1m
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/
// © 03.freeman
//Volatility Traders Minds Strategy (VTM Strategy)
//I found this startegy on internet, with a video explaingin how it works.
//Conditions for entry:
//1 - Candles must to be above or bellow the 48 MA (Yellow line)
//2 - Candles must to break the middle of bollinger bands
//3 - Macd must to be above or bellow zero level;
//4 - ADX must to be above 25 level
//@version=4
strategy("Volatility Traders Minds Strategy (VTM Strategy)", shorttitle="VTM",overlay=true)
source = input(close)
//MA
ma48 = sma(source,48)
//MACD
fastLength = input(12)
slowlength = input(26)
MACDLength = input(9)

MACD = ema(source, fastLength) - ema(source, slowlength)
aMACD = ema(MACD, MACDLength)
delta = MACD - aMACD

//BB

length = input(20, minval=1)
mult = input(2.0, minval=0.001, maxval=50)

basis = sma(source, length)
dev = mult * stdev(source, length)

upper = basis + dev
lower = basis - dev

//ADX
adxThreshold = input(title="ADX Threshold", type=input.integer, defval=25, minval=1)
adxlen = input(14, title="ADX Smoothing")
dilen = input(14, title="DI Length")
dirmov(len) =>
	up = change(high)
	down = -change(low)
	plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
    minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
	truerange = rma(tr, len)
	plus = fixnan(100 * rma(plusDM, len) / truerange)
	minus = fixnan(100 * rma(minusDM, len) / truerange)
	[plus, minus]

adx(dilen, adxlen) =>
	[plus, minus] = dirmov(dilen)
	sum = plus + minus
	adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)

sig = adx(dilen, adxlen)

//  Strategy: (Thanks to JayRogers)
// === STRATEGY RELATED INPUTS ===
//tradeInvert     = input(defval = false, title = "Invert Trade Direction?")
// the risk management inputs
inpTakeProfit   = input(defval = 0, title = "Take Profit Points", minval = 0)
inpStopLoss     = input(defval = 0, title = "Stop Loss Points", minval = 0)
inpTrailStop    = input(defval = 0, title = "Trailing Stop Loss Points", minval = 0)
inpTrailOffset  = input(defval = 0, title = "Trailing Stop Loss Offset Points", minval = 0)

// === RISK MANAGEMENT VALUE PREP ===
// if an input is less than 1, assuming not wanted so we assign 'na' value to disable it.
useTakeProfit   = inpTakeProfit  >= 1 ? inpTakeProfit  : na
useStopLoss     = inpStopLoss    >= 1 ? inpStopLoss    : na
useTrailStop    = inpTrailStop   >= 1 ? inpTrailStop   : na
useTrailOffset  = inpTrailOffset >= 1 ? inpTrailOffset : na

// === STRATEGY - LONG POSITION EXECUTION ===
enterLong() => close>ma48 and close>basis and delta>0 and sig>adxThreshold  // functions can be used to wrap up and work out complex conditions
//exitLong() => jaw>teeth or jaw>lips or teeth>lips
strategy.entry(id = "Buy", long = true, when = enterLong() )    // use function or simple condition to decide when to get in
//strategy.close(id = "Buy", when = exitLong() )                  // ...and when to get out

// === STRATEGY - SHORT POSITION EXECUTION ===
enterShort() => close<ma48 and close<basis and delta<0 and sig>adxThreshold
//exitShort() => jaw<teeth or jaw<lips or teeth<lips
strategy.entry(id = "Sell", long = false, when = enterShort())
//strategy.close(id = "Sell", when = exitShort() )

// === STRATEGY RISK MANAGEMENT EXECUTION ===
// finally, make use of all the earlier values we got prepped
strategy.exit("Exit Buy", from_entry = "Buy", profit = useTakeProfit, loss = useStopLoss, trail_points = useTrailStop, trail_offset = useTrailOffset)
strategy.exit("Exit Sell", from_entry = "Sell", profit = useTakeProfit, loss = useStopLoss, trail_points = useTrailStop, trail_offset = useTrailOffset)

// === Backtesting Dates === thanks to Trost

testPeriodSwitch = input(false, "Custom Backtesting Dates")
testStartYear = input(2020, "Backtest Start Year")
testStartMonth = input(1, "Backtest Start Month")
testStartDay = input(1, "Backtest Start Day")
testStartHour = input(0, "Backtest Start Hour")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,testStartHour,0)
testStopYear = input(2020, "Backtest Stop Year")
testStopMonth = input(12, "Backtest Stop Month")
testStopDay = input(31, "Backtest Stop Day")
testStopHour = input(23, "Backtest Stop Hour")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,testStopHour,0)
testPeriod() =>
    time >= testPeriodStart and time <= testPeriodStop ? true : false
isPeriod = testPeriodSwitch == true ? testPeriod() : true
// === /END

if not isPeriod
    strategy.cancel_all()
    strategy.close_all()

더 많은