멀티레벨 하락 ATH 동적 추적 3단계 매수 전략

ATH DCA
생성 날짜: 2024-12-20 14:53:04 마지막으로 수정됨: 2024-12-20 14:53:04
복사: 0 클릭수: 372
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

멀티레벨 하락 ATH 동적 추적 3단계 매수 전략

개요

이것은 역사 최고 가격 (ATH) 의 움직임을 추적하는 다단계 구매 전략이다. 전략은 ATH에서 가격의 회수폭을 모니터링하여, 다양한 하락 수준에서 대량으로 구매 작업을 수행하고, ATH에 가까운 가격에 모든 것을 판매하여 이익을 얻습니다. 이 전략은 시장의 변동성을 최대한 활용하여 체계적인 대량 매장 방식을 통해 전체 매장 비용을 절감합니다.

전략 원칙

전략의 핵심 논리에는 다음과 같은 핵심 요소가 포함됩니다.

  1. 동적 ATH 추적: 사상 최고치를 지속적으로 업데이트하고 새로운 최고치를 돌파할 때 구매 표시를 다시 설정합니다.
  2. 3단계 하락 트리거: 구매 지점을 각각 10%, 15%, 20%의 인하 지점으로 설정
  3. 고정자금 관리: 매번 구매할 때 동일한 금액을 사용한다 (~$1000)
  4. 청산 메커니즘 철회: ATH 5% 범위에서 가격이 회복되면 모든 포지션을 청산합니다. 전략은 이러한 점진적인 포지션 구축 방식을 통해 하락 과정에서 평균 포지션 보유 비용을 점진적으로 낮추고, 시장이 반발할 때 통일 평점 포지션을 통해 수익을 잠금합니다.

전략적 이점

  1. 위험 분산: 시간적 선택의 위험을 줄여서
  2. 비용 최적화: 평균 지분 비용을 낮추기 위해 더 큰 회귀를 활용하십시오
  3. 트렌드 추적: 동적 업데이트 ATH는 상승 추세에서 지속적인 운영을 보장합니다.
  4. 자금 효율성: 고정 자금 분배는 자금 사용의 통제성을 보장합니다.
  5. 자동화 실행: 명확한 입출장 조건이 체계화 된 작업을 용이하게 한다

전략적 위험

  1. 추세 역전 위험: 장기 하향 추세에서 연속적인 포획이 발생할 수 있습니다.
  2. 자금 소모 위험: 급격한 변동 시장에서 사용 가능한 자금이 빠르게 소모될 수 있습니다.
  3. 기회를 놓치는 위험: 엄격한 구매 조건으로 인해 좋은 기회를 놓칠 수 있습니다.
  4. 평형상시 위험: 통일된 평형상시 조건은 모든 시장 환경에 적합하지 않을 수 있습니다. 최대 인출 제한과 전체 포지션 통제를 설정하여 이러한 위험을 관리하는 것이 좋습니다.

전략 최적화 방향

  1. 트렌드 필터를 도입: 전체 트렌드를 확인하기 위해 평균선이나 동력 지표를 추가
  2. 자금 관리를 최적화: 변동율에 따라 매번 구매하는 자금의 양을 동적으로 조정합니다.
  3. 평형 메커니즘 개선: 단일 가격 평형의 위험을 피하기 위해 수량 평형 옵션을 추가하십시오.
  4. 스톱 메커니즘을 추가: 최대 위험을 제어하기 위해 절대 스톱 지점을 설정
  5. 동적 변수 최적화: 다른 시장 주기에 따라 자동으로 구매 계층을 조정

요약하다

이 전략은 체계화된 분량 포지션 구축과 통일 평점 메커니즘을 통해 시장의 변동성을 잘 활용한다. 전략의 성공적인 운영은 시장이 충분한 변동성과 최종 상승 추세에 의존한다. 합리적인 위험 제어와 매개 변수 최적화를 통해 전략은 다양한 시장 환경에서 안정적인 성능을 유지할 수 있다.

전략 소스 코드
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-18 08:00:00
period: 1d
basePeriod: 1d
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/
// © bsticks22

//@version=6

strategy("Long-term Bean Dip (v.1)", overlay=true)

// === Inputs ===
dip1 = input.float(10.0, "First Dip (%)", step=0.1)       // 10%
dip2 = input.float(15.0, "Second Dip (%)", step=0.1)      // 15%
dip3 = input.float(20.0, "Third Dip (%)", step=0.1)       // 20%
recovery_threshold = input.float(5.0, "Sell when within X% of ATH", step=0.1) // 5%
buy_amount = input.float(50000.0, "Buy Amount ($)", step=100) // $1000 increments

// === Variables ===
var float all_time_high = na
var bool dip1_bought = false
var bool dip2_bought = false
var bool dip3_bought = false

// === Update All-Time High ===
if na(all_time_high)
    all_time_high := high
else
    // Update ATH to the previous bar's high to exclude current bar's high
    all_time_high := math.max(all_time_high[1], high[1])
    if high[1] > all_time_high[1]
        // New ATH reached on the previous bar
        dip1_bought := false
        dip2_bought := false
        dip3_bought := false

// === Calculate Percentage Drop from ATH ===
percent_drop = (all_time_high - close) / all_time_high * 100.0

// === Define Dip Conditions ===
buyDip1 = (percent_drop >= dip1) and not dip1_bought
buyDip2 = (percent_drop >= dip2) and not dip2_bought
buyDip3 = (percent_drop >= dip3) and not dip3_bought

// === Calculate Quantity to Buy ===
qty1 = buy_amount / close

// === Execute Buys on Dips ===
if buyDip1
    strategy.entry("Dip1 Buy", strategy.long, qty=qty1)
    dip1_bought := true

if buyDip2
    strategy.entry("Dip2 Buy", strategy.long, qty=qty1)
    dip2_bought := true

if buyDip3
    strategy.entry("Dip3 Buy", strategy.long, qty=qty1)
    dip3_bought := true

// === Sell Condition: Recovery to Within X% of ATH ===
sell_condition = close >= all_time_high * (1 - recovery_threshold / 100.0)

// === Execute Sell on Recovery ===
if sell_condition and strategy.position_size > 0
    strategy.close_all()

// === Plotting ===
plot(all_time_high, title="All-Time High", color=color.new(color.blue, 0))
plot(all_time_high * (1 - dip1 / 100.0), title="Dip1 Level", color=color.new(color.green, 50), style=plot.style_linebr)
plot(all_time_high * (1 - dip2 / 100.0), title="Dip2 Level", color=color.new(color.orange, 50), style=plot.style_linebr)
plot(all_time_high * (1 - dip3 / 100.0), title="Dip3 Level", color=color.new(color.red, 50), style=plot.style_linebr)
plot(all_time_high * (1 - recovery_threshold / 100.0), title="Recovery Level", color=color.new(color.purple, 50), style=plot.style_linebr)

// === Plot Buy and Sell Signals ===
plotshape(buyDip1, title="Dip1 Buy", location=location.belowbar, color=color.green, style=shape.labelup, text="Buy10%")
plotshape(buyDip2, title="Dip2 Buy", location=location.belowbar, color=color.orange, style=shape.labelup, text="Buy15%")
plotshape(buyDip3, title="Dip3 Buy", location=location.belowbar, color=color.red, style=shape.labelup, text="Buy20%")
plotshape(sell_condition and strategy.position_size > 0, title="Sell", location=location.abovebar, color=color.purple, style=shape.labeldown, text="Sell")

// === Alerts ===
alertcondition(buyDip1, title="Dip1 Buy", message="Price dipped 10% from ATH, buying $1000")
alertcondition(buyDip2, title="Dip2 Buy", message="Price dipped 15% from ATH, buying $1000")
alertcondition(buyDip3, title="Dip3 Buy", message="Price dipped 20% from ATH, buying $1000")
alertcondition(sell_condition and strategy.position_size > 0, title="Sell at Recovery", message="Price recovered to within 5% of ATH, selling all")