Skip to content

Instantly share code, notes, and snippets.

View ElvisChowChow's full-sized avatar

ElvisChowChow ElvisChowChow

View GitHub Profile
@wrighter
wrighter / download_bars.py
Last active October 4, 2024 21:50
A command line utility to download historical data from Interactive Brokers
#!/usr/bin/env python
import os
import sys
import argparse
import logging
from datetime import datetime, timedelta
from typing import List, Optional
from collections import defaultdict
@fnneves
fnneves / 1.py
Last active July 30, 2021 06:54
medium
np.random.seed(42)
num_ports = 6000
all_weights = np.zeros((num_ports, len(stocks.columns)))
ret_arr = np.zeros(num_ports)
vol_arr = np.zeros(num_ports)
sharpe_arr = np.zeros(num_ports)
for x in range(num_ports):
# Weights
weights = np.array(np.random.random(4))