PIVOT 최고가와 최저가를 기반으로 한 암호화폐 추세 반전 전략


생성 날짜: 2024-01-12 14:13:36 마지막으로 수정됨: 2024-01-12 14:13:36
복사: 0 클릭수: 691
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

PIVOT 최고가와 최저가를 기반으로 한 암호화폐 추세 반전 전략

개요

이 전략은 PIVOT 고저점과 돌파점을 기반으로 암호화폐의 트렌드 반전을 판단하는 것으로, 돌파점 반전 전략에 속한다. 전략은 먼저 지표의 가장 최근의 기간 동안의 최고 가격과 최저 가격 PIVOT 점을 계산하고, 그 다음 가격이 이러한 핵심 포인트 지점을 돌파한 후 반전이 발생했는지 판단하여 큰 트렌드 변화를 포착한다.

전략 원칙

  1. PIVOT의 높낮이를 계산하는 방법

ta.pivothigh() 와 ta.pivotlow() 함수를 사용하여 최근 특정 바의 최고 가격점과 최저 가격점을 핵심 PIVOT 포인트로 계산한다.

  1. 판별 돌파구

만약 가격이 PIVOT LOWS를 상향으로 돌파하거나 PIVOT HIGHS를 하향으로 돌파한다면, 트렌드가 반전되었다는 판단을 한다.

  1. 필터링 조건을 설정

가격 PIVOT 점보다 어느 정도의 폭을 뚫고 150bar의 종결 가격을 넘어야 함으로써, 주축을 피할 수 있다.

  1. 출전과 출전

구매 조건이 발생하면 더 많은 입장을 하고, 판매 조건이 발생하면 더 많은 상표를 평정한다. 공상 상표 입출구를 판단하는 것과 비슷하다.

우위 분석

  1. PIVOT 점으로 판단하여 큰 트렌드 변화에 민감합니다.
  2. 효과적 필터는 동요의 흐름에 참여하여 동요의 역전 후 입구를 보장합니다.
  3. PIVOT 점의 높낮이를 판단하여 전환 기회를 잡을 수 있습니다.

위험 분석

  1. 대주기적 변동이 전략에 영향을 끼칠 수 있다.
  2. PIVOT 점 길이와 필터 조건은 다른 스펙트럼에 맞게 조정해야 합니다.
  3. 거래소 수수료가 0에 가깝도록 보장해야 합니다. 그렇지 않으면 수익이 큰 영향을 받습니다.

최적화 방향

  1. 다양한 PIVOT 변수 조합을 테스트할 수 있습니다.
  2. 이동식 제약을 추가하여 단편 손실을 제어할 수 있습니다.
  3. 필터링 신호를 판단할 수 있는 다른 지표와 함께

요약하다

이 전략은 전체적으로 안정적이어서 큰 반전을 잡기에 적합하다. 그러나 위험을 통제하고, 변수를 다른 통화에 맞게 조정하는 데 주의를 기울여야 한다. 변수 최적화와 풍력 제어의 기초에 이 전략은 더 좋은 효과를 얻을 수 있다고 믿는다.

전략 소스 코드
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © nkrastins95

//@version=5
strategy("Swing Hi Lo", overlay=true, margin_long=100, margin_short=100)

//-----------------------------------------------------------------------------------------------------------------------//

tf = input.timeframe(title="Timeframe", defval="")

gr="LENGTH LEFT / RIGHT"
leftLenH = input.int(title="Pivot High", defval=10, minval=1, inline="Pivot High",group=gr)
rightLenH = input.int(title="/", defval=10, minval=1, inline="Pivot High",group=gr)
colorH = input(title="", defval=color.red, inline="Pivot High",group=gr)

leftLenL = input.int(title="Pivot Low", defval=10, minval=1, inline="Pivot Low", group=gr)
rightLenL = input.int(title="/", defval=10, minval=1, inline="Pivot Low",group=gr)
colorL = input(title="", defval=color.blue, inline="Pivot Low",group=gr)

//-----------------------------------------------------------------------------------------------------------------------//

pivotHigh(ll, rl) =>
    maxLen = 1000
    float ph = ta.pivothigh(ll, rl)
    int offset = 0
    while offset < maxLen
        if not na(ph[offset])
            break 
        offset := offset + 1
    ph[offset]

pivotLow(ll, rl) =>
    maxLen = 1000
    float pl = ta.pivotlow(ll, rl)
    int offset = 0
    while offset < maxLen
        if not na(pl[offset])
            break 
        offset := offset + 1
    pl[offset]


//-----------------------------------------------------------------------------------------------------------------------//

ph = request.security(syminfo.tickerid, tf, pivotHigh(leftLenH, rightLenH), barmerge.gaps_off, barmerge.lookahead_on)
pl = request.security(syminfo.tickerid, tf, pivotLow(leftLenL, rightLenL), barmerge.gaps_off, barmerge.lookahead_on)

drawLabel(_offset, _pivot, _style, _color) =>
    if not na(_pivot)
        label.new(bar_index[_offset], _pivot, str.tostring(_pivot, format.mintick), style=_style, color=_color, textcolor=#131722)

//-----------------------------------------------------------------------------------------------------------------------//

VWAP = ta.vwap(ohlc4)

longcondition = ta.crossunder(close,pl) and close > close[150]
exitcondition = close > ph

shortcondition = ta.crossover(close,ph) and close < close[150]
covercondition = close < pl

strategy.entry("long", strategy.long, when = longcondition)
strategy.close("long", when = exitcondition)

strategy.entry("Short", strategy.short, when = shortcondition)
strategy.close("Short", when = covercondition)