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 python | |
import os | |
import sys | |
import argparse | |
import logging | |
from datetime import datetime, timedelta | |
from typing import List, Optional | |
from collections import defaultdict |
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
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)) |