{ "info": { "author": "Emanuele Fabbiani", "author_email": "emanuele.fabbiani@xtreamers.io", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Vanilla Option Pricing\n[![Build Status](https://travis-ci.org/donlelef/vanilla-option-pricing.svg?branch=master)](https://travis-ci.org/donlelef/vanilla-option-pricing) \n[![Coverage Status](https://coveralls.io/repos/github/donlelef/vanilla-option-pricing/badge.svg?branch=master)](https://coveralls.io/github/donlelef/vanilla-option-pricing?branch=master)\n[![Documentation Status](https://readthedocs.org/projects/vanilla-option-pricing/badge/?version=latest)](https://vanilla-option-pricing.readthedocs.io/en/latest/?badge=latest)\n\nA simple Python package implementing stochastic models to price financial options. \nTheoretical background and comprehensive explanation of models and their paramenters\ncan be found is the paper *Fast calibration of two-factor models for energy option pricing*\nby Emanuele Fabbiani, Andrea Marziali and Giuseppe De Nicolao, available on \n[arXiv](https://arxiv.org/abs/1809.03941) \n\n### Installing\nThe preferred way to install the package is using pip,\nbut you can also download the code and install the package from source\n\nTo install the package using pip:\n\n```bash\npip install vanilla_option_pricing\n```\n\n### Quickstart\nLet's create a sample call option\n\n```python\nfrom datetime import datetime, timedelta\nfrom vanilla_option_princing.option import VanillaOption\nfrom vanilla_option_princing.models import BlackScholes\nfrom vanilla_option_pricing.calibration import ModelCalibration\n\noption = VanillaOption(\n spot=100,\n strike=101,\n dividend=0,\n date=datetime.today(),\n maturity=datetime.today() + timedelta(days=30),\n option_type='c',\n price=1,\n instrument='TTF'\n)\n```\n\nWe can compute the implied volatility and create a Black-Sholes model \nwith it. Of course, if now we ask the model to price the option, we'll\nget the real option price.\n\n```python\nvolatility = option.implied_volatility_of_undiscounted_price\nmodel = BlackScholes(volatility).as_option_pricing_model()\nmodel_price = model.price_option_black(option)\nprint(f'Actual price: {option.price}, model price: {model_price}')\n```\n\nWe can also try and calibrate the parameters of a model against \nlisted options.\n\n```python\ndata_set = [\n VanillaOption('TTF', 'c', date(2018, 1, 1), 2, 101, 100, date(2018, 2, 1)),\n VanillaOption('TTF', 'p', date(2018, 1, 1), 2, 98, 100, date(2018, 2, 1)),\n VanillaOption('TTF', 'c', date(2018, 1, 1), 5, 101, 100, date(2018, 5, 31))\n]\n\nprint(f'Implied volatilities: {[o.implied_volatility_of_undiscounted_price for o in data_set]}\\n')\n\nmodel = BlackScholes(0.2).as_option_pricing_model()\ncalibration = ModelCalibration(data_set)\n\nresult, trained_model = calibration.calibrate_model(model)\nprint(result)\nprint(f'Calibrated implied volatility: {trained_model.parameters[0]}') \n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://vanilla-option-pricing.readthedocs.io/en/latest/", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "vanilla-option-pricing", "package_url": "https://pypi.org/project/vanilla-option-pricing/", "platform": "", "project_url": "https://pypi.org/project/vanilla-option-pricing/", "project_urls": { "Homepage": "https://vanilla-option-pricing.readthedocs.io/en/latest/" }, "release_url": "https://pypi.org/project/vanilla-option-pricing/0.0.7/", "requires_dist": null, "requires_python": "", "summary": "Stochastic models to price financial options", "version": "0.0.7" }, "last_serial": 4275156, "releases": { "0.0.5": [ { "comment_text": "", "digests": { "md5": "c6c1b77787ba11e99c22425212f7e19c", "sha256": "deaf4c9c9e9d4ce7bbfa1ed70545644c10aadd791fd9e061e03179974b161bc9" }, "downloads": -1, "filename": "vanilla_option_pricing-0.0.5.tar.gz", "has_sig": false, "md5_digest": "c6c1b77787ba11e99c22425212f7e19c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3805, "upload_time": "2018-09-09T17:12:02", "url": "https://files.pythonhosted.org/packages/90/05/53a57918e04be174bb6239e85249b9a47ac7157689dc1d14c8b9a98f5a70/vanilla_option_pricing-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "dfbdb2f18112502ffaaec4010bbb7325", "sha256": "a281ab2f8c022043b4632623b387e423529bffeb6556b9a02f9393fb558eb36c" }, "downloads": -1, "filename": "vanilla_option_pricing-0.0.6.tar.gz", "has_sig": false, "md5_digest": "dfbdb2f18112502ffaaec4010bbb7325", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5921, "upload_time": "2018-09-15T15:33:06", "url": "https://files.pythonhosted.org/packages/27/88/4e2689547daa89239ecd1505b946e33a3a12a8ed778eae95b46c2abb3269/vanilla_option_pricing-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "0acc3d3ec2a0a4c3a1ac8eec44df46fa", "sha256": "43c8a9c30eb2473a0240390d21e4a8f49163aaf6ccf1a981df528410aa9833f8" }, "downloads": -1, "filename": "vanilla_option_pricing-0.0.7-py3.6.egg", "has_sig": false, "md5_digest": "0acc3d3ec2a0a4c3a1ac8eec44df46fa", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 16322, "upload_time": "2018-09-15T15:41:57", "url": "https://files.pythonhosted.org/packages/44/cb/96646625630ef949635717c09791d4594a0a76d28996905f1c430e61207a/vanilla_option_pricing-0.0.7-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "809d4f202b7b88a7b93799b4b3a7ea90", "sha256": "1aba295923db633ae4179339a99af99e22fee423bb5f31f3a857afe877bcebe1" }, "downloads": -1, "filename": "vanilla_option_pricing-0.0.7.tar.gz", "has_sig": false, "md5_digest": "809d4f202b7b88a7b93799b4b3a7ea90", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6738, "upload_time": "2018-09-15T15:41:58", "url": "https://files.pythonhosted.org/packages/e8/2f/3ac1d37f30b936ef6511c7501a497bee651ce0fb4b9998fc5d96e52607be/vanilla_option_pricing-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0acc3d3ec2a0a4c3a1ac8eec44df46fa", "sha256": "43c8a9c30eb2473a0240390d21e4a8f49163aaf6ccf1a981df528410aa9833f8" }, "downloads": -1, "filename": "vanilla_option_pricing-0.0.7-py3.6.egg", "has_sig": false, "md5_digest": "0acc3d3ec2a0a4c3a1ac8eec44df46fa", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 16322, "upload_time": "2018-09-15T15:41:57", "url": "https://files.pythonhosted.org/packages/44/cb/96646625630ef949635717c09791d4594a0a76d28996905f1c430e61207a/vanilla_option_pricing-0.0.7-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "809d4f202b7b88a7b93799b4b3a7ea90", "sha256": "1aba295923db633ae4179339a99af99e22fee423bb5f31f3a857afe877bcebe1" }, "downloads": -1, "filename": "vanilla_option_pricing-0.0.7.tar.gz", "has_sig": false, "md5_digest": "809d4f202b7b88a7b93799b4b3a7ea90", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6738, "upload_time": "2018-09-15T15:41:58", "url": "https://files.pythonhosted.org/packages/e8/2f/3ac1d37f30b936ef6511c7501a497bee651ce0fb4b9998fc5d96e52607be/vanilla_option_pricing-0.0.7.tar.gz" } ] }