Portfolio optimization on Dirac
Device: Dirac-1
Introduction
This approach seeks to identify a sub-portfolio of stocks that have superior risk-return profiles compared to the full portfolio. This identifies opportunities for an investor to simplify their investment strategy without sacrificing (and potentially enhancing) the risk-adjusted return.
Methodology
Let K be the total number of available stocks to choose from (here ), that is the size of the stock pool. We want to choose a subset of () stocks such that the portfolio risk is minimized, while the portfolio expected return is maximized, that is
where is the daily returns of the portfolio over some period of time, and are the variance and expectation of daily returns, is a hyper-parameter, and are binary variables representing inclusion or exclusion of a stock. A large value means the focus of optimization is to increase return, whereas a small value indicates the reduction of risk is more important. As we can take both long and short positions on stocks, we assume that corresponds to long positions on stocks 1 to .
As we are choosing a subset of stocks, we also need the following constraint,
Assuming that the same amount is invested on each of the K' selected stocks, the portfolio daily return at time t over a time period denoted by m can be expanded as follows,
where is the daily return of stock i at time in time period . The expectation of portfolio daily return over time period can thus be expanded as,
and the variance portfolio daily return over time period m is expanded as,
where is the covariant function.
The problem then reduces to
where
To avoid an over-fit on the portfolio data, we can minimize the average of the cost function over overlapping time periods, that is . The problem becomes,
subject to,
Implementation
The above-mentioned approach was used to construct an optimal portfolio based on the constituents of the Nasdaq-100 index. The following constituents were used,
In [2]:
import pandas as pdfrom IPython.display import display, HTMLdf = pd.read_csv("nasdaq100_stocks.csv")display(HTML(df[["Company", "Symbol"]].to_html()))
Out [ ]:
Company | Symbol | |
---|---|---|
0 | Microsoft Corp | MSFT |
1 | Apple Inc | AAPL |
2 | Amazon.com Inc | AMZN |
3 | Alphabet Inc | GOOG |
4 | Alphabet Inc | GOOGL |
5 | NVIDIA Corp | NVDA |
6 | Tesla Inc | TSLA |
7 | Meta Platforms Inc | META |
8 | PepsiCo Inc | PEP |
9 | Broadcom Inc | AVGO |
10 | Costco Wholesale Corp | COST |
11 | Cisco Systems Inc | CSCO |
12 | T-Mobile US Inc | TMUS |
13 | Adobe Inc | ADBE |
14 | Texas Instruments Inc | TXN |
15 | Comcast Corp | CMCSA |
16 | Honeywell International Inc | HON |
17 | Amgen Inc | AMGN |
18 | Netflix Inc | NFLX |
19 | QUALCOMM Inc | QCOM |
20 | Starbucks Corp | SBUX |
21 | Intel Corp | INTC |
22 | Intuit Inc | INTU |
23 | Gilead Sciences Inc | GILD |
24 | Advanced Micro Devices Inc | AMD |
25 | Automatic Data Processing Inc | ADP |
26 | Intuitive Surgical Inc | ISRG |
27 | Mondelez International Inc | MDLZ |
28 | Applied Materials Inc | AMAT |
29 | Analog Devices Inc | ADI |
30 | Regeneron Pharmaceuticals Inc | REGN |
31 | PayPal Holdings Inc | PYPL |
32 | Moderna Inc | MRNA |
33 | Booking Holdings Inc | BKNG |
34 | Vertex Pharmaceuticals Inc | VRTX |
35 | CSX Corp | CSX |
36 | Fiserv Inc | FISV |
37 | Lam Research Corp | LRCX |
38 | Activision Blizzard Inc | ATVI |
39 | Micron Technology Inc | MU |
40 | KLA Corp | KLAC |
41 | Monster Beverage Corp | MNST |
42 | O'Reilly Automotive Inc | ORLY |
43 | Keurig Dr Pepper Inc | KDP |
44 | ASML Holding NV | ASML |
45 | Synopsys Inc | SNPS |
46 | Kraft Heinz Co/The | KHC |
47 | Charter Communications Inc | CHTR |
48 | American Electric Power Co Inc | AEP |
49 | Marriott International Inc/MD | MAR |
50 | Palo Alto Networks Inc | PANW |
51 | Cintas Corp | CTAS |
52 | Cadence Design Systems Inc | CDNS |
53 | MercadoLibre Inc | MELI |
54 | Dexcom Inc | DXCM |
55 | Exelon Corp | EXC |
56 | Biogen Inc | BIIB |
57 | AstraZeneca PLC ADR | AZN |
58 | NXP Semiconductors NV | NXPI |
59 | Paychex Inc | PAYX |
60 | Enphase Energy Inc | ENPH |
61 | Autodesk Inc | ADSK |
62 | Pinduoduo Inc ADR | PDD |
63 | Ross Stores Inc | ROST |
64 | Fortinet Inc | FTNT |
65 | Microchip Technology Inc | MCHP |
66 | Xcel Energy Inc | XEL |
67 | Lululemon Athletica Inc | LULU |
68 | Airbnb Inc | ABNB |
69 | Workday Inc | WDAY |
70 | PACCAR Inc | PCAR |
71 | Walgreens Boots Alliance Inc | WBA |
72 | IDEXX Laboratories Inc | IDXX |
73 | Electronic Arts Inc | EA |
74 | Marvell Technology Inc | MRVL |
75 | Old Dominion Freight Line Inc | ODFL |
76 | GLOBALFOUNDRIES Inc | GFS |
77 | CoStar Group Inc | CSGP |
78 | Dollar Tree Inc | DLTR |
79 | Illumina Inc | ILMN |
80 | Baker Hughes Co | BKR |
81 | Copart Inc | CPRT |
82 | Constellation Energy Corp | CEG |
83 | Cognizant Technology Solutions Corp | CTSH |
84 | JD.com Inc ADR | JD |
85 | Fastenal Co | FAST |
86 | Verisk Analytics Inc | VRSK |
87 | Seagen Inc | SGEN |
88 | Crowdstrike Holdings Inc | CRWD |
89 | Diamondback Energy Inc | FANG |
90 | Sirius XM Holdings Inc | SIRI |
91 | eBay Inc | EBAY |
92 | Datadog Inc | DDOG |
93 | Warner Bros Discovery Inc | WBD |
94 | ANSYS Inc | ANSS |
95 | Atlassian Corp | TEAM |
96 | Rivian Automotive Inc | RIVN |
97 | Zoom Video Communications Inc | ZM |
98 | Zscaler Inc | ZS |
99 | Align Technology Inc | ALGN |
100 | Lucid Group Inc | LCID |
We got the historical prices of the constituent stocks, as well as those of Nasdaq-100 (NDX) and equal-weighted Nasdaq-100 (QQQE) using the Yahoo Finance Python library,
In [4]:
# Import libs import osimport pandas as pdimport yfinance as yf# Define some parameters OUT_DIR = "data"DROP_STOCKS = []# Get the list of all existing stocks stocks = list(df["Symbol"].unique()) + ["NDX", "QQQE"] for stock in stocks:try:tmp_df = yf.Ticker(stock).history(period="max", interval="1d",)[["Close"]].rename(columns={"Close": stock,})tmp_df["Date"] = tmp_df.indextmp_df.to_csv(os.path.join(OUT_DIR, "%s.csv" % stock),index=False,)except Exception as exc:print("Could not get price for %s" % stock)print(exc)DROP_STOCKS.append(stock)if tmp_df.shape[0] == 0:DROP_STOCKS.append(stock)
Out [ ]:
- FISV: No data found, symbol may be delisted - ATVI: No data found, symbol may be delisted - SGEN: No data found, symbol may be delisted
Let us import some libraries and set some parameters,
In [5]:
# Import libs import osimport sysimport timeimport datetimeimport jsonimport warningsfrom functools import wrapsimport numpy as npimport pandas as pdfrom qci_client import QciClientwarnings.filterwarnings("ignore")ALPHA = 1.0 # The coefficient for penalty term (for linear constraint)N_SAMPLES = 20 # Number of solution samplesXI = 5.0 # The xi variable as defined in MethodologyK_PRIME = 30 # Number of selected stocksWINDOW_DAYS = 30 # Size of each sliding window in daysWINDOW_OVERLAP_DAYS = 15 # Overlap between sliding windows in daysIN_SAMPLE_DAYS = 180 # Size of the lookback period in daysOUT_OF_SAMPLE_DAYS = 30 # Size of the horizon window in days
We now define a function that calculates daily returns of all constituent stocks,
In [6]:
def get_stock_returns(stocks, min_date, max_date):min_date = pd.to_datetime(min_date)max_date = pd.to_datetime(max_date)return_df = Nonefor stock in stocks:stock_df = pd.read_csv("data/%s.csv" % stock)stock_df["Date"] = stock_df["Date"].astype("datetime64[ns]")stock_df = stock_df.fillna(method="ffill").fillna(method="bfill")stock_df[stock] = stock_df[stock].pct_change()stock_df = stock_df.dropna()stock_df = stock_df[(stock_df["Date"] >= min_date) & (stock_df["Date"] <= max_date)]if return_df is None:return_df = stock_dfelse:return_df = return_df.merge(stock_df, how="outer", on="Date",)return_df = return_df.fillna(method="ffill").fillna(method="bfill")return return_df
And a function that calculates the hamiltonian matrix,
In [7]:
def get_hamiltonian(return_df, stocks, min_date, max_date,):K = len(stocks)# Calculate P and Q Q = np.zeros(shape=(K, K), dtype="d")P = np.zeros(shape=(K, K), dtype="d")m = 0min_date = pd.to_datetime(min_date)max_date = pd.to_datetime(max_date)tmp_date = min_datewhile tmp_date <= max_date:tmp_min_date = tmp_datetmp_max_date = tmp_date + datetime.timedelta(days=WINDOW_DAYS)tmp_df = return_df[(return_df["Date"] >= tmp_min_date)& (return_df["Date"] <= tmp_max_date)]r_list = []for i in range(K):r_list.append(np.array(tmp_df[stocks[i]]))Q += np.cov(r_list)for i in range(K):for j in range(K):P[i][j] += np.mean(r_list[i]) * np.mean(r_list[j])tmp_date += datetime.timedelta(days=WINDOW_DAYS - WINDOW_OVERLAP_DAYS,)m += 1fct = mif fct > 0:fct = 1.0 / fctP = fct * PQ = fct * Q# Calculate the Hamiltonian H = -P + XI * Q# make sure H is symmetric up to machine precision H = 0.5 * (H + H.transpose())return H
And, we define a function that yields an optimal portfolio given a hamiltonian ,
In [8]:
def optimize_portfolio(H, stocks, curr_date):beg_time = time.time()K = len(stocks)assert H.shape[0] == Kassert H.shape[1] == K# Generate the constraint cons_lhs = np.ones(shape=(K), dtype=np.float32)cons_rhs = np.array([-K_PRIME])constraints = np.hstack([cons_lhs, cons_rhs])# Create json objects objective_json = {"file_name": "objective_tutorial_eq_wt_port_opt.json","file_config": {"objective": {"data": H, "num_variables": K},} }constraint_json = {"file_name": "constraints_tutorial_eq_wt_port_opt.json","file_config": {"constraints": {"data": constraints, "num_variables": K,"num_constraints": 1,}}}job_json = {"job_name": "moodys_eqc1_equal_weights","job_tags": ["moody_nasda100_eqc1_equal_weights",],"params": {"sampler_type": "csample", #"eqc1", "n_samples": N_SAMPLES,"alpha": ALPHA,},}# Solve the optimization problem qci = QciClient()response_json = qci.upload_file(objective_json)objective_file_id = response_json["file_id"]response_json = qci.upload_file(constraint_json)constraint_file_id = response_json["file_id"]job_params = {"sampler_type": "dirac-1", "alpha": ALPHA, "nsamples": N_SAMPLES,}job_json = qci.build_job_body(job_type="sample-constraint", job_params=job_params,constraints_file_id=constraint_file_id, objective_file_id=objective_file_id,job_name=f"tutorial_eqc1",job_tags=["tutorial_eqc1"],)print(job_json)job_response_json = qci.process_job(job_body=job_json, job_type="sample-constraint",)print(job_response_json)results = list(job_response_json["results"]["file_config"].values())[0]energies = results["energies"]samples = results["solutions"]is_feasibles = results["feasibilities"]# The sample solutions are sorted by energy sol = Nonefor i, item in enumerate(samples):sol = itemis_feasible = is_feasibles[i]if is_feasible:breakif not is_feasible:print("Solution is not feasible!")assert len(sol) == K, "Inconsistent solution size!"if sum(sol) != K_PRIME:print("Expected to select %d stocks, but selected %d!"% (K_PRIME, sum(sol)))sel_stocks = []for i in range(K):if sol[i] > 0:sel_stocks.append(stocks[i])print("In optimize_portfolio; done with checking constraints; %0.2f seconds!"% (time.time() - beg_time))return sol, sel_stocks
Results
We can now test the approach over a period of time, for example, between 2020-01-15 to 2023-12-30. We define,
In [9]:
def run(curr_date):print("Processing curr date:", curr_date)curr_date = pd.to_datetime(curr_date)min_ins_date = curr_date - datetime.timedelta(days=IN_SAMPLE_DAYS)max_ins_date = curr_date - datetime.timedelta(days=1)min_oos_date = curr_datemax_oos_date = curr_date + datetime.timedelta(days=OUT_OF_SAMPLE_DAYS)df = pd.read_csv("nasdaq100_stocks.csv", low_memory=False)stocks = list(set(df["Symbol"]) - set(DROP_STOCKS))ins_return_df = get_stock_returns(stocks, min_ins_date, max_ins_date)oos_return_df = get_stock_returns(stocks, min_oos_date, max_oos_date)ins_return_df = ins_return_df.sort_values("Date")ins_return_df = ins_return_df.fillna(method="ffill").fillna(0)oos_return_df = oos_return_df.sort_values("Date")oos_return_df = oos_return_df.fillna(method="ffill").fillna(0)H = get_hamiltonian(ins_return_df, stocks, min_ins_date, max_ins_date)sol, sel_stocks = optimize_portfolio(H, stocks, curr_date)sel_stock_df = pd.DataFrame()sel_stock_df["Date"] = [curr_date] * len(sel_stocks)sel_stock_df["Stock"] = sel_stocksreturn sel_stock_df
We can then run a backtest,
In [20]:
min_date = pd.to_datetime("2022-01-13") max_date = pd.to_datetime("2022-12-30")SEL_STOCK_OUT_FILE = "selected_stocks.csv"curr_date = min_datewhile curr_date < max_date:tmp_sel_stock_df = run(curr_date)if os.path.exists(SEL_STOCK_OUT_FILE):tmp_sel_stock_df.to_csv(SEL_STOCK_OUT_FILE, index=False, mode="a", header=False,)else:tmp_sel_stock_df.to_csv(SEL_STOCK_OUT_FILE, index=False,)curr_date += datetime.timedelta(days=OUT_OF_SAMPLE_DAYS + 1)
Out [ ]:
Processing curr date: 2022-02-13 00:00:00 {'job_submission': {'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4c84e38d25ec78cae76a6', 'objective_file_id': '65f4c84d38d25ec78cae76a4', 'alpha': 1.0}}, 'device_config': {'dirac-1': {'num_samples': 20}}, 'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1']}} Dirac allocation balance = 0 s (unmetered) Job submitted job_id='65f4c84ea657b4e45963cc79'-: 2024/03/15 15:14:38 QUEUED: 2024/03/15 15:14:40 RUNNING: 2024/03/15 15:30:19 COMPLETED: 2024/03/15 15:35:04 Dirac allocation balance = 0 s (unmetered) {'job_info': {'job_id': '65f4c84ea657b4e45963cc79', 'job_submission': {'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1'], 'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4c84e38d25ec78cae76a6', 'objective_file_id': '65f4c84d38d25ec78cae76a4', 'alpha': 1, 'atol': 1e-10}}, 'device_config': {'dirac-1': {'num_samples': 20}}}, 'job_status': {'submitted_at_rfc3339nano': '2024-03-15T22:14:38.756Z', 'queued_at_rfc3339nano': '2024-03-15T22:14:38.757Z', 'running_at_rfc3339nano': '2024-03-15T22:30:19.102Z', 'completed_at_rfc3339nano': '2024-03-15T22:35:03.957Z'}, 'job_result': {'file_id': '65f4cd1738d25ec78cae76aa', 'device_usage_s': 40}, 'details': {'status': 'COMPLETED'}}, 'results': {'file_id': '65f4cd1738d25ec78cae76aa', 'num_parts': 1, 'num_bytes': 12488, 'file_name': 'tutorial_eqc1', 'file_config': {'quadratic_linearly_constrained_binary_optimization_results': {'counts': [2, 3, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1], 'energies': [-899.7963256835938, -899.7960815429688, -899.7958374023438, -899.7955932617188, -899.7955932617188, -899.7955932617188, -899.7954711914062, -899.7954711914062, -899.7949829101562, -899.7948608398438, -899.7948608398438, -899.7944946289062, -899.7944946289062, -899.7943725585938, -899.7940063476562], 'feasibilities': [True, True, True, True, True, True, True, True, True, True, True, True, True, True, True], 'objective_values': [0.20369557323033616, 0.20388814901805405, 0.20418966300356534, 0.20438077700310434, 0.20443863101159693, 0.2044567209569369, 0.2045380135356829, 0.20454698282745962, 0.20500405446625788, 0.20508160200564368, 0.20518514483182357, 0.20552384253214112, 0.20553403280592786, 0.20564387422012306, 0.20594401748556387], 'solutions': [[1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1,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 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0]]}}}} In optimize_portfolio; done with checking constraints; 1228.37 seconds! Processing curr date: 2022-03-16 00:00:00 {'job_submission': {'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4cd1b38d25ec78cae76ae', 'objective_file_id': '65f4cd1b38d25ec78cae76ac', 'alpha': 1.0}}, 'device_config': {'dirac-1': {'num_samples': 20}}, 'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1']}} Dirac allocation balance = 0 s (unmetered) Job submitted job_id='65f4cd1ca657b4e45963cc7a'-: 2024/03/15 15:35:08 RUNNING: 2024/03/15 15:35:09 COMPLETED: 2024/03/15 15:39:50 Dirac allocation balance = 0 s (unmetered) {'job_info': {'job_id': '65f4cd1ca657b4e45963cc7a', 'job_submission': {'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1'], 'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4cd1b38d25ec78cae76ae', 'objective_file_id': '65f4cd1b38d25ec78cae76ac', 'alpha': 1, 'atol': 1e-10}}, 'device_config': {'dirac-1': {'num_samples': 20}}}, 'job_status': {'submitted_at_rfc3339nano': '2024-03-15T22:35:08.493Z', 'queued_at_rfc3339nano': '2024-03-15T22:35:08.493Z', 'running_at_rfc3339nano': '2024-03-15T22:35:09.037Z', 'completed_at_rfc3339nano': '2024-03-15T22:39:49.625Z'}, 'job_result': {'file_id': '65f4ce3538d25ec78cae76b0', 'device_usage_s': 39}, 'details': {'status': 'COMPLETED'}}, 'results': {'file_id': '65f4ce3538d25ec78cae76b0', 'num_parts': 1, 'num_bytes': 6758, 'file_name': 'tutorial_eqc1', 'file_config': {'quadratic_linearly_constrained_binary_optimization_results': {'counts': [10, 3, 2, 1, 1, 1, 1, 1], 'energies': [-899.7587890625, -899.7586669921875, -899.758544921875, -899.7584228515625, -899.75830078125, -899.75830078125, -899.75830078125, -899.7578125], 'feasibilities': [True, True, True, True, True, True, True, True], 'objective_values': [0.24119182679735562, 0.24131389219151933, 0.24150392804416737, 0.24155724141091345, 0.24168889093742402, 0.24172747089956806, 0.24172983780904703, 0.2422582565204664], 'solutions': [[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0,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0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0]]}}}} In optimize_portfolio; done with checking constraints; 284.62 seconds! Processing curr date: 2022-04-16 00:00:00 {'job_submission': {'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4ce3938d25ec78cae76b4', 'objective_file_id': '65f4ce3938d25ec78cae76b2', 'alpha': 1.0}}, 'device_config': {'dirac-1': {'num_samples': 20}}, 'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1']}} Dirac allocation balance = 0 s (unmetered) Job submitted job_id='65f4ce3aa657b4e45963cc7b'-: 2024/03/15 15:39:54 QUEUED: 2024/03/15 15:39:55 RUNNING: 2024/03/15 17:00:15 COMPLETED: 2024/03/15 17:05:29 Dirac allocation balance = 0 s (unmetered) {'job_info': {'job_id': '65f4ce3aa657b4e45963cc7b', 'job_submission': {'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1'], 'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4ce3938d25ec78cae76b4', 'objective_file_id': '65f4ce3938d25ec78cae76b2', 'alpha': 1, 'atol': 1e-10}}, 'device_config': {'dirac-1': {'num_samples': 20}}}, 'job_status': {'submitted_at_rfc3339nano': '2024-03-15T22:39:54.347Z', 'queued_at_rfc3339nano': '2024-03-15T22:39:54.347Z', 'running_at_rfc3339nano': '2024-03-16T00:00:14.028Z', 'completed_at_rfc3339nano': '2024-03-16T00:04:55.121Z'}, 'job_result': {'file_id': '65f4e22738d25ec78cae76bc', 'device_usage_s': 40}, 'details': {'status': 'COMPLETED'}}, 'results': {'file_id': '65f4e22738d25ec78cae76bc', 'num_parts': 1, 'num_bytes': 6758, 'file_name': 'tutorial_eqc1', 'file_config': {'quadratic_linearly_constrained_binary_optimization_results': {'counts': [7, 3, 3, 3, 1, 1, 1, 1], 'energies': [-899.7435913085938, -899.7433471679688, -899.7432250976562, -899.7431030273438, -899.7431030273438, -899.7431030273438, -899.7428588867188, -899.7427368164062], 'feasibilities': [True, True, True, True, True, True, True, True], 'objective_values': [0.2564027547505653, 0.25659638750127045, 0.2567269182857328, 0.25686181389475693, 0.2569322201176682, 0.25693629828829534, 0.25712523656024733, 0.25728489459363096], 'solutions': [[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0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1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0]]}}}} In optimize_portfolio; done with checking constraints; 5137.52 seconds! Processing curr date: 2022-05-17 00:00:00 {'job_submission': {'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e24c38d25ec78cae76c0', 'objective_file_id': '65f4e24c38d25ec78cae76be', 'alpha': 1.0}}, 'device_config': {'dirac-1': {'num_samples': 20}}, 'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1']}} Dirac allocation balance = 0 s (unmetered) Job submitted job_id='65f4e24da657b4e45963cc7d'-: 2024/03/15 17:05:33 RUNNING: 2024/03/15 17:05:34 COMPLETED: 2024/03/15 17:10:14 Dirac allocation balance = 0 s (unmetered) {'job_info': {'job_id': '65f4e24da657b4e45963cc7d', 'job_submission': {'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1'], 'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e24c38d25ec78cae76c0', 'objective_file_id': '65f4e24c38d25ec78cae76be', 'alpha': 1, 'atol': 1e-10}}, 'device_config': {'dirac-1': {'num_samples': 20}}}, 'job_status': {'submitted_at_rfc3339nano': '2024-03-16T00:05:33.356Z', 'queued_at_rfc3339nano': '2024-03-16T00:05:33.357Z', 'running_at_rfc3339nano': '2024-03-16T00:05:33.387Z', 'completed_at_rfc3339nano': '2024-03-16T00:10:14.059Z'}, 'job_result': {'file_id': '65f4e36638d25ec78cae76c8', 'device_usage_s': 39}, 'details': {'status': 'COMPLETED'}}, 'results': {'file_id': '65f4e36638d25ec78cae76c8', 'num_parts': 1, 'num_bytes': 7573, 'file_name': 'tutorial_eqc1', 'file_config': {'quadratic_linearly_constrained_binary_optimization_results': {'counts': [10, 2, 2, 1, 1, 1, 1, 1, 1], 'energies': [-899.62451171875, -899.6239013671875, -899.6236572265625, -899.62353515625, -899.623046875, -899.623046875, -899.623046875, -899.6212158203125, -899.62060546875], 'feasibilities': [True, True, True, True, True, True, True, True, True], 'objective_values': [0.3754961090145467, 0.3761349709018598, 0.37639520974058377, 0.37643015106962335, 0.37689922878543886, 0.37693437250413864, 0.37698456929277635, 0.3788199181270705, 0.3793789032229274], 'solutions': [[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0]]}}}} In optimize_portfolio; done with checking constraints; 283.34 seconds! Processing curr date: 2022-06-17 00:00:00 {'job_submission': {'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e36938d25ec78cae76cc', 'objective_file_id': '65f4e36838d25ec78cae76ca', 'alpha': 1.0}}, 'device_config': {'dirac-1': {'num_samples': 20}}, 'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1']}} Dirac allocation balance = 0 s (unmetered) Job submitted job_id='65f4e36aa657b4e45963cc80'-: 2024/03/15 17:10:18 RUNNING: 2024/03/15 17:10:19 COMPLETED: 2024/03/15 17:15:00 Dirac allocation balance = 0 s (unmetered) {'job_info': {'job_id': '65f4e36aa657b4e45963cc80', 'job_submission': {'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1'], 'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e36938d25ec78cae76cc', 'objective_file_id': '65f4e36838d25ec78cae76ca', 'alpha': 1, 'atol': 1e-10}}, 'device_config': {'dirac-1': {'num_samples': 20}}}, 'job_status': {'submitted_at_rfc3339nano': '2024-03-16T00:10:18.199Z', 'queued_at_rfc3339nano': '2024-03-16T00:10:18.2Z', 'running_at_rfc3339nano': '2024-03-16T00:10:19.143Z', 'completed_at_rfc3339nano': '2024-03-16T00:14:59.595Z'}, 'job_result': {'file_id': '65f4e48338d25ec78cae76d6', 'device_usage_s': 39}, 'details': {'status': 'COMPLETED'}}, 'results': {'file_id': '65f4e48338d25ec78cae76d6', 'num_parts': 1, 'num_bytes': 5128, 'file_name': 'tutorial_eqc1', 'file_config': {'quadratic_linearly_constrained_binary_optimization_results': {'counts': [13, 3, 1, 1, 1, 1], 'energies': [-899.4998168945312, -899.4990844726562, -899.4988403320312, -899.4974975585938, -899.4970092773438, -899.4965209960938], 'feasibilities': [True, True, True, True, True, True], 'objective_values': [0.5002137880562461, 0.5008963437784205, 0.5011757514764313, 0.5024119848904032, 0.5029271374440363, 0.5034163133190306], 'solutions': [[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1,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1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0]]}}}} In optimize_portfolio; done with checking constraints; 284.86 seconds! Processing curr date: 2022-07-18 00:00:00 {'job_submission': {'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e48738d25ec78cae76da', 'objective_file_id': '65f4e48738d25ec78cae76d8', 'alpha': 1.0}}, 'device_config': {'dirac-1': {'num_samples': 20}}, 'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1']}} Dirac allocation balance = 0 s (unmetered) Job submitted job_id='65f4e488a657b4e45963cc83'-: 2024/03/15 17:15:04 RUNNING: 2024/03/15 17:15:05 COMPLETED: 2024/03/15 17:19:45 Dirac allocation balance = 0 s (unmetered) {'job_info': {'job_id': '65f4e488a657b4e45963cc83', 'job_submission': {'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1'], 'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e48738d25ec78cae76da', 'objective_file_id': '65f4e48738d25ec78cae76d8', 'alpha': 1, 'atol': 1e-10}}, 'device_config': {'dirac-1': {'num_samples': 20}}}, 'job_status': {'submitted_at_rfc3339nano': '2024-03-16T00:15:04.367Z', 'queued_at_rfc3339nano': '2024-03-16T00:15:04.368Z', 'running_at_rfc3339nano': '2024-03-16T00:15:04.674Z', 'completed_at_rfc3339nano': '2024-03-16T00:19:45.142Z'}, 'job_result': {'file_id': '65f4e5a138d25ec78cae76e0', 'device_usage_s': 39}, 'details': {'status': 'COMPLETED'}}, 'results': {'file_id': '65f4e5a138d25ec78cae76e0', 'num_parts': 1, 'num_bytes': 5943, 'file_name': 'tutorial_eqc1', 'file_config': {'quadratic_linearly_constrained_binary_optimization_results': {'counts': [13, 1, 2, 1, 1, 1, 1], 'energies': [-899.478515625, -899.4781494140625, -899.47802734375, -899.4766845703125, -899.476318359375, -899.475830078125, -899.47314453125], 'feasibilities': [True, True, True, True, True, True, True], 'objective_values': [0.5214603078128224, 0.5218969949789258, 0.5220147467374703, 0.5233189543750865, 0.5237230268958093, 0.5241313185100483, 0.5268431633545608], 'solutions': [[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1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 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0]]}}}} In optimize_portfolio; done with checking constraints; 283.57 seconds! Processing curr date: 2022-08-18 00:00:00 {'job_submission': {'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e5a438d25ec78cae76e4', 'objective_file_id': '65f4e5a438d25ec78cae76e2', 'alpha': 1.0}}, 'device_config': {'dirac-1': {'num_samples': 20}}, 'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1']}} Dirac allocation balance = 0 s (unmetered) Job submitted job_id='65f4e5a5a657b4e45963cc85'-: 2024/03/15 17:19:49 RUNNING: 2024/03/15 17:19:50 COMPLETED: 2024/03/15 17:24:30 Dirac allocation balance = 0 s (unmetered) {'job_info': {'job_id': '65f4e5a5a657b4e45963cc85', 'job_submission': {'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1'], 'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e5a438d25ec78cae76e4', 'objective_file_id': '65f4e5a438d25ec78cae76e2', 'alpha': 1, 'atol': 1e-10}}, 'device_config': {'dirac-1': {'num_samples': 20}}}, 'job_status': {'submitted_at_rfc3339nano': '2024-03-16T00:19:49.344Z', 'queued_at_rfc3339nano': '2024-03-16T00:19:49.345Z', 'running_at_rfc3339nano': '2024-03-16T00:19:50.223Z', 'completed_at_rfc3339nano': '2024-03-16T00:24:30.648Z'}, 'job_result': {'file_id': '65f4e6be38d25ec78cae76ee', 'device_usage_s': 39}, 'details': {'status': 'COMPLETED'}}, 'results': {'file_id': '65f4e6be38d25ec78cae76ee', 'num_parts': 1, 'num_bytes': 5128, 'file_name': 'tutorial_eqc1', 'file_config': {'quadratic_linearly_constrained_binary_optimization_results': {'counts': [11, 4, 2, 1, 1, 1], 'energies': [-899.4928588867188, -899.4913940429688, -899.4911499023438, -899.4895629882812, -899.4894409179688, -899.4894409179688], 'feasibilities': [True, True, True, True, True, True], 'objective_values': [0.5070904192884772, 0.5085829941485729, 0.5087828367595719, 0.5104381912056234, 0.5105143985622359, 0.5105987515954077], 'solutions': [[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,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0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0]]}}}} In optimize_portfolio; done with checking constraints; 283.87 seconds! Processing curr date: 2022-09-18 00:00:00 {'job_submission': {'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e6c238d25ec78cae76f2', 'objective_file_id': '65f4e6c138d25ec78cae76f0', 'alpha': 1.0}}, 'device_config': {'dirac-1': {'num_samples': 20}}, 'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1']}} Dirac allocation balance = 0 s (unmetered) Job submitted job_id='65f4e6c2a657b4e45963cc88'-: 2024/03/15 17:24:34 RUNNING: 2024/03/15 17:24:35 COMPLETED: 2024/03/15 17:29:15 Dirac allocation balance = 0 s (unmetered) {'job_info': {'job_id': '65f4e6c2a657b4e45963cc88', 'job_submission': {'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1'], 'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e6c238d25ec78cae76f2', 'objective_file_id': '65f4e6c138d25ec78cae76f0', 'alpha': 1, 'atol': 1e-10}}, 'device_config': {'dirac-1': {'num_samples': 20}}}, 'job_status': {'submitted_at_rfc3339nano': '2024-03-16T00:24:34.656Z', 'queued_at_rfc3339nano': '2024-03-16T00:24:34.656Z', 'running_at_rfc3339nano': '2024-03-16T00:24:34.719Z', 'completed_at_rfc3339nano': '2024-03-16T00:29:15.645Z'}, 'job_result': {'file_id': '65f4e7db38d25ec78cae76fc', 'device_usage_s': 39}, 'details': {'status': 'COMPLETED'}}, 'results': {'file_id': '65f4e7db38d25ec78cae76fc', 'num_parts': 1, 'num_bytes': 2683, 'file_name': 'tutorial_eqc1', 'file_config': {'quadratic_linearly_constrained_binary_optimization_results': {'counts': [15, 4, 1], 'energies': [-899.3742065429688, -899.3726196289062, -899.3721313476562], 'feasibilities': [True, True, True], 'objective_values': [0.6258614048985105, 0.6274494985815712, 0.6278980056721158], 'solutions': [[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0]]}}}} In optimize_portfolio; done with checking constraints; 283.45 seconds! Processing curr date: 2022-10-19 00:00:00 {'job_submission': {'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e7de38d25ec78cae7700', 'objective_file_id': '65f4e7de38d25ec78cae76fe', 'alpha': 1.0}}, 'device_config': {'dirac-1': {'num_samples': 20}}, 'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1']}} Dirac allocation balance = 0 s (unmetered) Job submitted job_id='65f4e7dfa657b4e45963cc8b'-: 2024/03/15 17:29:19 RUNNING: 2024/03/15 17:29:20 COMPLETED: 2024/03/15 17:34:00 Dirac allocation balance = 0 s (unmetered) {'job_info': {'job_id': '65f4e7dfa657b4e45963cc8b', 'job_submission': {'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1'], 'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e7de38d25ec78cae7700', 'objective_file_id': '65f4e7de38d25ec78cae76fe', 'alpha': 1, 'atol': 1e-10}}, 'device_config': {'dirac-1': {'num_samples': 20}}}, 'job_status': {'submitted_at_rfc3339nano': '2024-03-16T00:29:19.354Z', 'queued_at_rfc3339nano': '2024-03-16T00:29:19.355Z', 'running_at_rfc3339nano': '2024-03-16T00:29:19.713Z', 'completed_at_rfc3339nano': '2024-03-16T00:34:00.185Z'}, 'job_result': {'file_id': '65f4e8f838d25ec78cae7706', 'device_usage_s': 39}, 'details': {'status': 'COMPLETED'}}, 'results': {'file_id': '65f4e8f838d25ec78cae7706', 'num_parts': 1, 'num_bytes': 6758, 'file_name': 'tutorial_eqc1', 'file_config': {'quadratic_linearly_constrained_binary_optimization_results': {'counts': [8, 5, 2, 1, 1, 1, 1, 1], 'energies': [-899.2722778320312, -899.2716674804688, -899.2713012695312, -899.2708129882812, -899.2705688476562, -899.2702026367188, -899.2700805664062, -899.2695922851562], 'feasibilities': [True, True, True, True, True, True, True, True], 'objective_values': [0.7276977466475752, 0.7282881097574255, 0.7286484491149878, 0.7291494472133333, 0.7294209926816911, 0.7297909625630262, 0.729837303374378, 0.7304178814938523], 'solutions': [[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0]]}}}} In optimize_portfolio; done with checking constraints; 283.65 seconds! Processing curr date: 2022-11-19 00:00:00 {'job_submission': {'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e8fb38d25ec78cae770a', 'objective_file_id': '65f4e8fb38d25ec78cae7708', 'alpha': 1.0}}, 'device_config': {'dirac-1': {'num_samples': 20}}, 'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1']}} Dirac allocation balance = 0 s (unmetered) Job submitted job_id='65f4e8fca657b4e45963cc8d'-: 2024/03/15 17:34:04 RUNNING: 2024/03/15 17:34:05 COMPLETED: 2024/03/15 17:38:46 Dirac allocation balance = 0 s (unmetered) {'job_info': {'job_id': '65f4e8fca657b4e45963cc8d', 'job_submission': {'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1'], 'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4e8fb38d25ec78cae770a', 'objective_file_id': '65f4e8fb38d25ec78cae7708', 'alpha': 1, 'atol': 1e-10}}, 'device_config': {'dirac-1': {'num_samples': 20}}}, 'job_status': {'submitted_at_rfc3339nano': '2024-03-16T00:34:04.415Z', 'queued_at_rfc3339nano': '2024-03-16T00:34:04.416Z', 'running_at_rfc3339nano': '2024-03-16T00:34:05.26Z', 'completed_at_rfc3339nano': '2024-03-16T00:38:45.691Z'}, 'job_result': {'file_id': '65f4ea1538d25ec78cae7710', 'device_usage_s': 39}, 'details': {'status': 'COMPLETED'}}, 'results': {'file_id': '65f4ea1538d25ec78cae7710', 'num_parts': 1, 'num_bytes': 3498, 'file_name': 'tutorial_eqc1', 'file_config': {'quadratic_linearly_constrained_binary_optimization_results': {'counts': [15, 3, 1, 1], 'energies': [-899.3604736328125, -899.3603515625, -899.3602294921875, -899.360107421875], 'feasibilities': [True, True, True, True], 'objective_values': [0.6395498697287205, 0.6396757719784804, 0.6397808717952619, 0.6398477040197633], 'solutions': [[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0]]}}}} In optimize_portfolio; done with checking constraints; 284.78 seconds! Processing curr date: 2022-12-20 00:00:00 {'job_submission': {'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4ea1a38d25ec78cae7714', 'objective_file_id': '65f4ea1938d25ec78cae7712', 'alpha': 1.0}}, 'device_config': {'dirac-1': {'num_samples': 20}}, 'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1']}} Dirac allocation balance = 0 s (unmetered) Job submitted job_id='65f4ea1aa657b4e45963cc8f'-: 2024/03/15 17:38:50 RUNNING: 2024/03/15 17:38:51 COMPLETED: 2024/03/15 17:43:32 Dirac allocation balance = 0 s (unmetered) {'job_info': {'job_id': '65f4ea1aa657b4e45963cc8f', 'job_submission': {'job_name': 'tutorial_eqc1', 'job_tags': ['tutorial_eqc1'], 'problem_config': {'quadratic_linearly_constrained_binary_optimization': {'constraints_file_id': '65f4ea1a38d25ec78cae7714', 'objective_file_id': '65f4ea1938d25ec78cae7712', 'alpha': 1, 'atol': 1e-10}}, 'device_config': {'dirac-1': {'num_samples': 20}}}, 'job_status': {'submitted_at_rfc3339nano': '2024-03-16T00:38:50.584Z', 'queued_at_rfc3339nano': '2024-03-16T00:38:50.585Z', 'running_at_rfc3339nano': '2024-03-16T00:38:50.77Z', 'completed_at_rfc3339nano': '2024-03-16T00:43:31.034Z'}, 'job_result': {'file_id': '65f4eb3338d25ec78cae771e', 'device_usage_s': 39}, 'details': {'status': 'COMPLETED'}}, 'results': {'file_id': '65f4eb3338d25ec78cae771e', 'num_parts': 1, 'num_bytes': 4313, 'file_name': 'tutorial_eqc1', 'file_config': {'quadratic_linearly_constrained_binary_optimization_results': {'counts': [11, 5, 2, 1, 1], 'energies': [-899.4506225585938, -899.4495239257812, -899.4495239257812, -899.4484252929688, -899.4483032226562], 'feasibilities': [True, True, True, True, True], 'objective_values': [0.5493872294569176, 0.5504537540809212, 0.550477639300938, 0.5516320079587587, 0.5517782724012246], 'solutions': [[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,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0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0]]}}}} In optimize_portfolio; done with checking constraints; 283.94 seconds!
We can now calculate the optimal portfolio values over the period of time it was tested.
In [22]:
# Import libs import sysimport datetimeimport warningsimport numpy as npimport pandas as pdimport matplotlib.pyplot as pltwarnings.filterwarnings("ignore")# Set params INIT_PORT_VAL = 1000000.0OUT_OF_SAMPLE_DAYS = 30K_PRIME = 30XI = 5.0IND_SYMBOL_1 = "QQQE"IND_SYMBOL_2 = "NDX"SEL_STOCK_FILE = "selected_stocks.csv"INDEX_FILE_1 = "data/%s.csv" % IND_SYMBOL_1INDEX_FILE_2 = "data/%s.csv" % IND_SYMBOL_2MIN_DATE = pd.to_datetime("2022-01-01")MAX_DATE = pd.to_datetime("2022-12-31")# Read allocation file df = pd.read_csv(SEL_STOCK_FILE)df["Date"] = df["Date"].astype("datetime64[ns]")df = df[(df["Date"] >= MIN_DATE) & (df["Date"] <= MAX_DATE)]# Loop through dates and calculate port value beg_port_val = INIT_PORT_VALdf = df.sort_values("Date")adj_dates = sorted(df["Date"].unique())num_adj_dates = len(adj_dates)dates = Noneport_vals = Nonefor i in range(num_adj_dates):print("Processing adjustment date %s"% pd.to_datetime(adj_dates[i]).strftime("%Y-%m-%d"))beg_date = pd.to_datetime(adj_dates[i])if i < num_adj_dates - 1:end_date = pd.to_datetime(adj_dates[i + 1])else:end_date = beg_date + datetime.timedelta(days=OUT_OF_SAMPLE_DAYS)tmp_df = df[df["Date"] == beg_date]stocks = tmp_df["Stock"]stocks = list(set(stocks))#stocks = list(set(stocks) - {"LCID", "CEG", "ABNB", "GFS", "RIVN"})if end_date > pd.to_datetime("2023-10-20"):stocks = list(set(stocks) - {"ATVI"})all_dates = [beg_date]date0 = beg_datewhile date0 < end_date:date0 = date0 + datetime.timedelta(days=1)all_dates.append(date0)price_df = pd.DataFrame({"Date": all_dates})for stock in stocks:stock_df = pd.read_csv("data/%s.csv" % stock)stock_df["Date"] = stock_df["Date"].astype("datetime64[ns]")stock_df = stock_df[(stock_df["Date"] >= beg_date) & (stock_df["Date"] <= end_date)]if price_df is None:price_df = stock_dfelse:price_df = price_df.merge(stock_df, on="Date", how="outer")price_df = price_df.fillna(method="ffill").fillna(method="bfill")price_df = price_df.sort_values("Date")tmp_dates = np.array(price_df["Date"])tmp_port_vals = np.zeros(shape=(price_df.shape[0]))assert price_df.shape[0] > 0for stock in stocks:prices = np.array(price_df[stock])beg_price = prices[0]stock_wt = 1.0 / len(stocks)if beg_price <= 0:print(stock)print(price_df[["Date", stock]])assert beg_price > 0, "Error in data for %s" % stockstock_count = stock_wt * beg_port_val / beg_pricetmp_port_vals += stock_count * pricesif dates is None:dates = tmp_dateselse:dates = np.concatenate([dates, tmp_dates])if port_vals is None:port_vals = tmp_port_valselse:port_vals = np.concatenate([port_vals, tmp_port_vals])beg_port_val = port_vals[-1]
Out [ ]:
Processing adjustment date 2022-01-13 Processing adjustment date 2022-02-13 Processing adjustment date 2022-03-16 Processing adjustment date 2022-04-16 Processing adjustment date 2022-05-17 Processing adjustment date 2022-06-17 Processing adjustment date 2022-07-18 Processing adjustment date 2022-08-18 Processing adjustment date 2022-09-18 Processing adjustment date 2022-10-19 Processing adjustment date 2022-11-19 Processing adjustment date 2022-12-20
We can then plot the optimal portfolio values and compare them with those of Nasdaq-100 and equal-weighted Nasdaq-100 indexes.
In [23]:
# Plot out_df = pd.DataFrame({"Date": dates, "Port_Val": port_vals})out_df["Date"] = out_df["Date"].astype("datetime64[ns]")ind_df_1 = pd.read_csv(INDEX_FILE_1)ind_df_1["Date"] = ind_df_1["Date"].astype("datetime64[ns]")min_date = out_df["Date"].min()max_date = out_df["Date"].max()ind_df_1 = ind_df_1[(ind_df_1["Date"] >= min_date) & (ind_df_1["Date"] <= max_date)]ind_vals_1 = np.array(ind_df_1[IND_SYMBOL_1])fct = INIT_PORT_VAL / ind_vals_1[0]ind_vals_1 *= fctind_df_2 = pd.read_csv(INDEX_FILE_2)ind_df_2["Date"] = ind_df_2["Date"].astype("datetime64[ns]")min_date = out_df["Date"].min()max_date = out_df["Date"].max()ind_df_2 = ind_df_2[(ind_df_2["Date"] >= min_date) & (ind_df_2["Date"] <= max_date)]ind_vals_2 = np.array(ind_df_2[IND_SYMBOL_2])fct = INIT_PORT_VAL / ind_vals_2[0]ind_vals_2 *= fctplt.plot(out_df["Date"], out_df["Port_Val"], ind_df_1["Date"], ind_vals_1,ind_df_2["Date"], ind_vals_2,)plt.xlabel("Date")plt.ylabel("Portfolio Value")plt.legend(["Equal weighted optimal portfolio", "Equal weighted Nasdaq 100","Nasdaq 100",]) plt.show()
Out [ ]:
<Figure size 640x480 with 1 Axes>