-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_asian.py
More file actions
43 lines (30 loc) · 960 Bytes
/
Copy pathexample_asian.py
File metadata and controls
43 lines (30 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# MODULES
import time
from payoffs import VanillaCall
from options import VanillaOption
from parameters import ParameterConstant
from statistics_mc import StatisticMean, ConvergenceTable
from random_base import RandomParkMiller, AntiThetic
from path_dependent import ExoticBSEngine, PathDependentAsian
# CONSTANTS
N = 2**15
SPOT_100 = 100
SPOT_130 = 130
# INPUTS
call_100_1 = VanillaOption(VanillaCall(100),1)
call_130_1 = VanillaOption(VanillaCall(130),1)
r = ParameterConstant(0.04)
vol = ParameterConstant(0.4)
gatherer0 = StatisticMean()
gatherer = ConvergenceTable(gatherer0)
randomGen0 = RandomParkMiller(10,1)
randomGen = AntiThetic(randomGen0)
times = [n/100. for n in range(1,100,1)]
expiry = 1
callPayoff = VanillaCall(100)
asian = PathDependentAsian(times,expiry,callPayoff)
d = ParameterConstant(0.00)
# CALCULATIONS
engine = ExoticBSEngine(asian,r,d,vol,randomGen,100)
engine.do_simulation(N,gatherer)
print(gatherer.get_results())