단순 보유자 전략

저자:차오장, 날짜: 2024-01-08 17:05:10
태그:

img

전반적인 설명

단순 보유자 전략 (Simple Holder strategy) 은 암호화폐를 주기적으로 구매하고 보유하여 자산 상승을 달성하는 전략이다. 전략은 주로 주기적인 구매 신호, 보유 신호 및 출구 신호의 세 가지 부분을 포함한다.

전략 원칙

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

  1. 첫 구매를 하기 위해 시작에 구매 신호를 보내십시오.

  2. 코트 화폐를 사용하여 더 많은 기본 화폐를 구매하기 위해 특정 수의 촛불마다 구매 신호를 보내십시오.

  3. 촛불 수치가 정해진 값에 도달하면 종료 명령을 보내 포지션을 닫습니다.

  4. 출구시간이 되면 출구 신호를 보내서 전략을 멈추고 모든 포지션을 닫습니다.

암호화폐의 반복적인 구매와 보유를 통해, 비용 평균화와 지속적으로 증가하는 포지션의 효과를 얻을 수 있습니다.

이점 분석

이 전략의 장점은 다음과 같습니다.

  1. 주기적으로 암호화폐를 구매할 수 있어 구매의 타이밍 위험을 줄일 수 있습니다.

  2. 반복적인 구매를 통해 암호화폐의 평균 보유 비용을 줄일 수 있습니다.

  3. 지속적으로 증가하는 포지션을 통해 포트폴리오의 성장 수익을 얻을 수 있습니다.

  4. 사용자 정의 가능한 구매 및 출구 시기는 자동화를 가능하게 합니다.

  5. 조작이 간단하고 숙달이 쉽죠.

위험 분석

이 전략의 위험은 다음과 같습니다.

  1. 잠재적으로 엄청난 가격 변동으로 암호화폐 시장의 체계적인 위험.

  2. 부적절한 출출 시기는 적시에 손실을 멈추지 못할 수 있습니다.

  3. 부적절한 자본 관리도 손실을 감당하지 못하는 결과를 초래할 수 있습니다.

최적화 제안

전략의 다음 측면은 최적화 될 수 있습니다:

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

  2. 가격이 지원 수준 아래로 떨어지면 포지션을 닫는 데 Stop Loss 신호를 추가합니다.

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



더 많은