정기적으로 암호화폐를 구매하는 전략


생성 날짜: 2024-01-08 17:05:10 마지막으로 수정됨: 2024-01-08 17:05:10
복사: 2 클릭수: 613
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

정기적으로 암호화폐를 구매하는 전략

개요

순수 보유 전략은 정기적으로 암호화폐를 구매하는 전략으로, 반복적으로 암호화폐를 구매하고 보유함으로써 자산가치를 달성한다. 이 전략은 주로 주기적으로 구매 신호, 보유 신호 및 퇴출 신호의 세 가지 주요 구성 요소를 포함한다.

전략 원칙

이 전략의 기본 논리는 다음과 같습니다.

  1. 시작시 구매 신호를 보내서 첫 구매를 합니다.

  2. 매번 한 번씩 구매 신호를 보내서 더 많은 베이스 화폐를 쿼트 화폐로 구매하십시오.

  3. 카운트가 기본값에 도달했을 때, 탈퇴 지시가 발송되고, 포지션이 청산된다.

  4. 탈퇴 시간이 왔을 때, 탈퇴 신호를 보내고, 전략을 중지하고, 모든 포지션을 청산하십시오.

반복적으로 암호화폐를 구매하고 보유함으로써 비용 평균과 지속적인 보유 효과를 달성할 수 있다.

우위 분석

이 전략은 다음과 같은 장점을 가지고 있습니다.

  1. 암호화폐를 정기적으로 구매할 수 있고, 구매시간의 위험을 줄일 수 있다.

  2. 반복 구매를 통해 암호화폐의 평균 보유비용을 낮출 수 있다.

  3. 포트폴리오의 성장 수익은 지속적으로 포트폴리오를 보유함으로써 얻을 수 있습니다.

  4. 구매 및 퇴출 시간을 사용자 정의하고 자동화 작업을 수행할 수 있습니다.

  5. 사용법도 간단하고 익히기 쉽다.

위험 분석

이 전략에는 다음과 같은 위험도 있습니다.

  1. 암호화폐 시장의 시스템적 위험, 가격의 큰 변동이 발생할 수 있다.

  2. 잘못된 출력으로 인해 손실을 막지 못할 수도 있습니다.

  3. 부적절한 재무 관리로 인해 감당할 수 없는 손실이 발생할 수 있습니다.

최적화 방향

이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.

  1. 시장 상황에 따라 구매 시간 간격과 금액을 동적으로 조정합니다.

  2. 스톱 신호를 추가하여, 가격이 지지부진을 넘어서는 경우 포지션을 종료합니다.

  3. 시장 상황을 판단하는 요소와 함께 시장 진입과 출입을 결정하는 최적의 시기를 선택하십시오.

요약하다

이 단순 보유 전략은 정기적으로 암호화폐를 구매하고 보유하는 방식으로 비용 평균과 포트폴리오 부가가치 효과를 달성한다. 사용 방법을 숙지하는 것을 전제로, 비교적 간단한 수치화 전략이다. 더 많은 최적화를 도입함으로써 이 전략을 더 똑똑하게 만들고 시장 환경 변화에 적응시킬 수 있다.

전략 소스 코드
/*backtest
start: 2023-01-01 00:00:00
end: 2024-01-07 00:00:00
period: 1d
basePeriod: 1h
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/
// © Merdoc390

//@version=5

// The idea with this script is to use 3commas DCA bot to keep buying crypto, but not 'close the deal' which sells the crypto. 

// Basic idea is to keep adding funds, which increases the buy. 
// When you cancel the sale, you keep the crypto, thus HODL.
// I use this to build my positions that I short sale on Coinbase.com, so I need to cancel the deal after several candles so I can 
// trade them. 

// 3commas HODL DCA Bot article:
// https://3commas.io/blog/3commas-hodl-dca-bot-strategy
// This article includes the bot setup on 3Commas:
// Basicially you start the trade, then add funds to the trade, buying more crypto, then eventually cancel the deal.
// When you create the bot, you set the take profit really high, like 999%. Since it is unlikey to hit the value, it will never sell


// Credit to Irakli Gun as inspriation
// https://3commas.io/blog/3commas-hodl-dca-bot-strategy

strategy(title='HODL Simple v1', shorttitle="HODL'er", 
 calc_on_every_tick=false, calc_on_order_fills=true, process_orders_on_close =true,
 format=format.price, precision=4, overlay=true, pyramiding=365, 
 currency=currency.USD, default_qty_value=10, default_qty_type=strategy.cash , initial_capital=3650, 
 commission_type=strategy.commission.percent, commission_value=0.1)


var startFirstDeal = true
var done = false
var dealCount = 0
var totalDealCount = 0 


i_closeCount = input.int(defval=7,title="Close at Candle Count:",tooltip="How many buy candles to convert to a buy, otherwise it will remain open until end of timeframe.",group="Trade Range")
Start_date   = input(defval=timestamp('2023-09-21 16:30'),title="Start Date/Time",group="Trade Range")
Finish_date  = input(defval=timestamp('2023-09-21 23:05'),title="End Date/Time",group="Trade Range")

i_startBotAndDealMessage     = input(defval="paste your message here",title="Message to start bot and deal", tooltip="Message for 'start bot and deal",                        group="3Commas",display=display.all) 
i_addFundsMessage            = input(defval="paste your message here",title="Message for deal add funds signal in the quote currency",  tooltip="Using the quote (such as USD), to purchase more.",group="3Commas",display=display.all)
i_cancelTheDealMessage       = input(defval="paste your message here",title="Message to cancel the deal",tooltip="If you paste only cancel the deal, the bot will wait until next candle to add funds.\nOption is to also paste the add funds message to also add a buy position.",       group="3Commas",display=display.all)
i_cancelAndStopMessage       = input(defval="paste your message here",title="Message to cancel all bot deals and stop the bot",tooltip="Paste 3c bot messagage for Cancel all and Stop Bot",     group="3Commas",display=display.all)

time_cond = true

// check exit first
if not startFirstDeal and not done and dealCount < i_closeCount 
    strategy.close("Long")
    alert(i_cancelAndStopMessage)
    // log.info("Time expired, stopping bot, Total Deal Count:{0}",totalDealCount)
    done := true
// check if add funds after first deal
else if time_cond and not startFirstDeal and dealCount < i_closeCount 
    strategy.entry("Long", strategy.long)
    alert(i_addFundsMessage)
    // log.info("Deal Count:{0}, totalDeals:{1}",dealCount,totalDealCount)
    dealCount := dealCount + 1
    totalDealCount := totalDealCount + 1

else if time_cond and startFirstDeal and dealCount <= i_closeCount 
    strategy.entry("Long", strategy.long)
    // log.info("Start deal message, startFirst")
    alert(i_startBotAndDealMessage)
    startFirstDeal := false

else if time_cond and dealCount >= i_closeCount 
    strategy.close("Long")
    alert(i_cancelTheDealMessage)
    // log.info("Over Trades limit of {1}, resetting. Canceling. DealCount: {0}", dealCount, i_closeCount)
    dealCount := 0
    startFirstDeal := true

else if time_cond
    log.error("case not covered")