Tutorial: Crude Oil Options in Python
Below is a beginner-friendly Tutorial on Options , which is great for interviews also , and great for modelling Options in Python.
It is also included in the online course 5.20, so you will find it in there also.
But below it is written in the form of Q&A (questions and answers) for interview preparation. No prerequisites needed. Feel free to save it. Or , again, you will find it in the Classroom.
The Python code is attached.
⚠️ What Are Options Contracts?
An option is a contract between two parties: an option seller and an option buyer.
The option buyer pays a fee (the premium) to the option seller. In return, the option buyer receives the right to purchase or sell an asset (like crude oil) at a specific price. This price is called the strike price.
Every option has an expiration date on which it ceases to exist. The option buyer must decide whether to exercise the option before this date passes.
⚠️ What Is Crude Oil?
TutorCrude oil is unrefined petroleum extracted from the ground. It’s a fossil fuel formed over millions of years from the remains of ancient marine organisms. Crude oil isn’t useful in itself. Refineries process it into products that are useful: gasoline, diesel, jet fuel, heating oil, and plastics.
Crude oil is one of the most actively traded commodities in the world. Its price affects everything from transportation costs to electricity bills.
⚠️ The Option Premium
The price at which an option is traded is called ‘option premium’. Let’s say a company that has refineries wants to buy an option on crude oil. And it pays $8.74/barrel to buy this option.
It is an American Call option on 1000 barrels of crude oil, at strike price of $70/barrel. This means that the company can exercise the option at any time before it expires, and will buy 1000 barrels of crude oil at $70/barrel.
⚠️ The Option Intrinsic Value
So the company exercises the option and buys the crude oil for $70/barrel. Let’s say the spot price of crude oil is $78.5/barrel.
This means that the company can immediately sell the crude oil it just bought to the spot market for $78.5/barrel, making a profit of $8.5/barrel. This immediate profit is called the Intrinsic Value of the option.
Intrinsic Value = Spot Price of Crude oil - Strike Price of Option = $78.5/barrel - $70/barrel= $8.5/barrel.
However, the company paid $8.74/barrel to buy this option. So overall, it has a negative profit if we consider also the amount it paid to buy the option.
⚠️ Extrinsic Value
The difference between the Option Premium (the market price of the option i.e. how much it costs to buy it) and its Intrinsic Value is called Extrinsic Value.
Extrinsic Value=Option Premium−Intrinsic Value= $8.74/barrel - $8.5/barrel= $0.24/barrel.
In our example, the company paid an extra $0.24 per barrel over the intrinsic value, for the option. This is known as Extrinsic Value. It represents the value of time and volatility(uncertainty).
  • Time: The more time there is until the option expires, the more chance there is for the price of the underlying asset (crude oil) spot price to increase. Because in this case, the company will buy the crude oil at the strike price and sell it to the spot market at the, higher, spot price.
  • Volatility: The more volatile the price of the underlying asset is, the more chance there is for a large price movement.
⚠️ Implementing Extrinsic Value in Python (attached)
Let’s create a Python class to calculate the intrinsic and extrinsic value of a call option.
This Python code is about how to calculate intrinsic and extrinsic value given the spot price, strike price, and option premium.
So, first, we have the spot price of crude oil, which is $78.5/barrel. The company (e.g. a refinery) buys 1 American Call option by paying $8.74/barrel. This option has a strike price equal to $70/barrel.
We create the object call_option by instantiating the class CallOption. Then we calculate the intrinsic value of the call option, and it is equal to $78.5/barrel - $70/barrel = $8.5/barrel. So the company exercises this option, which means it buys the underlying asset (crude oil) by paying $70/barrel . Then, it immediately sells it to the spot market at $78.5$/barrel, thereby making revenue equal to $8.5/barrel. This is the intrinsic value.
Then, the extrinsic value is $0.24/barrel.
So the company paid $8.74 to buy the option, and paid $70 when it exercised it, to buy the underlying asset. And it made $78.5. So profit = 78.5-70-8.74= - $0.24/barrel i.e. it has a loss.
So it was a bad idea for the company to exercise the option!
⚠️The Golden Rule of Option Trading is: If the extrinsic value of an American call option is greater than zero, you should generally not exercise it early.
36
4 comments
Dr. Spyros Giannelos
7
Tutorial: Crude Oil Options in Python
powered by
Energy Data Scientist
skool.com/software-school-for-energy-7177
A beginner-friendly training program for a career in the energy sector. Regardless of your location, age, sex, education or experience level.
Build your own community
Bring people together around your passion and get paid.
Powered by