  This paper considers the problem of optimal liquidation of a position in a
risky security in a financial market, where price evolution are risky and
trades have an impact on price as well as uncertainty in the filling orders.
The problem is formulated as a continuous time stochastic optimal control
problem aiming at maximizing a generalized risk-adjusted profit and loss
function. The expression of the risk adjustment is derived from the general
theory of dynamic risk measures and is selected in the class of $g$-conditional
risk measures. The resulting theoretical framework is nonclassical since the
target function depends on backward components. We show that, under a quadratic
specification of the driver of a backward stochastic differential equation, it
is possible to find a closed form solution and an explicit expression of the
optimal liquidation policies. In this way it is immediate to quantify the
impact of risk-adjustment on the profit and loss and on the expression of the
optimal liquidation policies.
