The paper addresses pricing issues in imperfect and/or incomplete markets if the risk level of the hedging strategy is measured by a general risk function. Convex Optimization Theory is used in order to extend pricing rules for a wide family of risk functions, including Deviation Measures, Expectation Bounded Risk Measures and Coherent Measures of Risk. Necessary and sufficient optimality conditions are provided in a very general setting. For imperfect markets the extended pricing rules reduce the bid ask spread. The findings are particularized so as to study with more detail some concrete examples, including the Condi tional Value at Risk and some properties of the Standard Deviation. Applications dealing with the valu ation of vola...