# Case Study: Optimal Position Liquidation with CVaR Constraints

** Case study background and problem formulations**

Instructions for optimization with PSG Run-File, PSG MATLAB Toolbox, PSG MATLAB Subroutines and PSG R.

**PROBLEM 1: Risk Neutral Optimal Liquidation in Frictionless Market**

Maximize Avg_g (maximizing the expected return of payoffs )

subject to

Max_risk_nonanticipativity <= 0 (constraint ensuring that path variables are less than or equal to the corresponding group variables)

Max_risk_monotonicity <= 0 (constraint prohibiting the increase position in instrument)

Box constraints (bounds on variables)

——————————————————————–

Avg_g = Average of Gain

Max_risk_ = Maximum Risk for Loss

Box constraints = constraints on individual decision variables

——————————————————————–

# of Variables |
# of Scenarios |
Objective Value |
Solving Time, PC 3.14GHz (sec) |
||||

Dataset1 | 75 | 10 | 1.0092941 | <0.001 | |||
---|---|---|---|---|---|---|---|

Environments |
|||||||

Run-File | Problem Statement | Data | Solution | ||||

Matlab Toolbox | Data | ||||||

Matlab Subroutines | Matlab Code | Data | |||||

R | R Code | Data |

Download other datasets in Run-File Environment.

Instructions for importing problems from Run-File to PSG MATLAB.

Problem Datasets | # of Variables | # of Scenarios | Objective Value | Solving Time, PC 2.50GHz (sec) | |||
---|---|---|---|---|---|---|---|

Dataset2 | Problem Statement | Data | Solution | 550 | 100 | 1.02238543 | 0.02 |

Dataset3 | Problem Statement | Data | Solution | 5,050 | 1,000 | 1.01934036 | 1.50 |

Dataset4 | Problem Statement | Data | Solution | 10,050 | 2,000 | 1.019557174 | 6.10 |

**PROBLEM 2: Risk Neutral Optimal Liquidation in Frictionless Market (modified formulation containing only group decision variables)**

Maximize -Avg_max_risk_g (maximizing negative average value of maximum gain function)

subject to

Box constraints (bounds on variables)

——————————————————————–

Avg_max_risk_g = Average of Maximum Risk for Gain

Box constraints = constraints on individual decision variables

——————————————————————–

# of Variables |
# of Scenarios |
Objective Value |
Solving Time, PC 3.14GHz (sec) |
||||

Dataset1 | 25 | 10 | 1.00929406 | <0.001 | |||
---|---|---|---|---|---|---|---|

Environments |
|||||||

Run-File | Problem Statement | Data | Solution | ||||

Matlab Toolbox | Data | ||||||

Matlab Subroutines | Matlab Code | Data | |||||

R | R Code | Data |

Download other datasets in Run-File Environment.

Instructions for importing problems from Run-File to PSG MATLAB.

Problem Datasets | # of Variables | # of Scenarios | Objective Value | Solving Time, PC 2.50GHz (sec) | |||
---|---|---|---|---|---|---|---|

Dataset2 | Problem Statement | Data | Solution | 50 | 100 | 1.022385358 | 0.01 |

Dataset3 | Problem Statement | Data | Solution | 50 | 1,000 | 1.0193403434 | 0.03 |

Dataset4 | Problem Statement | Data | Solution | 50 | 4,000 | 1.0195571646 | 0.15 |

Dataset5 | Problem Statement | Data | Solution | 50 | 5,000 | 1.02116966156 | 0.20 |

Dataset6 | Problem Statement | Data | Solution | 50 | 10,000 | 1.03011309734 | 0.22 |

Dataset7 | Problem Statement | Data | Solution | 50 | 15,000 | 1.03440321209 | 0.61 |

**PROBLEM 3: Risk-Averse Optimal Liquidation in Frictionless Market**

Maximize Avg_g (maximizing the expected return of payoffs)

subject to

Cvar_risk_averse <= const (constraint on CVaR risk for Loss)

Max_risk_nonanticipativity <= 0 (constraint ensuring that path variables are less than or equal to the corresponding group variables)

Max_risk_monotonicity <= 0 (constraint prohibiting the increase position in instrument)

Box constraints (bounds on variables)

——————————————————————–

Cvar_risk = Conditional Value-at-Risk for Loss

Avg_g = Average of Gain

Max_risk_ = Maximum Risk for Loss

Box constraints = constraints on individual decision variables

——————————————————————–

# of Variables |
# of Scenarios |
Objective Value |
Solving Time, PC 3.14GHz (sec) |
||||

Dataset1 | 75 | 10 | 1.0092941 | <0.001 | |||
---|---|---|---|---|---|---|---|

Environments |
|||||||

Run-File | Problem Statement | Data | Solution | ||||

Matlab Toolbox | Data | ||||||

Matlab Subroutines | Matlab Code | Data | |||||

R | R Code | Data |

Download other datasets in Run-File Environment.

Instructions for importing problems from Run-File to PSG MATLAB.

Problem Datasets | # of Variables | # of Scenarios | Objective Value | Solving Time, PC 2.50GHz (sec) | |||
---|---|---|---|---|---|---|---|

Dataset2 | Problem Statement | Data | Solution | 550 | 100 | 1.02058396339 | 0.03 |

Dataset3 | Problem Statement | Data | Solution | 5,050 | 1,000 | 1.01180877397 | 2.15 |

Dataset4 | Problem Statement | Data | Solution | 10,050 | 2,000 | 1.006870751 | 701.16 |

**CASE STUDY SUMMARY**

This case study demonstrates a sample-path based stochastic programming model for solving optimal trading execution problem with and without risk constraints in a perfect frictionless market.

This case study reproduces and improves the optimization formulations in the paper by Krokhmal and Uryasev (2007) on sample-path approaches to optimal position liquidation. The paper utilized historical price data to generate the sample-path scenarios. Also, the paper presented optimal position liquidation strategies with no market impact, with temporary impact, and with a permanent impact. In order to eliminate the anticipativity of the model, the paper introduced a sample-path grouping method and a “lawn-mower” decision rule by adding nonanticipativity constraints. After analyzing the feasibility and optimality of the problem, the paper proposed a difference convex (DC) programming approach to evaluate the lower bound of the original problem. Finally, many numerical experiments are presented along with the analysis of the solutions.

We first conducted the numerical experiment by following the lower-bound evaluation optimization problem from the paper by Krokhmal and Uryasev (2007). Then we reformulated this problem and reduced the number of decision variables by replacing the sample-path variables with group variables. This modification eliminated the tremendous number of redundant decision variables and constraints. We implemented both formulations in PSG run-file environment. The first formulation includes PSG functions Avg_g and Max_risk. The second formulation includes PSG function Avg_max_risk_g and works much faster than the first one.

Similar to Krokhmal and Uryasev (2007) we added the CVaR constraints to the first formulation and solved the problem with PSG. The computational results were not encouraging for this problem formulation. The adding CVaR constraint significantly increased the solving time of the fist problem. Unfortunately, specialized function for CVaR risk is not available in the current version of PSG to include the CVaR constraint, similar to the second formulation containing only group variables (without CVaR risk constraint).

Three problems were presented in this case study: Problem 1 corresponds to the first formulation without risk constraint; Problem 2 corresponds to the second formulation without risk constraint; and Problem 3 corresponds to the first formulation with risk constraint.

Data and code for running Problem1, Problem2, and Problem3 can be downloaded: CS_Optimal_Position_Liquidation_data_code .

**References**

• Krokhmal, P. and Uryasev, S. (2007). A sample-path approach to optimal position liquidation. Annals of Operations Research, 152, 193-225.

• Bertimas, D., Lo, A.W. and Hummel, P. (1999). Optimal control of execution costs for portfolios. Computing in Science & Engineering, 1, 40-53.

• Almgren, R. and Chriss, N. (2000). Optimal Execution of Portfolio Transactions. Journal of Risk, 3, 5–39.

• Birge, J.R. and Louveaux, F. (1997). Introduction to stochastic programming. New York, Springer.