Skip to content

Commit

Permalink
Add vanilla option to README.md (#34)
Browse files Browse the repository at this point in the history
* Add Vanilla option pricing to README.md

* Bump version to v0.6.5
  • Loading branch information
SebastienEveno authored Sep 29, 2023
1 parent b79d0bb commit 9089708
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 3 deletions.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,33 @@ my_market_data = exotx.MarketData.from_json(my_json)

### Price the product

#### Vanilla Option
```python
from exotx.instruments import OptionType
from exotx.enums import PricingModel, NumericalMethod

strike = 90
option_maturity = '2016-05-04'
my_vanilla_option = exotx.VanillaOption(strike, option_maturity, OptionType.CALL)
my_pricing_config = exotx.PricingConfiguration(PricingModel.BLACK_SCHOLES, NumericalMethod.ANALYTIC, compute_greeks=True)
exotx.price(my_vanilla_option, my_market_data, my_static_data, my_pricing_config)
```
```plaintext
>>> {
'price': 13.83328710,
'delta': 0.77183751,
'gamma': 0.01609460,
'theta': -7.01024983
}
```

#### Auto-Callable
```python
exotx.price(my_autocallable, my_market_data, my_static_data, model='black-scholes')
```

```plaintext
96.08517973497098
>>> 96.08517973497098
```

## Contributing
Expand Down
1 change: 1 addition & 0 deletions exotx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
__version__ = _version

# Import classes
from exotx.enums import *
from exotx.data import *
from exotx.instruments import *
from exotx.models import *
2 changes: 1 addition & 1 deletion exotx/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.6.4"
__version__ = "0.6.5"
10 changes: 10 additions & 0 deletions exotx/enums/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Modules for working with exotic options.
Exotic options can refer to auto-callables, barrier options, etc."""

from exotx.enums.enums import PricingModel, NumericalMethod

__all__ = [
'PricingModel',
'NumericalMethod'
]
4 changes: 3 additions & 1 deletion exotx/instruments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
from exotx.instruments.autocallable import Autocallable
from exotx.instruments.barrier_option import BarrierOption
from exotx.instruments.instrument import price
from exotx.instruments.option_type import OptionType

__all__ = [
'price',
'Autocallable',
'BarrierOption'
'BarrierOption',
'OptionType'
]

0 comments on commit 9089708

Please sign in to comment.