This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Tom Dupre la Tour | |
# | |
# License: BSD 3 clause | |
import time | |
import sys | |
try: | |
import annoy | |
except ImportError: | |
print("The package 'annoy' is required to run this example.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from blankly import Alpaca, CoinbasePro # supports stocks, crypto, and forex | |
import numpy as np | |
from math import sqrt | |
def cagr(start_value: float, end_value: float, years: int): | |
return (end_value / start_value) ** (1.0 / years) - 1 | |
def sharpe(account_values: np.array, risk_free_rate, annualize_coefficient): | |
diff = np.diff(account_values, 1) / account_values[1:] # this gets our pct_return in the array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# source: https://sharats.me/posts/shell-script-best-practices/ | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
if [[ "${TRACE-0}" == "1" ]]; then | |
set -o xtrace | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Make a download dir to store the node source and download it. | |
mkdir downloads | |
cd downloads | |
git clone https://github.com/joyent/node.git | |
Find the latest version | |
2) List all of the tags in the repository, and check out the most recent. | |
git tag | |
git checkout v0.9.9 |
OlderNewer