Skip to content

Instantly share code, notes, and snippets.

View abel30567's full-sized avatar
🐉
Creating

Claudio Atilano abel30567

🐉
Creating
View GitHub Profile
@abel30567
abel30567 / hodl20.py
Created May 14, 2018 22:15 — forked from anthonytxie/hodl20.py
Hodl 20 Rebalancing Algorithm
def calc_allocations(self, date, quantity, cap):
"""Figure out ideal allocations for a given date"""
# {
# coin_name: (percent_allocation, data)
# }
top_market = self.get_top_market(date, quantity)
total_cap = sum([coin.market_cap for coin in top_market])
allocations = [{