dragongate
technologies
Mathematical
Finance
-
mcOptCal
An Android App to calculate American and Bermudan option prices using
the LSM (Least Squares Monte Carlo) method. European option prices can
also be calculated using the Black Scholes formula. The option payoff function is user-definable. An android service
is used to enable long running calculations to continue in the
background while other activities are in the foreground.
Note: if the parameters for the number of Monte Carlo simulation paths
or time steps are set too large, the device responsiveness may slow
down while the calculation is running.
Download from Google Play: https://play.google.com/store/apps/details?id=com.dragongate_technologies.mcOptCal
Source code on GitHub: https://github.com/amulcahy/mcOptCal
-
LSM (Least Squares Monte Carlo) in Scala
A Scala implementation of the LSM
(Least Squares Monte
Carlo) method for pricing Bermudan / American options described in the
paper
"Valuing American Options by Simulation: A Simple Least-Squares
Approach" by Longstaff and Schwartz.
source code: lsm.scala
version: 1.0
(released 2012/12/16)
license: Public
Domain
Usage
$ scalac
lsm.scala
$ scala com.dragongate_technologies.lsmOptionValue.lsm
Results of running the simulation shown
on page 16 of the paper:
[ numPaths:
100000 numSteps: 50 dT: 0.020 expiry: 1 stock: 36.000
strike: 40.000 rate: 0.060 volatility: 0.200 ]
4.4719 ( 0.0093 ) [ 55.180sec ]
[ numPaths: 100000 numSteps: 100 dT: 0.020 expiry: 2 stock:
36.000 strike: 40.000 rate: 0.060 volatility: 0.200 ]
4.8259 ( 0.0112 ) [ 172.982sec ]
[ numPaths: 100000 numSteps: 50 dT: 0.020 expiry: 1 stock:
36.000 strike: 40.000 rate: 0.060 volatility: 0.400 ]
7.0959 ( 0.0189 ) [ 49.377sec ]
[ numPaths: 100000 numSteps: 100 dT: 0.020 expiry: 2 stock:
36.000 strike: 40.000 rate: 0.060 volatility: 0.400 ]
8.4998 ( 0.0225 ) [ 162.875sec ]
[ numPaths: 100000 numSteps: 50 dT: 0.020 expiry: 1 stock:
38.000 strike: 40.000 rate: 0.060 volatility: 0.200 ]
3.2391 ( 0.0094 ) [ 45.435sec ]
[ numPaths: 100000 numSteps: 100 dT: 0.020 expiry: 2 stock:
38.000 strike: 40.000 rate: 0.060 volatility: 0.200 ]
3.7472 ( 0.0110 ) [ 151.139sec ]
[ numPaths: 100000 numSteps: 50 dT: 0.020 expiry: 1 stock:
38.000 strike: 40.000 rate: 0.060 volatility: 0.400 ]
6.1343 ( 0.0184 ) [ 46.980sec ]
[ numPaths: 100000 numSteps: 100 dT: 0.020 expiry: 2 stock:
38.000 strike: 40.000 rate: 0.060 volatility: 0.400 ]
7.6628 ( 0.0223 ) [ 159.930sec ]
[ numPaths: 100000 numSteps: 50 dT: 0.020 expiry: 1 stock:
40.000 strike: 40.000 rate: 0.060 volatility: 0.200 ]
2.3101 ( 0.0087 ) [ 35.958sec ]
[ numPaths: 100000 numSteps: 100 dT: 0.020 expiry: 2 stock:
40.000 strike: 40.000 rate: 0.060 volatility: 0.200 ]
2.8840 ( 0.0105 ) [ 117.261sec ]
[ numPaths: 100000 numSteps: 50 dT: 0.020 expiry: 1 stock:
40.000 strike: 40.000 rate: 0.060 volatility: 0.400 ]
5.3088 ( 0.0180 ) [ 39.849sec ]
[ numPaths: 100000 numSteps: 100 dT: 0.020 expiry: 2 stock:
40.000 strike: 40.000 rate: 0.060 volatility: 0.400 ]
6.9022 ( 0.0219 ) [ 139.743sec ]
[ numPaths: 100000 numSteps: 50 dT: 0.020 expiry: 1 stock:
42.000 strike: 40.000 rate: 0.060 volatility: 0.200 ]
1.6129 ( 0.0076 ) [ 24.244sec ]
[ numPaths: 100000 numSteps: 100 dT: 0.020 expiry: 2 stock:
42.000 strike: 40.000 rate: 0.060 volatility: 0.200 ]
2.2150 ( 0.0098 ) [ 84.928sec ]
[ numPaths: 100000 numSteps: 50 dT: 0.020 expiry: 1 stock:
42.000 strike: 40.000 rate: 0.060 volatility: 0.400 ]
4.5871 ( 0.0172 ) [ 33.281sec ]
[ numPaths: 100000 numSteps: 100 dT: 0.020 expiry: 2 stock:
42.000 strike: 40.000 rate: 0.060 volatility: 0.400 ]
6.2509 ( 0.0215 ) [ 118.815sec ]
[ numPaths: 100000 numSteps: 50 dT: 0.020 expiry: 1 stock:
44.000 strike: 40.000 rate: 0.060 volatility: 0.200 ]
1.1102 ( 0.0066 ) [ 16.453sec ]
[ numPaths: 100000 numSteps: 100 dT: 0.020 expiry: 2 stock:
44.000 strike: 40.000 rate: 0.060 volatility: 0.200 ]
1.6885 ( 0.0087 ) [ 61.531sec ]
[ numPaths: 100000 numSteps: 50 dT: 0.020 expiry: 1 stock:
44.000 strike: 40.000 rate: 0.060 volatility: 0.400 ]
3.9304 ( 0.0163 ) [ 28.154sec ]
[ numPaths: 100000 numSteps: 100 dT: 0.020 expiry: 2 stock:
44.000 strike: 40.000 rate: 0.060 volatility: 0.400 ]
5.6492 ( 0.0207 ) [ 105.007sec ]
Copyright ©
dragongate technologies