-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MPC working with covariance matrix risk aversion and l2 transaction c…
…osts.
- Loading branch information
1 parent
b70ae2c
commit 53e947d
Showing
4 changed files
with
86 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/abacus/optimizer/optimization_models/mpc_maximize_return.mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
problem mpcMaximizeReturn; | ||
|
||
set assets; | ||
|
||
param gamma; | ||
param inital_weights {assets}; | ||
param number_of_time_steps > 0 integer; | ||
param returns {1..number_of_time_steps, assets}; | ||
param covariance {assets, assets}; | ||
param l1_penalty {assets}; | ||
param l2_penalty {assets}; | ||
|
||
var weights {0..number_of_time_steps, assets}; | ||
|
||
maximize OBJECTIVE: | ||
sum{t in 1..number_of_time_steps} (sum {a in assets} (returns[t,a] * weights[t,a]) | ||
- gamma * sum{a in assets, b in assets} weights[t, a] * covariance[a , b] * weights [t, b] | ||
- sum{a in assets} ( l1_penalty[a] * abs(weights[t, a] - weights[t-1, a]) + l2_penalty[a] * (weights[t, a] - weights[t-1, a]) **2)) | ||
; | ||
|
||
subject to WEIGHT_CONSTRAINT_SUM {t in 1..number_of_time_steps}: | ||
sum{a in assets} weights[t, a] = 1 | ||
; | ||
|
||
subject to WEGIHT_CONSTRAINT {t in 1..number_of_time_steps, a in assets}: | ||
weights[t, a] <= 1 | ||
; | ||
|
||
subject to WEGIHT_CONSTRAINT_NON_NEGATIVE {t in 1..number_of_time_steps, a in assets}: | ||
weights[t, a] >= 0 | ||
; | ||
|
||
subject to INITIAL_WEIGHTS {a in assets}: | ||
weights[0, a] = inital_weights[a] | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters