# How to Build a Covered Call Calculator in ThinkorSwim

> A free covered call calculator for the ThinkorSwim option chain: one column shows each call's return if you keep the premium and if you're called away.

Page: https://tosindicators.com/indicators/covered-call-calculator  
Video: https://www.youtube.com/watch?v=1Si2BzM9bMU  
Section: Indicators  
Skill: Beginner  
Access: free  
Updated: 2026-10-16

[tos_covered_call_calculator]

In this tutorial I build a covered call calculator for the ThinkorSwim option chain. It's a custom quote column that prints 2 returns next to every call strike: what you make if you keep only the premium, and what you make if your shares are called away at the strike. With it you can compare strikes, expirations and stocks without filling in a spreadsheet.

The video has 4 parts: a comparison with rental income, the math in Excel, the thinkScript code, and a live example in KOPN. It's for traders who already sell covered calls and want the numbers faster, and for anyone weighing the strategy for the first time. The finished code is a free download.

## Key Takeaways

- The covered call calculator is a free thinkScript custom quote for the ThinkorSwim option chain. It prints 2 returns on every call: the premium alone, and the premium plus the share gain if your shares are called away.

- Both returns divide by the cost of 100 shares at the stock's last close. The premium is the option's last close times 100.

- In the video, AT&T (T) closed at $29.76 and its 30 strike call last traded at $0.43, so the column read 1.44% | 2.25%.

- The label turns green when the if-called return is 50% or more. In the video, KOPN's April 16, 2021 calls turned green from the 17.50 strike, which showed 4.94% | 62.03%.

- The download is the code from the video as a .txt file for a custom quote slot. Volatility Box members also get an advanced version with a cost basis input.

## What Is a Covered Call?

A covered call is a trade where you own 100 shares of a stock and sell 1 call option against them. Selling the call gives the buyer the right to buy your shares at the strike price, and you collect the premium for it. In the video I treat the shares like a rental house and the premium like the rent.

Two outcomes matter at expiration, and the covered call calculator prices both of them:

- **Not exercised.** The stock finishes below the strike. You keep the premium and the shares, and you can sell another call.

- **Exercised (called away).** The stock finishes above the strike. You keep the premium plus the gain from your entry up to the strike, and the shares are gone.

## Covered Call Income Compared to Rent

The rental comparison in Part 1 of the video uses a house for sale in Indiana as the baseline. The seller's worksheet listed a cash price of $67,500 and $373.34 of monthly cash flow after expenses. I used about 1% a month as the rent baseline and left equity appreciation out of it.

![Seller worksheet for an Indiana single family rental with a $67,500 cash price and $373.34 monthly cash flow highlighted](https://tosindicators.com/wp-content/uploads/2021/03/Indiana-House-Cashflow.jpg)The seller's worksheet for the Indiana rental: $67,500 cash price, $650 current rent and $373.34 of monthly cash flow after expenses. The seller made it, so the numbers are likely on the generous side.

Next I priced the at-the-money call in the April monthly series, 25 days from expiration, on 4 stocks from 4 volatility tiers. These are the quotes from the day of the video:

| Stock | Volatility tier | Implied volatility (April series) | Return if not exercised | Return if exercised |
| --- | --- | --- | --- | --- |

| AT&T (T) | Low | 25% | 1.44% | 2.25% |

| Fastly (FSLY) | Mid | 74.49% | 5.3% | 11.23% |

| CURI | High | 119% | 9.32% | 18% |

| AMC | Very high | 196% | 19% | A little above 19% |

Every tier in the table cleared the 1% rent baseline, and the premium rose with implied volatility. That extra premium is pay for extra risk: you have to be willing to sit in the shares if the volatility takes them lower. At AMC's 196%, the premium alone was 19%, and being called away added only a little more.

Real estate is a different asset class with different risks, so the comparison is apples to oranges. Premiums also change with price and implied volatility every day, so treat these numbers as the video's snapshot.

## The Covered Call Formulas, Built in Excel First

The covered call calculator runs 2 formulas, and Part 2 of the video builds them in Excel before writing any code. Each row needs 4 inputs: the symbol, the stock's closing price, the strike of the call you'd sell, and the premium you'd collect. The return is measured against the cost of 100 shares.

| Return | Formula (1 contract, 100 shares) | AT&T 30 strike in the video |
| --- | --- | --- |

| If not exercised | Premium / (stock price x 100) | $43 / $2,976 = 1.44% |

| If exercised | (Premium + (strike - stock price) x 100) / (stock price x 100) | ($43 + $24) / $2,976 = 2.25% |

For AT&T, the stock closed at $29.76 and the 30 strike call last traded at $0.43, or $43 for 1 contract. If the call isn't exercised, the return is the $43 premium. If it is, you sell the shares at $30, a gain of $0.24 a share or $24, so the total return is $67.

The 31 strike shows the trade-off. It paid only $18, or 0.60%, but if exercised it returned $142, or 4.77%, because the strike sits further above the stock price.

The if-called return is also the most a covered call can make by expiration: above the strike, your shares go at the strike however high the stock trades. The premium lowers your breakeven on the shares by the same amount, so on AT&T's 30 strike it moves from $29.76 to $29.33. Neither formula counts dividends, and both cover the time to expiration, not a full year.

![Excel sheet with covered call returns for AT&T at $29.76 on the 30 and 31 strike calls](https://tosindicators.com/wp-content/uploads/2021/03/Covered-Call-Calculator-in-Excel.jpg)The Excel version for AT&T at $29.76: the 30 strike returns 1.44% if not exercised and 2.25% if exercised, and the 31 strike returns 0.60% and 4.77%.

Google Sheets makes this step faster, because its Google Finance function can fill in the current price for you. Either way, one strike by hand is quick, and comparing every strike, every expiration and a few stocks (AT&T against Verizon and T-Mobile, say) takes far too long.

The web calculator at the top of this page runs the same 2 formulas for one trade. Enter the stock price, strike, premium and number of contracts, and it shows the premium received, the premium return and the total return if called away. Its optional cost basis field adds both returns measured from your own entry price.

## How to Add the Covered Call Calculator to ThinkorSwim

The covered call calculator lives in a custom quote column on the option chain, so it goes in the Trade tab instead of on a chart. Here are the steps from the video:

- Open the **Trade** tab, where the option chain lives.

- Click **Layout** at the top of the option chain and choose **Customize** from the drop-down.

- In the Customize window, open the drop-down and choose **Custom Quotes**.

- Double-click an unused custom quote (it may be named Custom Quote 1) to add it to your current set of columns.

- Click the scroll icon next to it to open the thinkScript editor, delete the default code, and paste in the code from the Code tab or the download.

- Click **OK**, then **OK** again. The new column shows 2 percentages for every call strike.

ThinkorSwim gives you a limited number of custom quotes, and the same slots feed dashboard scripts and other option scripts, so plan which ones you keep loaded. To edit the code later, go back to Layout, then Customize, and click the same scroll icon.

If you haven't added custom code to ThinkorSwim before, our guide on [how to import a study into ThinkorSwim](https://tosindicators.com/thinkscript/how-to-import-thinkorswim) covers the basics.

## How the Code Works

The calculator's code is 8 statements of thinkScript, and its math lines follow the columns of the Excel sheet. I built it one line at a time and tested each value with a label before moving on.

### Step 1: Shares and Contracts

```
def maxShares = 100;
def maxContracts = 1;
```

I define these once so they're easy to change in one place. They matter if you later want to see returns in dollars against a monthly income goal. If you change them, change both together (2 contracts and 200 shares) so the percentages stay the same.

### Step 2: The Premium in Dollars

```
def premium = maxContracts * close * 100;
```

Here `close` is the last price of the option itself. The custom quote runs on each strike's row, so `close` reads that strike, and times 100 gives the premium in dollars for 1 contract. When I tested it on AT&T, the column showed 43 for the 30 strike and 18 for the 31 strike.

### Step 3: The Premium as a Percentage

```
def premiumPct = premium/(MaxShares * close(getUnderlyingSymbol()));
```

`close(getUnderlyingSymbol())` reads the stock's close instead of the option's, so the bottom of the fraction is the cost of 100 shares. For AT&T at $29.76 it returned 1.44%, the same as the Excel sheet. thinkScript ignores capitalization, so `MaxShares` and `maxShares` are the same variable.

### Step 4: The Return if Your Shares Are Called Away

```
def strikePriceGain = getStrike() - close(getUnderlyingSymbol());
def premiumPlusSharesPct = ((strikePriceGain * maxShares) + premium)/(MaxShares * close(getUnderlyingSymbol()));
```

`getStrike()` returns the strike of the row. Subtracting the stock price gives the gain per share if the shares are called away, $0.24 for AT&T's 30 strike. That gain times 100 shares, plus the premium, over the cost of the shares gave 2.25%.

For a strike below the stock price the gain is negative, so the second number can fall below zero. In the KOPN option chain screenshot further down, the April 2.5 strike shows 73.61% | -3.95%.

### Step 5: The Label and Its Color

```
AddLabel(yes, AsPercent(premiumPct) + " | " + AsPercent(premiumPlusSharesPct), if premiumPlusSharesPct >= 0.5 then color.green else color.white);
```

`AddLabel` prints both numbers with `AsPercent`, split by a bar: the premium return on the left and the if-called return on the right. The label turns green when the if-called return is 0.5 (50%) or more and stays white otherwise. I set it to an outrageous 50% in the video. It's an arbitrary number, so pick your own.

## The KOPN Example From the Video

KOPN is the stock I used to apply the covered call calculator in Part 4 of the video, because I already had a reason to be bullish on it. It had a [Slingshot Squeeze](https://tosindicators.com/squeeze-course/module-10) and a [Squeeze Signal](https://tosindicators.com/squeeze-course/module-6) on the daily chart, and the Slingshot Squeeze stats on the chart showed 2 winners and 1 loser, with an average win of 15.96% and an average loss of 0.48%.

The 127.2% Fibonacci extension sat at $15.68 and the 161.8% extension at $18.30. If I expected a move into that zone, a strike between those levels was the place to sell a call. For more on trading Fibonacci levels, see our [Fibonacci Trading Course](https://tosindicators.com/fibonacci-trading).

![KOPN daily chart at $11.14 with Slingshot Squeeze stats and Fibonacci extension levels above price](https://tosindicators.com/wp-content/uploads/2021/03/KOPN-Squeeze-ThinkOrSwim-Chart-1024x576.jpg)KOPN on the daily chart at $11.14, with the Slingshot Squeeze stats (2 winners, 1 loser) and the Fibonacci extensions at $15.68 (127.2%) and $18.30 (161.8%).

With 100 shares bought at $11.14, the calculator showed these returns on the calls I looked at in the video:

| Expiration (days left) | Strike | Return if not exercised | Return if exercised |
| --- | --- | --- | --- |

| April 16, 2021 (26) | 17.50 | 4.94% | 62.03% |

| April 16, 2021 (26) | 20 (16 delta) | 2.87% | 82.41% |

| May 21, 2021 (61) | 20 | 8.08% | 87.61% |

| July 16, 2021 (117) | 20 | About 16% | Not read out |

The 17.50 strike is where KOPN's April calls first crossed the 50% threshold. If KOPN stayed below $17.50 through April 16, the premium alone returned 4.94%. If the shares were called away at $17.50, the total return was 62%.

The 20 strike, a 16 delta call, still paid 2.87%, between $30 and $40, and returned 82.41% if exercised. In rental terms, the house cost about $1,100 and the 20 strike paid about $35 of rent for 26 days. Lower strikes paid upwards of $150, if you were willing to sell the house fairly quickly.

If KOPN finished between the 2 extensions, below the 20 strike, the call would expire and I'd keep 100% of the premium. Then I could sell a call in the May series at a higher strike and repeat the trade.

![KOPN option chain with a Covered Calls column showing two return percentages for each call strike](https://tosindicators.com/wp-content/uploads/2021/03/Covered-Call-Calculator-on-ThinkOrSwim-Options-Chain.jpg)The Covered Calls column on KOPN's option chain for the April 16 and May 21, 2021 expirations. Green labels mark strikes where the if-called return is 50% or more.

### Comparing Expirations

The covered call calculator shows every expiration already calculated, so comparing series takes seconds. Going from the 26-day April series to the 61-day May series, the 20 strike's premium return rose from 2.87% to 8.08%. That's 5.21% more premium for 35 more days of risk.

The trade-off: the May 20 strike had less liquidity than the April one, and you have to stay in the trade longer while the premium erodes. I prefer the series around 30 days to expiration, where theta decay starts to work in your favor.

## How I Pick a Strike to Sell

The covered call calculator handles the math, and the chart picks the strike. I look for strikes near a level where I'd be happy to sell my shares anyway, like the Fibonacci extensions on KOPN. Then I use the column to compare the premium return and the if-called return at each one, across a few expirations, and pick the strike that pays best for that plan.

The premium is your only cushion if the stock drops: you hold all 100 shares through the decline. And if it rallies past your strike, your shares are called away and you give up the gain above it. Decide before you buy where you'd sell the shares if the trade fails, and size the position so that loss is a small, fixed part of your account.

## The Advanced Version and the Other Options Calculators

The covered call calculator is Part 1 of our options calculator series for the ThinkorSwim option chain. The other calculators reuse the math on this page:

- **[Advanced Covered Call Calculator](https://tosindicators.com/indicators/advanced-covered-call-calculator)** ([Volatility Box](https://tosindicators.com/volatility-box) members). Adds a cost basis input for shares you already own, such as a KOPN entry at the [Market Pulse](https://tosindicators.com/indicators/market-pulse) line at $9.46 instead of $11.14.

- **[Cash-Secured Put Calculator](https://tosindicators.com/indicators/cash-secured-put-calculator)** (free). Shows the premium return and the breakeven price for every put strike.

- **[Wheel Option Calculator](https://tosindicators.com/indicators/wheel-option-calculator)** (members). Puts the covered call math on calls and the put math on puts, in one custom quote.

## Common Problems and Customizing

Most covered call calculator problems come from how custom quotes work in ThinkorSwim:

- **The column shows NaN or "loading".** ThinkorSwim needs a moment to calculate each row after you click OK. In the video the NaN values cleared on their own.

- **The put side shows odd numbers.** A custom quote prints on both sides of the chain. The covered call formula is meant for calls, so ignore the put side or use the cash-secured put calculator there.

- **A thinly traded strike looks off.** The column prices each strike at its last close, not the current bid or ask. Check the bid and ask before you place the order.

- **The green threshold won't change.** The code has a `maxPctThreshold` input set to 0.5, but the `AddLabel` line compares against a typed-in 0.5. Edit that number, or swap in the input with the edit below.

Here is my suggested edit for the threshold. It isn't in the video or the download: replace the `AddLabel` line with this one, which compares against `maxPctThreshold` instead of 0.5.

```
AddLabel(yes, AsPercent(premiumPct) + " | " + AsPercent(premiumPlusSharesPct), if premiumPlusSharesPct >= maxPctThreshold then color.green else color.white);
```

With that change, the input controls the color, as a decimal: 0.3 means 30%. In the video, AT&T's chain showed no green at all with 35 strikes listed, while KOPN turned green from the 17.50 strike up. For another script that reads the option chain, see our [Option Chain Relative Value](https://tosindicators.com/indicators/options-deep-dive) tutorial.

## thinkScript code

```
#Written by TOS Indicators - 2021
#Home of the Volatility Box
#Covered Call Calculator
#Tutorial: https://www.tosindicators.com/indicators/covered-call-calculator
#The following thinkSript code needs to be pasted in a Custom Quote script on the options chain.

input maxPctThreshold = 0.5;

def maxShares = 100;
def maxContracts = 1;

def premium = maxContracts * close * 100;
def premiumPct = premium/(MaxShares * close(getUnderlyingSymbol()));

def strikePriceGain = getStrike() - close(getUnderlyingSymbol());
def premiumPlusSharesPct = ((strikePriceGain * maxShares) + premium)/(MaxShares * close(getUnderlyingSymbol()));

AddLabel(yes, AsPercent(premiumPct) + " | " + AsPercent(premiumPlusSharesPct), if premiumPlusSharesPct >= 0.5 then color.green else color.white);
```

## Questions

### What is a covered call calculator?

A covered call calculator shows the return on selling a call against 100 shares you own. Ours runs inside the ThinkorSwim option chain as a custom quote column and prints 2 numbers on every call: the premium as a percentage of the share cost, and the total return if your shares are called away at the strike.

### How do I add the covered call calculator to ThinkorSwim?

Open the Trade tab, click Layout above the option chain and choose Customize. Pick Custom Quotes from the drop-down, double-click an unused custom quote to add it, then click its scroll icon to open the editor. Delete the default code, paste in the calculator code and click OK twice.

### What do the two percentages in the column mean?

The left number is your return if the call expires and you keep only the premium. The right number is your return if the call is exercised: the premium plus the gain from the stock price up to the strike. Both divide by the cost of 100 shares at the stock's last close.

### How do you calculate the return on a covered call?

Divide the premium by the cost of the shares for the return if not exercised. For the return if exercised, multiply the strike minus the stock price by 100 shares, add the premium, and divide by the same cost. In the video, AT&T at $29.76 with a $43 premium on the 30 strike gave 1.44% and 2.25%.

### Why does the covered call calculator turn green?

The label turns green when the if-called return is 50% or more. The download has a maxPctThreshold input, but the AddLabel line uses a fixed 0.5. To change the cutoff, edit that number, or make the small edit I suggest on this page (not in the video) that compares against maxPctThreshold instead. In the video, KOPN's April calls turned green from the 17.50 strike up.

### Can I use the calculator on shares I already own?

The ThinkorSwim column measures every return from the stock's current close, which fits a new trade. For one trade, the web calculator at the top of this page has an optional cost basis field. On the option chain, the Advanced Covered Call Calculator for Volatility Box members adds a cost basis input, so the column shows returns from your own entry price.

### Which expiration do you use for covered calls?

In the video I prefer the series around 30 days to expiration, where theta decay works in your favor. Longer series pay more premium: KOPN's 20 strike went from 2.87% at 26 days to 8.08% at 61 days. The trade-off is less liquidity and more time in the trade.

### Does the covered call calculator work on puts?

The custom quote prints on both sides of the option chain, but its formula is built for calls, so the numbers on the put side aren't useful. For puts, use our free cash-secured put calculator, which shows the premium return and the breakeven price for each put strike.

## Related

- [Cash-Secured Put Calculator for ThinkorSwim](https://tosindicators.com/indicators/cash-secured-put-calculator)
- [How to Build a Fair Value Gap Indicator in ThinkorSwim](https://tosindicators.com/indicators/fair-value-gap)
- [How to Build a Heiken Ashi Trend Dots Indicator in ThinkorSwim](https://tosindicators.com/indicators/heiken-ashi)
- [How to Build a Commodities Tracker in ThinkorSwim](https://tosindicators.com/indicators/commodities-tracker)
- [Trend Squeeze Indicator for ThinkorSwim](https://tosindicators.com/indicators/trend-squeeze)
- [Volume Intensity Indicator for ThinkorSwim](https://tosindicators.com/indicators/volume-intensity)

