Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
const axios = require("axios");
const axiosRetry = require("axios-retry");
const moment = require("moment");
const _ = require("lodash");
const Comment = require("./db/models/Comment.js");
let startDate = new Date("Jan 1, 2015 00:00:00").getTime();
const endDate = new Date("July 27, 2018").getTime();
const config = require("./config/config.js");
const mongoose = require("./db/mongoose.js");
const limit = 50;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anthonytxie
anthonytxie / Correlations Between the Top 200 Coins and Bitcoin.ipynb
Created June 25, 2018 06:09
Correlations between the Top 200 Coins and Bitcoin
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anthonytxie
anthonytxie / Correlations between the Top 20 Coins.ipynb
Created June 25, 2018 06:10
Correlations between the Top 20 Coins
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anthonytxie
anthonytxie / Rolling 30 Day Correlations.ipynb
Created June 25, 2018 06:17
Rolling 30 Day Correlations between BTC & BCH
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anthonytxie
anthonytxie / Correlations Between the Top 200 Coins and the Rest of the Market.ipynb
Last active April 13, 2019 14:42
Correlations Between the Top 200 Coins and the Rest of the Market
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anthonytxie
anthonytxie / hodl20.py
Created March 24, 2018 21:01
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 = [{