F# for Trading NYC

Post on 06-May-2015

2.767 views 1 download

description

F# for Trading talk at NYC meetup on May 1st 2013

Transcript of F# for Trading NYC

F# FOR TRADINGPhil TrelfordTrayportNYC 2013

F#UNCTIONAL LONDONERS

500+ Members

Founded Feb 4, 2010

37 Meetings

NEW YORK CITY F# USER GROUP500+ Members

Founded Nov 10, 2010

25 Meetings

FSHARP.ORG/GROUPS

WHO, WHY, WHAT F# for Trading

WHO?

Investment Banks

Hedge funds

Prop shops

Utilities

Insurance

WHY?

Time to Market

Efficiency

Correctness

Complexity

FSHARP.ORG/TESTIMONIALS

speed development by 50 percent or more, European IB

order of magnitude increase in productivity, GameSys

processes that used to require hours now take just minutes, Grange Insurance

performance is 10× better than the C++ that it replaces, Aviva

leads to virtually bug-free code, Fixed Income

I am still waiting for the first bug to come in, E-On

complex algorithms can be expressed succinctly, Microsoft

everything becomes simple and clear when expressed in F#, Byron Cook

WHAT?

F# is a practical, functional-first language

that lets you write simple code

to solve complex problems

SHOW ME THE MONEY F# for Trading

JOULE: TRADING SCREEN

TICKSPEC: DEBUG EXAMPLES

SPECIFICATION BY EXAMPLE

UNIT TEST

THOUGHTWORKS TECH RADAR MARCH 2012

“F# is excellent at concisely expressing

business and domain logic.”

“Developers trying to achieve explicit business logic within an application may opt to

express their domain in F#

with the majority of plumbing code in C#.”

ORDER – RECORD TYPE

type Order = {

Side : Side

LimitPrice : Price

Quantity : Quantity

IsAllOrNone : bool

}

TIME IN FORCE – UNION TYPEtype TimeInForce =

| Immediate

| GoodForDay

| GoodTillDate of DateTime

UNITS OF MEASURE

EXCEL – TYPE PROVIDER

Excel Visual Studio

F# FOR COMPUTATION

Standard F# tools F# language and core libraries

Workstation libraries Math.NET Numerics (open source) StatFactory FMat

Distributed libraries Microsoft Cloud Numerics Nessos {m}brace cloud

MONTE CARLO ESTIMATION OF PI

R – TYPE PROVIDER

WORLD BANK DATA

SHOWDIALOG – ASYNC WORKFLOWS

ASYNC FRACTALS

Programming model that looks sequential but executes distributed async { } … cloud { }

{M}BRACE THE CLOUD

.NET 4.5 GARBAGE COLLECTOR

Latency Mode Application Scenarios

Batch Command lineServer Side

Interactive LOB applications

LowLatency Trading Screens

SustainedLowLatency Financial Applications

TRY F#: HTTP://TRYFSHARP.ORG

F# TUTORIALS NYC SEPT 18/19

QUESTIONS?

Twitter: @ptrelford

Blog: http://trelford.com/blog

Foundation: http://fsharp.org