가격 충격 돌파 전략


생성 날짜: 2023-12-13 14:36:04 마지막으로 수정됨: 2023-12-13 14:36:04
복사: 3 클릭수: 635
avatar of ChaoZhang ChaoZhang
1
집중하다
1621
수행원

가격 충격 돌파 전략

개요

격변투기 전략은 가격의 격변 형태를 이용한 가격의 중요한 지지점이나 저항점을 돌파할 때 거래하는 전략이다. 이 전략은 여러 가지 기술 지표와 결합하여 중요한 거래 기회를 식별한다.

전략 원칙

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

  1. 48일 SMA를 상회하거나 하락할 때 거래 기회를 고려하십시오.

  2. 부린 반도 중간선을 통과한 경우, 입찰 신호로 사용된다.

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

  4. ADX가 25보다 크면 비 트렌드 상황을 필터링합니다.

4가지 조건이 충족되면, 더 많은 일을 하거나, 더 적은 일을 한다.

전략적 이점

이 전략은 추세와 흔들림 지표를 결합한 전략입니다. 주요 장점은 다음과 같습니다.

  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()