Calculators
- In this package:
finmc.calc
contains calculators that can be used with anyfinmc
model. - Outside this package: qablet-contracts defines a large selection of
financial derivative contracts that can be priced using
finmc
models. Also see project qatwalk that leverages the selection of contracts inqablet-contract
with the selection of models infinmc
.
finmc.calc
Utility to calculate prices of european contracts from a MC Simulation model.
finmc.calc.option.opt_price_mc
Calculate the price of a Vanilla European Option using MC Simulation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
strike |
float
|
The strike price of the option. |
required |
maturity |
float
|
The time to maturity of the option in years. |
required |
option_type |
str
|
The type of the option. Either "Call" or "Put". |
required |
asset_name |
str
|
The name of the asset. |
required |
model |
MCBase
|
The model used to simulate the asset price. |
required |
Returns:
Type | Description |
---|---|
float
|
The price of the option. |
Examples:
Source code in finmc\calc\option.py
Utility to calculate prices of bonds from a MC Simulation model.
finmc.calc.bond.zcb_price_mc
Calculate the price of a Zero Coupon Bond using MC Simulation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
maturity |
float
|
The time to maturity of the bond in years. |
required |
asset_name |
str
|
The name of the asset. |
required |
model |
MCBase
|
The model used to simulate the asset price. |
required |
Returns:
Type | Description |
---|---|
float
|
The price of the zero coupon bond. |
Examples: