Expand description
The instruments
module.
Modules§
- analytic_
option_ pricer - Analytic option pricer. Analytic option pricing module.
- bonds
- Bond pricing models.
- equities
- Equity instruments.
- fx
- FX instruments.
- instrument
- Base trait for all instruments.
- monte_
carlo_ pricer - Monte-Carlo pricer. Monte-Carlo pricer trait.
- options
- Option pricers and sensitivity functions.
- payoff
- Generic derivative payoff trait.
- ticker
- Ticker symbol.
Macros§
- impl_
monte_ carlo_ pricer - Macro to implement
MonteCarloPricer
for a given instrument type.
Structs§
- Analytic
Option Pricer - Analytic option pricer.
- Analytic
Option Pricer Builder - Builder for
AnalyticOptionPricer
. - Asay82
- Asay (1982) option pricing parameters.
- Asian
Option - Asian option.
- Asian
Option Builder - Builder for
AsianOption
. - Bachelier
- Bachelier (1900) option pricing parameters.
- Barrier
Option - Barrier option.
- Binary
Option - Binary option.
- Black76
- Black (1976) option pricing parameters.
- Black
Scholes73 - Black-Scholes (1973) option pricing parameters.
- Black
Scholes Merton - Generalised Black-Scholes-Merton European Option pricing model.
- Black
Scholes Merton Builder - Builder for
BlackScholesMerton
. - Capped
Power Option - Capped Power Option.
- Currency
- Currency data struct.
- Currency
Pair - Currency pair.
- Equity
- Equity instrument.
- European
Vanilla Option - European vanilla option.
- European
Vanilla Option Builder - Builder for
EuropeanVanillaOption
. - Exchange
- Exchange struct to hold exchange rates.
- Exchange
Rate ExchangeRate
struct to hold exchange rate information.- Garman
Kohlhagen83 - Garman-Kohlhagen (1983) option pricing parameters.
- Heston93
- Heston (1993) option pricing parameters.
- LogMoneyness
Contract - Log Moneyness Contract.
- LogOption
- Log Option.
- LogUnderlying
Contract - Log Underlying Contract.
- Lookback
Option - Lookback option.
- Merton73
- Meron (1973) option pricing parameters.
- Money
- Money struct.
- Option
Contract - Option contract data.
- Option
Contract Builder - Builder for
OptionContract
. - Power
Contract - Power Contract.
- Power
Option - Power Option. Not to be confused with the PoweredOption.
- Powered
Option - Powered Option. Not to be confused with the PowerOption.
- Supershare
Option - Supershare option.
- Ticker
- Ticker symbol for financial instruments.
Enums§
- Analytic
Option Pricer Builder Error - Error type for AnalyticOptionPricerBuilder
- Asian
Option Builder Error - Error type for AsianOptionBuilder
- Averaging
Method - Method of averaging (arithmetic or geometric, and continuous or discrete).
- Barrier
Type - Barrier type flag.
- Binary
Type - Binary type enum.
- Black
Scholes Merton Builder Error - Error type for BlackScholesMertonBuilder
- European
Vanilla Option Builder Error - Error type for EuropeanVanillaOptionBuilder
- Exercise
Flag - American/European option type enum.
- Option
Contract Builder Error - Error type for OptionContractBuilder
- Settlement
Flag - Instrument settlement flag.
- Strike
Flag - Option strike type enum.
- Type
Flag - Option type enum.
Constants§
- AED
- United Arab Emirates Dirham (AED)
- AFN
- Afghan Afghani (AFN)
- ALL
- Albanian Lek (ALL)
- AMD
- Armenian Dram (AMD)
- ANG
- Netherlands Antillean Guilder (ANG)
- AOA
- Angolan Kwanza (AOA)
- ARS
- Argentine Peso (ARS)
- AUD
- Australian Dollar (AUD)
- AWG
- Aruban Florin (AWG)
- AZN
- Azerbaijani Manat (AZN)
- BAM
- Bosnia and Herzegovina Convertible Mark (BAM)
- BBD
- Barbados Dollar (BBD)
- BDT
- Bangladeshi Taka (BDT)
- BGN
- Bulgarian Lev (BGN)
- BHD
- Bahraini Dinar (BHD)
- BIF
- Burundian Franc (BIF)
- BMD
- Bermudian Dollar (BMD)
- BND
- Brunei Dollar (BND)
- BOB
- Boliviano (BOB)
- BRL
- Brazilian Real (BRL)
- BSD
- Bahamian Dollar (BSD)
- BTN
- Bhutanese Ngultrum (BTN)
- BWP
- Botswana Pula (BWP)
- BYN
- Belarusian Ruble (BYN)
- BZD
- Belize Dollar (BZD)
- CAD
- Canadian Dollar (CAD)
- CDF
- Congolese Franc (CDF)
- CHF
- Swiss Franc (CHF)
- CLP
- Chilean Peso (CLP)
- CNY
- Renminbi (Chinese) Yuan (CNY)
- COP
- Colombian Peso (COP)
- CRC
- Costa Rican Colon (CRC)
- CUC
- Cuban Convertible Peso (CUC)
- CUP
- Cuban Peso (CUP)
- CVE
- Cape Verdean Escudo (CVE)
- CZK
- Czech Koruna (CZK)
- DJF
- Djiboutian Franc (DJF)
- DKK
- Danish Krone (DKK)
- DOP
- Dominican Peso (DOP)
- DZD
- Algerian Dinar (DZD)
- EGP
- Egyptian Pound (EGP)
- ERN
- Eritrean Nakfa (ERN)
- ETB
- Ethiopian Birr (ETB)
- EUR
- Euro (EUR)
- FJD
- Fijian Dollar (FJD)
- FKP
- Falkland Islands Pound (FKP)
- GBP
- Pound Sterling (GBP)
- GEL
- Georgian Lari (GEL)
- GHS
- Ghanaian Cedi (GHS)
- GIP
- Gibraltar Pound (GIP)
- GMD
- Gambian Dalasi (GMD)
- GNF
- Guinean Franc (GNF)
- GTQ
- Guatemalan Quetzal (GTQ)
- GYD
- Guyanese Dollar (GYD)
- HKD
- Hong Kong Dollar (HKD)
- HNL
- Honduran Lempira (HNL)
- HRK
- Croatian Kuna (HRK)
- HTG
- Haitian Gourde (HTG)
- HUF
- Hungarian Forint (HUF)
- IDR
- Indonesian Rupiah (IDR)
- ILS
- Israeli New Shekel (ILS)
- INR
- Indian Rupee (INR)
- IQD
- Iraqi Dinar (IQD)
- IRR
- Iranian Rial (IRR)
- ISK
- Icelandic Króna (ISK)
- JMD
- Jamaican Dollar (JMD)
- JOD
- Jordanian Dinar (JOD)
- JPY
- Japanese Yen (JPY)
- KES
- Kenyan Shilling (KES)
- KGS
- Kyrgyzstani Som (KGS)
- KHR
- Cambodian Riel (KHR)
- KMF
- Comoro Franc (KMF)
- KPW
- North Korean Won (KPW)
- KRW
- South Korean Won (KRW)
- KWD
- Kuwaiti Dinar (KWD)
- KYD
- Cayman Islands Dollar (KYD)
- KZT
- Kazakhstani Tenge (KZT)
- LAK
- Lao Kip (LAK)
- LBP
- Lebanese Pound (LBP)
- LKR
- Sri Lankan Rupee (LKR)
- LRD
- Liberian Dollar (LRD)
- LSL
- Lesotho Loti (LSL)
- LYD
- Libyan Dinar (LYD)
- MAD
- Moroccan Dirham (MAD)
- MDL
- Moldovan Leu (MDL)
- MGA
- Malagasy Ariary (MGA)
- MKD
- Macedonian Denar (MKD)
- MMK
- Myanmar Kyat (MMK)
- MNT
- Mongolian Tögrög (MNT)
- MOP
- Macanese Pataca (MOP)
- MRO
- Mauritanian Ouguiya (MRO)
- MUR
- Mauritian Rupee (MUR)
- MVR
- Maldivian Rufiyaa (MVR)
- MWK
- Malawian Kwacha (MWK)
- MXN
- Mexican Peso (MXN)
- MYR
- Malaysian Ringgit (MYR)
- MZN
- Mozambican Metical (MZN)
- NAD
- Namibian Dollar (NAD)
- NGN
- Nigerian Naira (NGN)
- NIO
- Nicaraguan Córdoba (NIO)
- NOK
- Norwegian Krone (NOK)
- NPR
- Nepalese Rupee (NPR)
- NZD
- New Zealand Dollar (NZD)
- OMR
- Omani Rial (OMR)
- PAB
- Panamanian Balboa (PAB)
- PEN
- Peruvian Sol (PEN)
- PGK
- Papua New Guinean Kina (PGK)
- PHP
- Philippine Peso (PHP)
- PKR
- Pakistani Rupee (PKR)
- PLN
- Polish Złoty (PLN)
- PYG
- Paraguayan Guarani (PYG)
- QAR
- Qatari Riyal (QAR)
- RON
- Romanian Leu (RON)
- RSD
- Serbian Dinar (RSD)
- RUB
- Russian Ruble (RUB)
- RWF
- Rwandan Franc (RWF)
- SAR
- Saudi Riyal (SAR)
- SBD
- Solomon Islands Dollar (SBD)
- SCR
- Seychelles Rupee (SCR)
- SDG
- Sudanese Pound (SDG)
- SEK
- Swedish Krona/Kronor (SEK)
- SGD
- Singapore Dollar (SGD)
- SHP
- Saint Helena Pound (SHP)
- SLE
- Sierra Leonean (new) Leone (SLE)
- SLL
- Sierra Leonean (old) Leone (SLL)
- SOS
- Somali Shilling (SOS)
- SRD
- Surinamese Dollar (SRD)
- SSP
- South Sudanese Pound (SSP)
- STN
- São Tomé and Príncipe Dobra (STN)
- SVC
- Salvadoran Colón (SVC)
- SYP
- Syrian Pound (SYP)
- SZL
- Swazi Lilangeni (SZL)
- THB
- Thai Baht (THB)
- TJS
- Tajikistani Somoni (TJS)
- TMT
- Turkmenistan Manat (TMT)
- TND
- Tunisian Dinar (TND)
- TOP
- Tongan Paʻanga (TOP)
- TRY
- Turkish Lira (TRY)
- TTD
- Trinidad and Tobago Dollar (TTD)
- TWD
- New Taiwan Dollar (TWD)
- TZS
- Tanzanian Shilling (TZS)
- UAH
- Ukrainian Hryvnia (UAH)
- UGX
- Ugandan Shilling (UGX)
- USD
- United States Dollar (USD)
- UYU
- Uruguayan Peso (UYU)
- UZS
- Uzbekistan Som (UZS)
- VES
- Venezuelan Bolívar Soberano (VES)
- VND
- Vietnamese Đồng (VND)
- VUV
- Vanuatu Vatu (VUV)
- WST
- Samoan Tālā (WST)
- XAF
- CFA Franc BEAC (XAF)
- XCD
- East Caribbean Dollar (XCD)
- XOF
- CFA Franc BCEAO (XOF)
- XPF
- CFP Franc (XPF)
- YER
- Yemeni Rial (YER)
- ZAR
- South African Rand (ZAR)
- ZMW
- Zambian Kwacha (ZMW)
- ZWL
- Zimbabwean Dollar (ZWL)
Traits§
- Generalised
Black Scholes Merton - Generalised Black-Scholes-Merton option pricing model and it’s Greeks.
- Instrument
- Instrument trait The trait provides a common interface for all instruments. All instruments can be queried for their net present value (NPV) and error (if available). The valuation date is the date at which the instrument’s NPV is being calculated; for most instruments it is the trade date, for some exotic products it might be the exercise date.
- Monte
Carlo Pricer - Monte-Carlo pricer trait.
- Payoff
- Generic payoff trait for derivatives.
Functions§
- implied_
volatility - Implied volatility function to calculate the implied volatility of an option given its market price. The method is based on lets be rational paper Let’s Be Rational by Peter Jaeckel with some modifications. If price is below intrinsic value, it returns -INF, if price is above intrinsic value, it returns INF.
- iv
- A convenience function to calculate the implied volatility.
It is a wrapper around
implied_volatility
function.