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 K=253K = 253), that is the size of the stock pool. We want to choose a subset of KK^\prime (K<KK^\prime < K) stocks such that the portfolio risk is minimized, while the portfolio expected return is maximized, that is

min{xi}i{1,2,...,K}[E(R)2+ξVAR(R)]\min_{\{x_{i}\}_{i \in \{1, 2,..., K\}}} [-E(R)^2 + \xi VAR(R)]

where RR is the daily returns of the portfolio over some period of time, VAR(R)VAR(R) and E(R)E(R) are the variance and expectation of daily returns, ξ\xi is a hyper-parameter, and {xi}\{x_{i}\} 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 x1,x2,...,xKx_1, x_2, ..., x_K corresponds to long positions on stocks 1 to KK.

As we are choosing a subset of KK^\prime stocks, we also need the following constraint,

i=1Kxi=K\sum_{i=1}^{K} x_i = K^\prime

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,

R(m)(t)=1Ki=1Kxiri(m)(t)R^{(m)}(t) =\frac{1}{K^\prime} \sum_{i=1}^{K} x_i r^{(m)}_i(t)

where ri(m)(t)r^{(m)}_i(t) is the daily return of stock i at time tt in time period mm. The expectation of portfolio daily return over time period mm can thus be expanded as,

E(R(m))=1Ki=1KxiE(ri(m))E(R^{(m)}) = \frac{1}{K^\prime} \sum_{i=1}^{K} x_i E(r^{(m)}_i)

and the variance portfolio daily return over time period m is expanded as,

VAR(R(m))=1K2i=1Kj=1KxixjCOV(ri(m),rj(m))VAR(R^{(m)}) = \frac{1}{K^{\prime 2}} \sum_{i=1}^{K} \sum_{j=1}^{K} x_i x_j COV(r^{(m)}_i, r^{(m)}_j)

where COVCOV is the covariant function.

The problem then reduces to

min{xi}xT1K2[Q(m)ξP(m)]x\min_{\{x_i\}} {\bf{x}^T} \frac{1}{K^{\prime 2}} [ Q^{(m)} - \xi P^{(m)}] {\bf{x}}

where

Qij(m)=COV(ri(m),rj(m))Q^{(m)}_{ij} = COV(r^{(m)}_{i}, r^{(m)}_{j})
Pij(m)=E(ri(m))δijP^{(m)}_{ij}= E(r_i^{(m)}) \delta_{ij}

To avoid an over-fit on the portfolio data, we can minimize the average of the cost function over MM overlapping time periods, that is m=1,2,...,Mm=1,2,...,M. The problem becomes,

min{xi}xT1MK2m=1M[Q(m)ξP(m)]x\min_{\{x_i\}} {\bf{x}^T} \frac{1}{MK^{\prime 2}} \sum_{m=1}^{M}[ Q^{(m)} - \xi P^{(m)}] {\bf{x}}

subject to,

i=1Kxi=K\sum_{i=1}^{K} x_i = K^\prime

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 pd
from IPython.display import display, HTML
df = pd.read_csv("nasdaq100_stocks.csv")
display(HTML(df[["Company", "Symbol"]].to_html()))

Out [ ]:

CompanySymbol
0Microsoft CorpMSFT
1Apple IncAAPL
2Amazon.com IncAMZN
3Alphabet IncGOOG
4Alphabet IncGOOGL
5NVIDIA CorpNVDA
6Tesla IncTSLA
7Meta Platforms IncMETA
8PepsiCo IncPEP
9Broadcom IncAVGO
10Costco Wholesale CorpCOST
11Cisco Systems IncCSCO
12T-Mobile US IncTMUS
13Adobe IncADBE
14Texas Instruments IncTXN
15Comcast CorpCMCSA
16Honeywell International IncHON
17Amgen IncAMGN
18Netflix IncNFLX
19QUALCOMM IncQCOM
20Starbucks CorpSBUX
21Intel CorpINTC
22Intuit IncINTU
23Gilead Sciences IncGILD
24Advanced Micro Devices IncAMD
25Automatic Data Processing IncADP
26Intuitive Surgical IncISRG
27Mondelez International IncMDLZ
28Applied Materials IncAMAT
29Analog Devices IncADI
30Regeneron Pharmaceuticals IncREGN
31PayPal Holdings IncPYPL
32Moderna IncMRNA
33Booking Holdings IncBKNG
34Vertex Pharmaceuticals IncVRTX
35CSX CorpCSX
36Fiserv IncFISV
37Lam Research CorpLRCX
38Activision Blizzard IncATVI
39Micron Technology IncMU
40KLA CorpKLAC
41Monster Beverage CorpMNST
42O'Reilly Automotive IncORLY
43Keurig Dr Pepper IncKDP
44ASML Holding NVASML
45Synopsys IncSNPS
46Kraft Heinz Co/TheKHC
47Charter Communications IncCHTR
48American Electric Power Co IncAEP
49Marriott International Inc/MDMAR
50Palo Alto Networks IncPANW
51Cintas CorpCTAS
52Cadence Design Systems IncCDNS
53MercadoLibre IncMELI
54Dexcom IncDXCM
55Exelon CorpEXC
56Biogen IncBIIB
57AstraZeneca PLC ADRAZN
58NXP Semiconductors NVNXPI
59Paychex IncPAYX
60Enphase Energy IncENPH
61Autodesk IncADSK
62Pinduoduo Inc ADRPDD
63Ross Stores IncROST
64Fortinet IncFTNT
65Microchip Technology IncMCHP
66Xcel Energy IncXEL
67Lululemon Athletica IncLULU
68Airbnb IncABNB
69Workday IncWDAY
70PACCAR IncPCAR
71Walgreens Boots Alliance IncWBA
72IDEXX Laboratories IncIDXX
73Electronic Arts IncEA
74Marvell Technology IncMRVL
75Old Dominion Freight Line IncODFL
76GLOBALFOUNDRIES IncGFS
77CoStar Group IncCSGP
78Dollar Tree IncDLTR
79Illumina IncILMN
80Baker Hughes CoBKR
81Copart IncCPRT
82Constellation Energy CorpCEG
83Cognizant Technology Solutions CorpCTSH
84JD.com Inc ADRJD
85Fastenal CoFAST
86Verisk Analytics IncVRSK
87Seagen IncSGEN
88Crowdstrike Holdings IncCRWD
89Diamondback Energy IncFANG
90Sirius XM Holdings IncSIRI
91eBay IncEBAY
92Datadog IncDDOG
93Warner Bros Discovery IncWBD
94ANSYS IncANSS
95Atlassian CorpTEAM
96Rivian Automotive IncRIVN
97Zoom Video Communications IncZM
98Zscaler IncZS
99Align Technology IncALGN
100Lucid Group IncLCID

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 os
import pandas as pd
import 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.index
tmp_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 os
import sys
import time
import datetime
import json
import warnings
from functools import wraps
import numpy as np
import pandas as pd
from qci_client import QciClient
warnings.filterwarnings("ignore")
ALPHA = 1.0 # The coefficient for penalty term (for linear constraint)
N_SAMPLES = 20 # Number of solution samples
XI = 5.0 # The xi variable as defined in Methodology
K_PRIME = 30 # Number of selected stocks
WINDOW_DAYS = 30 # Size of each sliding window in days
WINDOW_OVERLAP_DAYS = 15 # Overlap between sliding windows in days
IN_SAMPLE_DAYS = 180 # Size of the lookback period in days
OUT_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 = None
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.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_df
else:
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 = 0
min_date = pd.to_datetime(min_date)
max_date = pd.to_datetime(max_date)
tmp_date = min_date
while tmp_date <= max_date:
tmp_min_date = tmp_date
tmp_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 += 1
fct = m
if fct > 0:
fct = 1.0 / fct
P = fct * P
Q = 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 HH,

In [8]:

def optimize_portfolio(H, stocks, curr_date):
beg_time = time.time()
K = len(stocks)
assert H.shape[0] == K
assert 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 = None
for i, item in enumerate(samples):
sol = item
is_feasible = is_feasibles[i]
if is_feasible:
break
if 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_date
max_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_stocks
return 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_date
while 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,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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, 0, 0, 0, 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, 1, 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, 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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 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, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 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, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0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 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 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, 0, 0, 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], [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, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 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, 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,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, 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, 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, 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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 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, 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, 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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 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, 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, 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, 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, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 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}}}
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,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, 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, 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, 0, 1, 0, 1, 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, 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, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 1, 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, 0, 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, 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, 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 sys
import datetime
import warnings
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
warnings.filterwarnings("ignore")
# Set params
INIT_PORT_VAL = 1000000.0
OUT_OF_SAMPLE_DAYS = 30
K_PRIME = 30
XI = 5.0
IND_SYMBOL_1 = "QQQE"
IND_SYMBOL_2 = "NDX"
SEL_STOCK_FILE = "selected_stocks.csv"
INDEX_FILE_1 = "data/%s.csv" % IND_SYMBOL_1
INDEX_FILE_2 = "data/%s.csv" % IND_SYMBOL_2
MIN_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_VAL
df = df.sort_values("Date")
adj_dates = sorted(df["Date"].unique())
num_adj_dates = len(adj_dates)
dates = None
port_vals = None
for 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_date
while 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_df
else:
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] > 0
for 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" % stock
stock_count = stock_wt * beg_port_val / beg_price
tmp_port_vals += stock_count * prices
if dates is None:
dates = tmp_dates
else:
dates = np.concatenate([dates, tmp_dates])
if port_vals is None:
port_vals = tmp_port_vals
else:
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 *= fct
ind_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 *= fct
plt.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 [ ]:

image/png
<Figure size 640x480 with 1 Axes>