High Frequency Trading (HFT) represents an ever growing proportion of all financial transactions as most markets have now switched to electronic order book systems. The main goal of the paper is to propose continuous time equations which generalize the self-financing relationships of frictionless markets to electronic markets with limit order books. We use NASDAQ ITCH data to identify significant empirical features such as price impact and recovery, rough paths of inventories and vanishing bid-ask spreads. Starting from these features, we identify microscopic identities holding on the trade clock, and through a diffusion limit argument, derive continuous time equations which provide a macroscopic description of properties of the order book. These equations naturally differentiate between trading via limit and market orders. We give several applications (including hedging European options with limit orders, market maker optimal spread choice, and toxicity indexes) to illustrate their impact and how they can be used to the benefit of Low Frequency Traders (LFTs).