シンプルな保有者戦略

作者: リン・ハーンチャオチャン開催日:2024年1月8日17時05分10秒
タグ:

img

概要

シンプルホルダー戦略は,定期的に仮想通貨を購入し,資産評価を達成するために保有する戦略である.この戦略には主に3つの部分が含まれます.定期的な購入信号,保持信号,退出信号.

戦略原則

戦略の基本論理は

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



もっと