Python and Black-Scholes Pricing for Dynamic Hedges

Image for post
Image for post
Photo by Egor Kamelev from Pexels

Note from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking professional advice. See our Reader Terms for details.

Option Portfolios

Equities that have a very straightforward exposure to idiosyncratic and systematic risk. Options, on the other hand, have exposure to not only the underlying asset, but also interest rates, time, and volatility. These exposures are inputs to the Black-Scholes option pricing model(see Deriving the Black-Scholes Model). Since these inputs affect the value of the option in question, the partial derivative of the function can tell us how the option value changes when one of these exposures changes holding the others constant. …


A guide to the notion of securities pricing with code

Image for post
Image for post
Photo by Castorly Stock from Pexels

Introduction

The majority of the time in undergraduate quantitative finance coursework is spent on pricing different securities. Initially, there is a heavy emphasis on the time value of money, and analyzing annuities and perpetuities. Afterward, the focus shifts to learning, analyzing, and pricing equity derivatives including forwards, futures, options, and swaps. Once the groundwork is laid for pricing derivatives, the remainder of coursework is spent researching and becoming a specialist in a market sector or security type. In this article, I aim to breakdown the underlying theme that determines the fair price for all of these securities in the market. …


Explanation, Consequences, Papers, Resources, and References

Image for post
Image for post
Photo by Alex Azabache from Pexels

Equity Portfolio Replication

The notion of a replicating portfolio first appears in the argument for the Black-Scholes model (1973). In order to bind an option’s price to their model under a no-arbitrage assumption, they develop an offsetting equity position replicating the opposite value of the option at expiration. Holding such a portfolio is therefore risk-neutral, consequently, the portfolio must earn an appropriate risk-free rate. However, Black-Scholes use geometric Brownian motion to model the underlying asset price. Infinite variation is implied by this stochastic process meaning overtime the initial equity value will stray linearly where the option value strays non-linearly. This creates a hedging error which is corrected by Black-Scholes by continuously revising the offsetting replicating portfolio and maintains the portfolio’s risk-neutrality expiration. In the presence of transaction costs and discrete trading, this is no longer optimal or possible. …


Quick and concise explanation and computation with code

Image for post
Image for post
Photo by Pixabay from Pexels

Risk Management

There are a variety of metrics and tools that a portfolio manager can use to understand their exposure to risk, from economic indicators to Monte Carlo simulations. In this article, we will take a look at one of the most important metrics when analyzing an investment portfolio: Value at Risk (VaR). There are several assumptions that are made when computing a portfolio’s VaR. However, in practice, it is possible to relax these assumptions — consequently, the computations will be much more complex. It is very helpful to have software that can automatically compute VaR so as a portfolio manager you can use the information rather than worrying about computing it (though you should understand the process used and its implications). Therefore, herein we will also look at an example in Python to begin automating this process. …


Dynamic Greek Hedging in Option Portfolios

Image for post
Image for post
Photo by Lorenzo from Pexels

Financial Derivatives: Options

Option contracts give the buyer the right but not the obligation to purchase (call option) or sell (put option) shares in an underlying asset at a predetermined price.

How and what changes an option price in the market? Economics tells us that the market will find an equilibrium price given supply and demand, and thanks to the Black-Scholes model (see Deriving the Black-Scholes Model) we can explain the market’s pricing by five key inputs.

  • S — The price of the underlying asset at time t
  • X — The strike price for the option contract
  • r — The rate of interest for the life of the option…

The development of modern options pricing

Image for post
Image for post
Photo Credit

A Brief History

Remarkably, options trading can be traced back to 332 B.C. where there is an account of Thales of Miltetus, an astronomer, philosopher and mathematician purchased the rights to an oil harvest — making a fortune. The next most notable account of options trading was a period in the Dutch Golden Age known as Tulip Mania. In 1636 these contracts were used to speculate the rising prices of tulips until prices collapsed in 1637 which is often recognized as the first speculative bubble. This continued in London during the early 18th century where options trading was given its own organized market. Hard lessons learned from Tulip Mania kept trading volumes low and even created opposition to trading these contracts. This resulted in a ban on trading options from 1733–1860. Around the end of this ban in the USA Russell Sage, a politician turned finance professional, created the first over the counter options. In 1973 the Chicago Board of Exchange (CBOE) and the Options Clearing Corporation (OCC) were established to ensure standardization and liquidity. …


A simple introduction with sample code!

Image for post
Image for post
Photo by Kaboompics .com from Pexels

Artificial Intelligence

AI has turned into a buzzword everyone in the tech industry throws around, leaving the uninitiated mystified and in the dark. This article is meant to be an introduction to artificial intelligence and machine learning for those who may be unfamiliar with what it actually is, how it works, and what it can do.

Let's get started…

What is Data Science, AI, Machine Learning?

The realm of artificial intelligence is vast, however, there are certain subsections that narrow down its applications. Let’s start by introducing what is meant when we hear words like AI, ML, and Data Science. Whenever words like this are thrown around, generally, they are referring to processes where data that is either collected in the past or in realtime is being manipulated to create predictions. These predictions are the “end result” of the AI, ML, or some other statistical model after “seeing” the data. …


Visualization and implementation in an investment portfolio

Image for post
Image for post
Photo by Pixabay from Pexels

The Notion of Volatility Risk Premium

After the derivation of the Black-Scholes model, the discussion is open to its place in pricing vanilla options. The market dictates the interest-rate and option price for a particular strike and expiration by the laws of supply and demand. The only parameter not readily available as an input in the Black-Scholes equation is volatility. Since every parameter except volatility is available and dictated by the market, the inverse of the Black-Scholes equation allows us to find the volatility expected by market participants: implied volatility. …


Understanding the difference in model assumptions and outputs

Image for post
Image for post
Photo by Thao Le Hoang on Unsplash

The world of AI is as exciting as it is misunderstood. Buzz words like “Machine Learning” and “Artificial Intelligence” end up skewing not only the general understanding of their capabilities but also key differences between their functionality against other models. In this article, I want to discuss the key differences between a linear regression model and a standard feed-forward neural network. To do this, I will be using the same dataset (which can be found here: https://archive.ics.uci.edu/ml/datasets/Energy+efficiency) for each model and compare the differences in architecture and outcome in Python.

Exploratory Data Analysis

We are looking at the Energy Efficiency dataset from UCI. In the context of the data, we are working with each column is defined as the…


Quickly scrape, and summarize Google search engine results

Image for post
Image for post
Photo by Pixabay from Pexels

Web Scraping

Web scraping is an awesome tool for analysts to sift through and collect large amounts of public data. Using keywords relevant to the topic in question, a good web scraper can gather large amounts of data very quickly and aggregate it into a dataset. There are several libraries in Python that make this extremely easy to accomplish. In this article, I will illustrate an architecture that I have been using for web scraping and summarizing search engine data. The article will be broken up into the following sections…

  • Link Scraping
  • Content Scraping
  • Content Summarizing
  • Building a Pipeline

All of the code will be provided herein. …

About

Roman Paolucci

Quantitative Finance, Mathematics, Artificial Intelligence and Computer Science

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store