Complete Trading Engine (Pseudo Code)