Finance

Coding Your Own Option Payoff Plot

Just a couple more steps than common stock, really

Daryl
Geek Culture

--

The rise of commission-free trading apps in recent times has fuelled a rise in options trading. And it’s easy to see why, really. Nations worldwide are offering stimulus packages injecting money into the economy. And these nations are still reeling from lockdowns. With tons of liquidity sloshing around and few avenues to spend it, many retail investors decide, prudently so, to invest it into the stock market.

Worries of a bubble

With all that extra cash going into markets, it is a pertinent question on many investors’ minds: Are we heading into a bubble?

With markets continuously going up, it is reasonable to express hesitance.

But yet, an arguably stronger reaction is the FOMO when you see the asset prices rising in value and staying there.

Bubble protection

Luckily, there is a way out of this dilemma. As it turns out, price uncertainties have been around forever. Farmers have been using options to hedge against unexpected rises in products like grain and wheat due to unforeseen circumstances like hurricanes and crop blight. Similarly, heavy industries like shipping and airlines purchase options to hedge against sudden rises in diesel and kerosene prices. Savvy investors have caught on, and have since joined the options boom.

Call options

While options exist to hedge against price changes in both directions, we shall stick with calls in this article for ease of explanation. A call is an instrument that gives the right, but not the obligation to buy an asset at a specified price. An easy way to remember this is to think of “Calling it back from someone else”.

The great thing about this is two-fold:

  1. Potentially unlimited upside

By having the right to purchase at a specified price, your profit margins increase for any increase in the underlying.

2. Small loss

If the underlying never exceeds the strike price, the option expires unexercised. And the loss incurred is extremely small compared to owning the underlying.

Working example

To illustrate this, let’s have an example of a tranche of different call options to illustrate.

Let’s say we have an underlying that was $100.

To hedge against an increase, we shall purchase calls at the various strike prices of $120, $150, $180, $200, $220.

The premiums at each strike price are correspondingly $30, $20, $15, $10, $5.

We shall purchase in the corresponding quantities of 50, 40, 30, 20, 10.

As the underlying increases in price, our call options progressively pay off, and the amount of money saved in buying the underlying increases.

The plot below demonstrates how much we can profit (save), by locking in a purchase price via call options.

The green vertical line denotes the current price, and as it shifts right we unlock yet another tranche of savings.

Naturally, these input values are arbitrary and can be changed at the user’s discretion.

The necessary code is included below:

--

--

Daryl
Geek Culture

Graduated with a Physics degree, I write about physics, coding and quantitative finance.