Skip to content

foxadb/binomial-pricer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pricer of American Binomial Options

Implementation of an OpenCL pricer of american options pricer following the Cox-Ross-Rubinstein binomial model (CRR).

Dependencies

This project uses C++11 and CMake >= 3.1.

OpenCL must be installed on your computer.

Build

mkdir build
cd build
cmake ..
make

Run

Run the CPU Pricer with:

./cpu-pricer [ X0 ] [ K ] [ r ] [ sigma ] [ T ] [ N ]

Example:

./cpu-pricer 100 100 0.05 0.2 3 5000

Should return 8.71 approximately

You can run the GPU Pricer (using OpenCL) with:

./gpu-pricer [ X0 ] [ K ] [ r ] [ sigma ] [ T ] [ N ] [ work group size ]

Try with small value of work group size at first (between 1 and 10) to find the optimal one.

Do not forget to enable your graphic card. For laptop, use tools like optirun or primusrun:

optirun ./gpu-pricer [ X0 ] [ K ] [ r ] [ sigma ] [ T ] [ N ] [ work group size ]

Example:

optirun ./gpu-pricer 100 100 0.05 0.2 3 1000 1
optirun ./gpu-pricer 100 100 0.05 0.2 3 5000 5
optirun ./gpu-pricer 100 100 0.05 0.2 3 10000 10

About

Binomial American Option Pricer with OpenCL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published