Skip to content

Compare the performance of a Portfolio Reallocation Bot against holding on to the coins, for any (number of) Binance coins.

Notifications You must be signed in to change notification settings

tomaarsen/Binance-Portfolio-Reallocation-Showcase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 

Repository files navigation

Binance-Portfolio-Reallocation-Showcase

Some of us may have some long-term crypto holds. A common strategy for these coins is to buy a roughly equal amount of all of them, and just hold on for a long time. This strategy isn't flawless, however. Let's assume you pick 5 coins, each 20% of your portfolio. If 4 of the 5 don't end up moving much, but one of them explodes 300%, then the value of your portfolio heavily depends on that one coin. It now represents a massive 43% of your portfolio, meaning that your attempts to diversify your portfolio will largely be undone.

Luckily, there's a method to help prevent this.


Portfolio Reallocation

The concept of this method is simple. The value of your holdings should follow a specific, predetermined ratio. This ratio can be anything. If you have two coins, with a ratio of 1:1, and one of them goes up in value, the ratio will shift from 50% and 50% to for example 54% and 46%. A reallocation bot will then sell some of the coin that performed well, and invest it in the coin that didn't. The new percent will yet again be 50% and 50% (back to equal on both sides, 1:1).

That's the concept. If you take a moment to think about it, you realise that this bot will sell whenever a coin goes up, and buy whenever a coin goes down. This means the bot will automatically take profits from profitable coins, and reinvest this money in coins that performed poorly. This bot is essentially the definition of "Buy low, sell high".

But, what about transaction fees? Wouldn't they eat into your profits?
And what if a coin just goes up a bunch, and the bot keeps selling parts for a coin that isn't moving at all? Wouldn't it be more profitable to just hold and not bother?

Great questions. I didn't know either.

So, to test it, I wrote a script to plot the performance of this bot, relative to just holding. The script by default picks out 3 Binance coins at random, uses as much historical data as is available, and plots the performance relative to just holding. It's possible to edit the amount of coins it randomly picks, by editing the randomCoinAmount variable, and it's possible to have the script look at the coins you want, by editing the symbolList variable.

It turns out, in a large amount of cases, it would have been more profitable to have this hypothetical bot active on the coins, instead of just holding the coins, even with fees.


Requirements

  • Python 3.6+ (Required for Pandas)
  • Requests Module
  • Matplotlib Module
  • Pandas Module

Graph gallery

Disclaimer: The only graphs I did not include were graphs where one of the coins only had historical data for less than 100 entries. Beyond that I picked the 20 first graphs that got generated. The graphs include 3 coins, set at a ratio of 1:1:1. A bot could hypothetically have different ratios too, depending on what coins you're more bullish on. Consider focusing on the Blue and Yellow lines. Blue showcases the hypothetical bot performance, while yellow shows the performance of holding the coins without any trades.
The gallery.

The data from these 20 tests is as follows:

ID Profit Ratio with Bot Profit Ratio without Bot Ratio between the Two
1 0.56 0.54 1.03
2 0.61 0.85 0.72
3 0.80 0.59 1.36
4 1.75 1.22 1.43
5 1.77 1.30 1.36
6 3.33 3.06 1.08
7 2.91 2.42 1.20
8 2.99 2.76 1.08
9 0.61 0.58 1.05
10 0.83 0.69 1.20
11 2.41 1.94 1.24
12 0.73 0.71 1.03
13 0.70 0.70 1.00
14 0.72 0.57 1.26
15 0.54 0.68 0.79
16 10.05 12.29 0.82
17 0.51 0.42 1.21
18 0.79 0.52 1.52
19 0.49 0.45 1.09
20 1.04 0.76 1.37
Average - - 1.142

About

Compare the performance of a Portfolio Reallocation Bot against holding on to the coins, for any (number of) Binance coins.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages