Margin Optimization and the Cost of the Trade