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. …


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. …


Backtesting, Data, Metrics, Live Implementation, and Pitfalls

Image for post
Image for post
Photo by Pixabay 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.

Algorithmic Trading Strategy Development

Backtesting is the hallmark of quantitative trading. Backtesting takes historical or synthetic market data and tests the profitability of algorithmic trading strategies. This topic demands expertise in statistics, computer science, mathematics, finance, and economics. This is exactly why in large quantitative trading firms there are specific roles for individuals with immense knowledge (usually at the doctorate level) of the respective subjects. The necessity for expertise cannot be understated as it separates winning (or seemingly winning) trading strategies from losers. …


Introduction to the time value of money with code

Image for post
Image for post
Photo by Alexander Mils from Pexels

The first quantitative class for vanilla finance and quantitative finance majors alike has to do with the time value of money. Essentially, it’s a semester-long course driving notions like $100 today is worth more than $100 a year from today into the heads of college students and making them work out painful word problems by hand to determine how much they need to invest today to arrive at some value in the future. This is done in tandem with the introduction to perpetuities and annuities as an application to the temporal value differential. …


Using the context of video game development for intuition

Image for post
Image for post
Photo by Pixabay from Pexels

In this article, I touch on 3 key concepts for developing code in Python. I will be using the context of game development as an example for each concept because I believe it makes for the most intuitive understanding.

Let's get started…

1. Classes

The hallmark of object-oriented programming: classes. These can be viewed as computational models of whatever it is you are trying to code. Allow me to elaborate, in our hypothetical video game, we can use a class to represent a player and their attributes…

Here we design a class to represent the player in-game. Players will have three primary stats: strength, intellect, and charisma — and their other attributes will scale based on the former values. To create an instance of a class for use in our game we can write the following…

About

Roman Paolucci

Quantitative Finance, Mathematics, and Computer Science https://RomanTheQuant.com http://youtube.com/c/RomanTheQuant

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