We propose a quantitative approach to some high frequency trading problematics. We are interested in several aspects of this field, from minimizing indirect trading costs to market making, and more generally in profit maximization strategies over a finite time horizon. We build an original framework that reflects specificities of high frequency trading, and especially the distinction between passive and active trading, thanks to mixed stochastic control methods. We carefully model high fequency market phenomena, and for each of them we propose calibration methods that are compatible with practical constraints of algorithmic trading.