Skip to content

Instantly share code, notes, and snippets.

View impmja's full-sized avatar
💭
Typing...

impmja impmja

💭
Typing...
View GitHub Profile
@impmja
impmja / hodl20.py
Created July 17, 2018 19:09 — 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 = [{