Skip to main content

Price to Book Ratio Indicator and Scan for ThinkOrSwim (Free Download)

IndicatorFreeBeginner12 min video11 lines of codeOct 23, 2022

A free price to book ratio indicator for ThinkOrSwim that plots P/B history, plus a scan for stocks with a P/B ratio between 0 and 1.0.

Price to Book Value Calculator on a C chart in ThinkOrSwim
On this page

Overview

In this tutorial I look for stocks trading below their usual price to book ratio in ThinkOrSwim, in 2 steps. First, a scan finds stocks with a P/B ratio between 0 and 1.0. Then a 4-line indicator plots each stock's P/B history, so you can see which ones normally trade above 1.0 and have dropped below it.

I made the video during a bear market (the code is dated 2022), when the scan returned 204 stocks. It's for investors who use book value to find possible deals and want to check the numbers first: the video also compares ThinkOrSwim's P/B with Yahoo Finance and Koyfin, and they don't always agree.

Key Takeaways

  • The price to book ratio indicator divides the close by BookValuePerShare for the fiscal year and plots it with a reference line at 1.0. It's 4 lines of thinkScript.
  • The scan in the video uses the All Optionable list, a 50-day average volume of at least 1 million shares, and a current Price to Book Value Ratio above 0 and below 1.0. It returned 204 stocks.
  • The stocks worth a look are below 1.0 now and usually above it. Citigroup had stayed below 1.0 for most of 10 years, so there was no deal. General Motors usually sat above 1.0 and read 0.80 on Yahoo Finance.
  • The fiscal-year book value stops the indicator's line at the end of the last fiscal year, so check the current ratio on Yahoo Finance or Koyfin.
  • Wells Fargo shows why: the scan put it below 1.0, while Yahoo Finance and Koyfin both put it above.

What Is the Price to Book Ratio?

The price to book ratio (P/B) is a stock's price divided by its book value per share. Book value is the company's assets minus its liabilities, the shareholders' equity on its balance sheet. A P/B of 1.0 means the market values the company at its book value.

A P/B below 1.0 means the stock trades for less than the company's net assets on paper. That can be a deal, or it can be normal for that company: plenty of stocks live below 1.0 most of the time, and for those, a reading below 1.0 is no deal.

The price to book ratio measures value against assets. Our P/E ratio indicator measures it against earnings, and for dividend payers, the dividend yield indicator adds a third view.

The Two-Step Process

The price to book ratio process in the video is 2 steps, plus a data check:

  1. Scan for stocks with a current P/B between 0 and 1.0.
  2. Plot each result's historical P/B in ThinkOrSwim and keep the ones whose ratio usually lives above 1.0.
  3. Check the current P/B on Yahoo Finance or Koyfin, because ThinkOrSwim's book value data stops at the last fiscal year.

The goal is a stock that usually trades above 1.0 and has dropped below it, so the ratio has room to return toward its usual level: a regression to the mean of sorts. It's one approach to finding undervalued stocks among many.

How to Build the Price to Book Scan

The price to book scan is 2 filters on top of a liquid stock list. These are the steps from the video:

  1. Open the Scan tab and remove any filters already loaded, so you start from a blank slate.
  2. For the list of stocks to scan, open the category menu and choose All Optionable. Those stocks are tradable, fairly liquid and have options.
  3. Click Add filter, choose Study, then Volume, then Average Volume. Set the average volume over the past 50 days to at least 1,000,000 shares, using a simple moving average.
  4. Click Add filter again and choose Fundamental. Pick Price to Book Value Ratio, leave the second setting on Current, and set the minimum above 0 and the maximum below 1.0.
  5. Set Show to 500 and run the scan. Sort by volume so the most-traded names are at the top.
FilterSetting in the video
Stock listAll Optionable
Average Volume (study)At least 1,000,000 shares, 50-day simple average
Price to Book Value Ratio (fundamental)Current, greater than 0, less than 1.0
Results204 stocks

The results include ETFs like SPY, which I skip: the process is for stocks. You can add more filters to narrow 204 names down further. For more on average volume, see our Average Volume Stats indicator, and for other ready-made filters, our free ThinkOrSwim scans.

How the Price to Book Ratio Indicator Works

The price to book ratio indicator is 4 lines of thinkScript: price, book value, the ratio and a reference line. To build it, open the Charts tab, click the Studies icon, choose Create, delete the default code and type it in.

Price and Book Value

This step’s code is free with an account. Create one or sign in.

close is the price. BookValuePerShare is a built-in thinkScript function with 2 parameters: the symbol and the fiscal period. getSymbol() returns the symbol of whatever chart you're on, and the function's notes say the fiscal period has to be set to the year.

The Ratio and the 1.0 Line

This step’s code is free with an account. Create one or sign in.

plot ratio draws the price to book ratio. plot one draws a flat line at 1.0, so you can see at a glance whether the ratio usually lives above or below it.

The code has no declare lower, so after you click OK, move the study to the lower pane, as I do in the video. On SPY it plotted nothing; on Citigroup the ratio showed up as expected.

Why the Line Stops at Last Year

The fiscal-year setting is the indicator's one limitation. The historical ratio stops at the end of last year, because ThinkOrSwim doesn't have the full book value for the current year yet. For the current ratio, I use Yahoo Finance or Koyfin.

Citigroup, Wells Fargo and General Motors

The price to book ratio scan put all 3 of these stocks below 1.0. The indicator and the other data sources told 3 different stories:

StockP/B history in ThinkOrSwimCurrent P/B on other sitesWhat I concluded
CitigroupBelow 1.0 for most of the past 10 yearsNot checkedNo deal: below 1.0 is normal for it
Wells FargoMostly above 1.0Above 1.0 on Yahoo Finance and KoyfinA data discrepancy: not below 1.0 after all
General MotorsMostly above 1.00.80 on Yahoo Finance, below 1.0 on KoyfinUndervalued by this measure

General Motors was the one that fit: a P/B that historically stayed above 1.0, now below it, confirmed by 2 other sources. I noted that once GM was past its earnings report, the setup could open up a decent opportunity. Our upcoming earnings scan shows which stocks report soon.

Checking the Current P/B on Yahoo Finance and Koyfin

Yahoo Finance and Koyfin both show the current price to book ratio, which fills the gap the fiscal-year data leaves in ThinkOrSwim:

  • Yahoo Finance. Run a quote, open Statistics and find the price to book value. The first column is the current value, and the next ones go back 4 quarters (to 2021 in the video). To check another stock, change the ticker in the URL.
  • Koyfin. The free version works. Search a ticker, open the Multiples tab, and scroll to the price to book value. The last column is the current ratio, and you can see how it changed over time.

In the video, ThinkOrSwim was the odd one out on Wells Fargo: both other sources put its current ratio above 1.0. On the current value, I'd chalk ThinkOrSwim up as less accurate than these sites, so check a second source before you act on a scan result.

How I Use the Price to Book Ratio

The price to book ratio scan gives me a starting list, and the history decides which names are worth more research. The stock I want is one whose ratio usually sits above 1.0, is below it now, and checks out on a second data source.

A stock below book value can keep falling, so treat the ratio as a filter, not an entry. Decide where your stop goes before you buy, and size the position so a stop-out costs a small, fixed share of your account.

For a fuller picture of value, pair it with the P/E ratio history and, for dividend stocks, our Dividend Discount Model.

Common Problems and Fixes

Most price to book ratio indicator problems come from the data or the study's placement:

  • The study lands on the price chart. The code has no declare lower. Move it to the lower pane, or add declare lower; as the first line (an optional edit that isn't in the download or the video).
  • Nothing plots. On SPY the study showed nothing in the video. The fix is to use it on individual stocks.
  • The line ends at last year. That's the fiscal-year book value. Check the current ratio on Yahoo Finance or Koyfin.
  • The scan and other sites disagree. As with Wells Fargo, ThinkOrSwim's current ratio can differ from Yahoo Finance and Koyfin. Check a second source.
  • Too many results. 204 names is a lot to chart one by one. Add more filters to the scan to narrow the list.

Full thinkScript code

Price to Book Value Calculator.tsthinkScript · 11 lines
The full code is free with an account

Create a free account or sign in to copy all 11 lines and download the file.

Download

Price to Book Value Ratio

Download the Price to Book Ratio indicator for ThinkOrSwim. The download is a .zip with one file, TI_PB_RatioSTUDY.ts: the 4-line study from the video, the same code as the Code tab on this page. The scan isn't in the download: build it in the Scan tab with the filters on this page. If you haven't imported a study before, here's how to import into your ThinkOrSwim platform.

Download free

Video: Price to Book Value Calculator, built line by line

12 minutes on YouTube.

Watch on YouTube

Questions

What is the price to book ratio?

The price to book ratio divides a stock's price by its book value per share, where book value is assets minus liabilities. A ratio below 1.0 means the stock trades for less than the company's net assets on paper. In the video I look for stocks below 1.0 whose ratio normally sits above it.

How do I scan for low price to book stocks in ThinkOrSwim?

In the Scan tab, choose the All Optionable list, add a Study filter for Average Volume of at least 1 million shares over 50 days, then add a Fundamental filter for Price to Book Value Ratio set to Current, above 0 and below 1.0. In the video this returned 204 stocks.

How do I plot the historical price to book ratio?

Create a study with 4 lines: def curr = close, def bv = BookValuePerShare(getSymbol(), FiscalPeriod.Year), plot ratio = curr / bv, and plot one = 1 for a reference line. Move it to the lower pane. It shows the ratio's history through the end of the last fiscal year.

Why does the P/B line stop at the end of last year?

BookValuePerShare uses fiscal-year data, and ThinkOrSwim doesn't have the full value for the current year yet. The historical ratio stops at the end of the last fiscal year, so I check the current ratio on Yahoo Finance or Koyfin, which both show the latest value.

Is a price to book ratio below 1 a good deal?

Only if it's unusual for that stock. Many stocks trade below 1.0 most of the time: in the video, Citigroup had stayed below 1.0 for most of 10 years. General Motors, which historically sat above 1.0, read 0.80 on Yahoo Finance, the kind of drop I look for.

Why does ThinkOrSwim show a different P/B than Yahoo Finance?

The sources don't always agree on the current value. In the video, the ThinkOrSwim scan put Wells Fargo below 1.0, while Yahoo Finance and Koyfin both showed it above 1.0. Treat a scan result as a starting point and check a second source.

Where can I find the current price to book ratio?

Yahoo Finance shows it under Statistics, with the current value first and the last 4 quarters beside it. Koyfin's free version shows it on the Multiples tab, with the current ratio in the last column and its history over time.

What is the difference between P/B and P/E?

The P/B ratio compares the price with the company's book value, its net assets. The P/E ratio compares the price with its earnings over the last 12 months. Our free P/E ratio indicator plots P/E history in ThinkOrSwim the same way this indicator plots P/B history.

Get each new indicator by email

One email on Sundays with the week's new tool and its code. A free account also unlocks every .txt download.

No credit card. Unsubscribe anytime.