더블 섀도우 패턴 반전 전략


생성 날짜: 2023-11-07 17:00:52 마지막으로 수정됨: 2023-11-07 17:00:52
복사: 1 클릭수: 664
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

더블 섀도우 패턴 반전 전략

개요

이중 그림자 형태 반전 전략은 K선 형태에 기반한 짧은 라인 거래 전략이다. 이 전략은 연속적으로 두 개의 K선 형태가 존재하지 않는 그림자 형태를 식별함으로써 가능한 반전 기회를 판단한다. 이 전략의 장점은 간단하고 쉽게 구현할 수 있지만, 동시에 위험도 존재한다. 주의해야 한다.

원칙

이 전략의 핵심 논리는 이중 그림자 형태를 식별하는 것이다. 구체적으로, 전략은 현재 K 선이 오픈 시트값이 최저 가격과, 클로즈 시트값이 최고 가격 과 같은 조건을 충족하는지 여부를 판단한다. 즉, 하향선과 상향선이 없는 이 K 선을 그림자 선이라고 한다. 만약 이전 K 선도 이 조건을 충족한다면, 이중 그림자 형태, 즉, 이중 그림자 형태가 나타난다고 여겨진다.

기술 분석 이론에 따르면, 이 쌍 그림자 형태는 일반적으로 현재의 추세가 곧 반전을 예고한다. K 선의 두 개의 연속적인 가격이 매우 좁은 범위 내에서 변동하기 때문에, 구매자와 판매자의 힘이 균형을 이루고 있음을 나타내고 반전이 가능하다는 것을 예고한다.

이중 그림자 형태를 판단한 후, 전략은 다음 K 선의 시장을 개시할 때 종식 가격에 따라 상장 또는 하위 방향으로 들어간다. 그리고 설정된 바 수 후에 평지 포지션을 종료한다.

장점

  • 전략이 명확하고 이해하기 쉬우며, 형식적 판단이 간단하며, 실행이 쉽다.

  • 이 작품은 고전적인 이중 그림자 반사 형태를 이용한 것으로, 기술 분석에 근거를 두고 있다.

  • 거래비용과 위험을 줄이는 데 도움이 되는 낮은 거래 빈도.

  • 리포트 기능을 추가하여 파라미터를 최적화할 수 있다.

위험

  • 형태적 거래는 역사적인 그래픽 통계 확률에 의존하여 완전히 탈피할 수 없다.

  • 이중 그림자는 반전을 예고하지만, 반전은 반드시 발생하거나 유지되지 않는다.

  • 일정한 정지 간격을 설정하는 것은 빠르게 진행되는 상황을 다루기 어렵습니다.

  • K 라인 1개나 2개만 보시면 너무 급진적인 진출이 될 수 있습니다.

더 나은 생각

  • 트렌드 지표와 결합하여 역동적인 조작을 피할 수 있습니다.

  • 이 경우 Wait for Confirm를 입력하여 역전 확인 신호를 기다립니다.

  • 이윤을 중단하는 것은 ATR의 동적 설정에 따라 결정되는 것이지 고정된 날짜에 따라 결정되는 것이 아닙니다.

  • 어떤 쌍사조 형태가 더 신뢰할 수 있는지에 대한 기계학습이 가능합니다.

요약하다

이중 그림자 역전 전략은 고전적인 형태 거래 개념을 활용하고, 아이디어는 간단하고 직관적이며, 초보자 학습에 적합하며, 로봇의 모듈 중 하나로 사용할 수 있습니다. 그러나 여전히 위험 통제에 주의를 기울여야하며, 진출 타이밍과 정지 방법을 최적화하여 개선할 수 있습니다. 전체적으로 이 전략의 장단점은 상당히 분명하며, 참고할 수 있습니다.

전략 소스 코드
/*backtest
start: 2023-10-30 00:00:00
end: 2023-11-06 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy("No Shadow Candles", overlay=true)

//set inputs
bars_until_close_trade = input(1,"Bars Until Close", minval = 1)
backtest_option = input(true,"Backtest on Twice alert?", bool)

//set conditions
up = close > close[1] and low >= open and high <= close
down = close < close[1] and low >= close and high <= open

up2 = (close > close[1] and low >= open and high <= close) and (close[1] > close[2] and low[1] >= open[1] and high[1] <= close[1])
down2 = (close < close[1] and low >= close and high <= open) and (close[1] < close[2] and low[1] >= close[1] and high[1] <= open[1])

close_trade = barssince(up or down) == bars_until_close_trade
close_trade2 = barssince(up2 or down2) == bars_until_close_trade

//plot indicators
plotshape(up,"Up Marker", shape.triangleup, location.belowbar, color = olive, size = size.tiny, transp = 50)
plotshape(down,"Down Marker", shape.triangledown, location.abovebar, color = orange, size = size.tiny, transp = 50)
plotshape(up2,"Up Twice Marker", shape.triangleup, location.belowbar, color = white, size = size.small)
plotshape(down2,"Down Twice Marker", shape.triangledown, location.abovebar, color = white, size = size.small)
plotshape(close_trade,"Close Trigger", shape.circle, location.belowbar, color = fuchsia, size = size.tiny, transp = 50)
plotshape(close_trade2,"Close Trigger2 (After Twice Alert)", shape.circle, location.belowbar, color = red, size = size.small)

//Strategy Testing


// Component Code Start
// Example usage:
// if testPeriod()
//   strategy.entry("LE", strategy.long)
testStartYear = input(2017, "Backtest Start Year")
testStartMonth = input(01, "Backtest Start Month")
testStartDay = input(2, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)

testStopYear = input(2019, "Backtest Stop Year")
testStopMonth = input(7, "Backtest Stop Month")
testStopDay = input(30, "Backtest Stop Day")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)

// A switch to control background coloring of the test period
testPeriodBackground = input(title="Color Background?", type=bool, defval=true)
testPeriodBackgroundColor = testPeriodBackground and (time >= testPeriodStart) and (time <= testPeriodStop) ? #00FF00 : na
bgcolor(testPeriodBackgroundColor, transp=97)

testPeriod() => true
// Component Code Stop

//Entry and Close settings
if testPeriod() and backtest_option == true
    strategy.entry("up2", true, when = up2, limit = close)
    strategy.close("up2", when = close_trade)

if testPeriod() and backtest_option == false
    strategy.entry("up", true,  when = up, limit = close)
    strategy.close("up", when = close_trade)