  We develop a general theory of risk measures that determines the optimal
amount of capital to raise and invest in a portfolio of reference traded
securities in order to meet a pre-specified regulatory requirement. The
distinguishing feature of our approach is that we embed portfolio constraints
and transaction costs into the securities market. As a consequence, we have to
dispense with the property of translation invariance, which plays a key role in
the classical theory. We provide a comprehensive analysis of relevant
properties such as star shapedness, positive homogeneity, convexity,
quasiconvexity, subadditivity, and lower semicontinuity. In addition, we
establish dual representations for convex and quasiconvex risk measures. In the
convex case, the absence of a special kind of arbitrage opportunities allows to
obtain dual representations in terms of pricing rules that respect market
bid-ask spreads and assign a strictly positive price to each nonzero position
in the regulator's acceptance set.
