Saturday, November 09, 2013

FAQ in Quantitative Finance

Reading now "Frequently Asked Questions in Quantitative Finance" by Paul Wilmott. It contains lots of fundamental terms and lets the reader understand principle ideas of different approaches, methods, models, etc. It encourages the reader to get a broad picture of problems solved by quants.

Sunday, September 15, 2013

Miserere mei, Deus

Trade Lifecycle

Thousands of people in financial industry are explicitly involved in financial trading all over the world. Hundreds of thousands are involved implicitly. Based on my experience the percentage of people consciously doing their job is not high. Nevertheless it is highly important to understand at least the high level principles of process happening behind the scenes of financial institution when a trade is done.

Who Works on the Trade?

First, it is necessary to understand what stakeholders work with the trade during its life.

Trade Info Structure

Below you can find a sample of trade attributes structured into different categories (the trade is not real):

  • General
    • Identifier: E54123
    • Asset class: Equity
    • Type: Spot
    • Status: Awaiting confirmation
    • Trade date: 3 June 2009
    • Transaction time: 11:09 GMT+1
    • Transaction location: London
  • Economic
    • Buy or Sell: Buy
    • Notional: 20 000
    • Ticker: CAD
    • Exchange: LSE
    • Currency: GBP
    • Price: 15.27p 
  • Sales
    • Salesperson: Elizabeth Smith
    • Sales credits: 150 
  • Legal
    • Jurisdiction: UK 
  • Booking
    • Desk: Equity trading
    • Trader: John Baker
    • Assistant: Mark Eton
    • Trading book: GBP Equity trading 
  • Counterparty
    • Counterparty: The Bank Address: Liverpool st, London
    • Payment Type: SWIFT
    • Payment Code: UIT TRY XXX
    • Counterparty reference: LCE1985-04B
    • Settlement Date: 5 June 2009 
  • Timeline
    • Trade date: 15 June 2009
    • Settlement date: 17 June 2009
    • Maturity date: 15 Sep 2009

Life cycle

Different stakeholders work with the trade at different time. This is similar to a conveyor at a plant.

Black Scholes Option Pricing


Major break-through in the valuation of derivatives came with two finance professors at MIT, Black and Scholes, came out with a formula that related the price of a call option to the price of the stock to which the option applies. Even though the model is not used by financial institutions today it still contains ideas that used in financial modelling.
The Black-Scholes formula is a partial differential equation that can be used to price the present value of an option under certain assumptions. The equation describes the Markov process of underlying asset price and it looks as given below:
There is an analytical solution of the equation, the walkthrough is given in this video:

Monte Carlo Simulation

Assuming the Brownian motion over this short period will be a normal (Gaussian) distribution with a mean of 0 and a variance of the time interval the iterative formula will be as follows:
Let's take the case of Option Call holder. The favourable cases of underlying asset movement (F) is given on the picture below:
Below you can find an implementation of Monte Carlo simulation of option pricing in python.
The program will generate a number of asset price paths. At option expiry time obviously the price will differ. Option price then will be the average of all gains received at expiry time.

Usefull Links

  1. J.Hull Futures, Options and Other Derivatives 

Thursday, July 11, 2013

JP Morgan Heads HPC

JP Morgan is now able to run risk analysis and price its global credit portfolio in near real-time after implementing High Performance Computing (HPC) capabilities.
Prior to the implementation, JP Morgan would take eight hours to do a complete risk run, and an hour to run a present value, on its entire book. If anything went wrong with the analysis, there was no time to re-run it. It has now reduced that to about 238 seconds, with an FPGA time of 12 seconds.
Read full article here

Sunday, July 07, 2013

Parallel Programming for Quantitative Finance

Investment banks like calculations that require powerful computational resources. In many cases Monte-Carlo simulations are run on huge GRID systems that cost a lot.
Such systems are usually home grown and really look expensive to replicate elsewhere.

Few monthes ago I read an article in RISK magazine that outlined the same problem and as an option a  chipper and more flexible approach was mentioned that is based on multi-core CPU and GPU.

GPU programming probably is not too complex although it definitely requires some background desk devs or quants might not have. A company Xcelerit made an attempt to ease the parallel programming. They provide SDK that allows quants develop and execute their C++ programs on a high-performance environment.

Furthermore they have a library that comes with base statistics functions, market data adapters and a number of interfaces for commonly used software packages, e.g. MATLAB, Excel.

They also outlined some case studies of inefficiencies of sequential program execution on a GRID compared to multi-core CPU architectures.

Examples of SDK usage

HSBC usage

Let's see whether this attempt of Xcelerit will have a successful continuation.

Tuesday, January 29, 2013

Cassandra Quick Intro

A good quick start article about Cassandra