Một chiến lược mua tiền điện tử thường xuyên


Ngày tạo: 2024-01-08 17:05:10 sửa đổi lần cuối: 2024-01-08 17:05:10
sao chép: 2 Số nhấp chuột: 613
1
tập trung vào
1617
Người theo dõi

Một chiến lược mua tiền điện tử thường xuyên

Tổng quan

Chiến lược giữ đơn giản là một chiến lược mua tiền điện tử thường xuyên để tăng giá trị tài sản bằng cách mua và giữ tiền điện tử nhiều lần. Chiến lược này bao gồm ba thành phần chính là tín hiệu mua thường xuyên, tín hiệu giữ và tín hiệu thoát.

Nguyên tắc chiến lược

Lý luận cơ bản của chiến lược này là:

  1. Khi khởi động, gửi tín hiệu mua, mua lần đầu tiên.

  2. Mỗi khi có một số lượng nhất định, hãy gửi tín hiệu mua để mua thêm tiền Base bằng tiền Quot.

  3. Khi con số kim loại đạt đến giá trị mặc định, gửi hướng dẫn rút ra, thanh toán vị trí.

  4. Khi thời gian rút lui đến, gửi tín hiệu rút lui, dừng chiến lược và thanh toán tất cả các vị trí.

Bằng cách mua và giữ tiền điện tử nhiều lần, bạn có thể đạt được hiệu quả trung bình chi phí và tăng giữ liên tục.

Phân tích lợi thế

Chiến lược này có những ưu điểm sau:

  1. Có thể mua tiền điện tử thường xuyên, giảm rủi ro thời gian mua.

  2. Chi phí trung bình của tiền điện tử có thể được giảm bằng cách mua lại.

  3. Bằng cách tiếp tục tăng vị thế, bạn có thể nhận được lợi nhuận tăng trưởng của danh mục đầu tư.

  4. Có thể tùy chỉnh thời gian mua và rút ra, để hoạt động tự động.

  5. Dễ sử dụng và dễ sử dụng.

Phân tích rủi ro

Chiến lược này cũng có những rủi ro sau:

  1. Rủi ro hệ thống trên thị trường tiền điện tử, có thể có biến động lớn về giá.

  2. Không đúng thời điểm có thể gây ra thiệt hại.

  3. Việc quản lý tài chính không đúng cách cũng có thể dẫn đến tổn thất không thể chịu đựng được.

Hướng tối ưu hóa

Chiến lược này có thể được tối ưu hóa theo các khía cạnh sau:

  1. Theo thị trường, động điều chỉnh khoảng thời gian và số tiền mua.

  2. Thêm tín hiệu dừng để dừng lỗ khi giá giảm xuống mức hỗ trợ.

  3. Kết hợp nhiều yếu tố khác nhau để đánh giá thị trường, chọn thời điểm tốt nhất để vào và ra khỏi thị trường.

Tóm tắt

Chiến lược nắm giữ đơn giản này đạt được hiệu quả của chi phí trung bình và giá trị gia tăng danh mục bằng cách mua và nắm giữ tiền điện tử thường xuyên. Một chiến lược định lượng tương đối đơn giản, với điều kiện là nắm vững phương pháp sử dụng. Bằng cách đưa ra nhiều tối ưu hóa hơn, chiến lược này có thể trở nên thông minh hơn và thích ứng với sự thay đổi của môi trường thị trường.

Mã nguồn chiến lược
/*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")