MultiversX Tracker is Live!

Making money from crypto: a tale of two algorithms

All Cryptocurrencies

by COINS NEWS 59 Views

Hey everyone, I wanted to share my investing strategy that has helped me DCA-in responsibly during the bear markets and that I hope will work out nicely during the next bull run. I break my strategy down into the definition of a risk metric and two simple algorithms: one for DCA-in, another for DCA-out. Hope you find it useful and I'm happy to get feedback!

My risk index

My risk index (RI) is defined as the amount of fiat money invested in cryptocurrency (C) divided by the holdings in non-crypto assets (A).

RI = C / A

Where:

  • C: The amount of fiat money invested in cryptocurrency.
  • A: The holdings (in fiat) in non-crypto assets.

By computing 1/RI I'm able to make the statement:

For every 1$ I invested in crypto, I have 1/RI$ in not-crypto assets.

This helps me a lot with perspective. I then use RI to manage risk in my DCA algorithm.

I DCA weekly, but any time scale would work in the algorithms below, e.g. 'monthly' instead of 'weekly'.

Algorithm #1: DCA in

Inputs:

  • w (weekly DCA amount, basically a fraction of my salary)
  • N (total number of weeks to DCA, e.g. N=52 to DCA in a bear year)
  • t0 (starting time for DCA, e.g. week 20 of 2022)
  • ξ (threshold for the risk index)

Instructions:

  1. Set t equal to t0.
  2. Loop until t is greater than t0 + N:
    1. Calculate the risk index, RI, as C / A.
    2. If RI is less than ξ:
      1. Buy w worth of cryptocurrency.
      2. Add w to C.
    3. Increment t by 1.

Algorithm #2: DCA out

Condition: Define D as the sum of the cryptocurrency that you want to hold forever (α), the cryptocurrency you want to DCA out (β), and the cryptocurrency you want to sell at target prices (γ).

D = α + β + γ

Inputs:

  • β (amount of cryptocurrency to DCA out)
  • γ (amount of cryptocurrency to sell at target prices)
  • κ (fraction of γ to sell at target prices)
  • N (number of weeks to DCA out)
  • t0 (starting time for DCA out)
  • P (list of target prices P_0 < P_1 < ... < P_max)

Instructions:

  1. Set t equal to t0.
  2. Loop until t is greater than t0 + N:
    1. Sell β/N worth of the desired cryptocurrency and keep the remaining α = D - (β + γ).
    2. Check if the current price of the desired cryptocurrency is greater than the first target price in the list P:
      1. If true, sell κ * γ amount of cryptocurrency, and remove the first target price from the list P.
    3. Increment t by 1.

Note: If all target prices in the list P are reached before the end of the DCA period, the remaining amount of cryptocurrency in γ is sold at the last reached target price.

---

And that's all folks. Thoughts?

submitted by /u/Vivid-Protection5194
[link] [comments]
Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
💰 Install these recommended apps:
💲 SocialGood - 100% Crypto Back on Everyday Shopping
💲 xPortal - The DeFi For The Next Billion
💲 CryptoTab Browser - Lightweight, fast, and ready to mine!
💰 Register on these recommended exchanges:
🟡 Binance🟡 Bitfinex🟡 Bitmart🟡 Bittrex🟡 Bitget
🟡 CoinEx🟡 Crypto.com🟡 Gate.io🟡 Huobi🟡 Kucoin.



Comments