- The Complete Guide to Building a Price to Book Ratio Calculator in ThinkOrSwim
- What the Price to Book Ratio Actually Tells You
- The Two-Step Process for Finding Real Value
- Setting Up Your ThinkOrSwim Scanner
- Building the Historical P/B Calculator
- Reading the Historical Patterns
- Cross-Checking Your Data
- Real Examples from the Scanner
- Sector Differences You Should Know
- Risk Management for Value Plays
- Improving Your Scanner Results
- Common Mistakes to Avoid
- Putting It All Together
Master Value Investing with Price to Book Ratio Analysis
Discover how to identify undervalued stocks using the powerful Price to Book ratio calculator and advanced scanning techniques in ThinkOrSwim.
This comprehensive tutorial teaches you to:
- Build a custom P/B ratio calculator with historical analysis
- Create sophisticated scans for undervalued opportunities
- Compare current ratios with historical averages
- Validate findings using multiple data sources
Perfect for value investors and fundamental analysts looking to systematically identify stocks trading below their book value with strong potential for mean reversion.
The Complete Guide to Building a Price to Book Ratio Calculator in ThinkOrSwim
The Price to Book (P/B) ratio helps value investors identify stocks potentially trading below their worth. When markets crash, many solid companies see their P/B ratios drop to historically attractive levels. Here’s how to build a P/B ratio calculator in ThinkOrSwim and create scans to find these opportunities.
What the Price to Book Ratio Actually Tells You
The P/B ratio compares a company’s market value to its book value – essentially how much investors pay for each dollar of net assets. A ratio below 1.0 means the stock trades for less than its book value, which sounds great until you realize some industries always trade this way.
Book value represents shareholders’ equity from an accounting perspective – total assets minus total liabilities. It’s what shareholders would theoretically get if the company were liquidated tomorrow. While not perfect due to accounting quirks, it gives you a baseline for comparison.
The Two-Step Process for Finding Real Value
Most people just scan for P/B ratios under 1.0 and call it a day. That’s lazy and unprofitable. You need a two-step approach that separates real opportunities from value traps.
Step 1: Initial Screen
Scan for stocks with P/B ratios between 0 and 1.0, but only look at liquid stocks you can actually trade. No point finding “value” in some penny stock you can’t get in or out of.
Step 2: Historical Context
Here’s where most people fail – you need to check if the current ratio is actually unusual for that stock. A bank trading at 0.8x book value might be normal, while a tech company at the same level could signal serious problems.
Setting Up Your ThinkOrSwim Scanner
Building an effective scanner takes some thought. You want to catch opportunities without drowning in garbage stocks you can’t actually trade.
Start with Quality Stocks
Go to ThinkOrSwim’s Scan tab and select “All Optionable” as your base. This gives you liquid stocks with options, which means you can actually do something with them if they look good.
Filter for Liquidity
Add a volume filter: “Add Filter” > “Study” > “Volume” > “Average Volume.” Set it to at least 1,000,000 shares over 50 days. Nobody wants to get stuck in an illiquid stock, no matter how “cheap” it looks.
Add the P/B Filter
Here’s the main event: “Add Filter” > “Fundamental” > “Price to Book Value Ratio.” Set minimum > 0 and maximum < 1.0. This finds stocks trading below book value while avoiding companies with negative book values (usually a bad sign).
Running this scan typically gives you 200+ stocks. The exact number depends on market conditions – bear markets create more opportunities as selling pressure hits everything.
Building the Historical P/B Calculator
The scanner finds current opportunities, but you need historical context to know if they matter. Time to build a custom calculator.
The Code Components
You need two things: current price (easy) and book value per share (less easy). ThinkOrSwim has a BookValuePerShare function that takes the symbol and fiscal period as inputs.
Writing the Calculator
Go to Charts > Studies > Create. Delete the default code and start fresh:
Define current price: def curr = close;
Define book value: def bv = BookValuePerShare(getSymbol(), FiscalPeriod.Year);
The getSymbol() function grabs whatever chart you’re looking at, while FiscalPeriod.Year uses annual data for consistency.
Calculate the ratio: plot ratio = curr / bv;
Add a reference line: plot one = 1;
That’s it. Simple code that creates a powerful tool showing P/B ratios over time, with automatic adjustments for splits and corporate actions.
Reading the Historical Patterns
Now comes the important part – figuring out what the historical data actually means for your trading decisions.
What to Look For
Load your calculator on scan results and look for clear patterns. You want stocks where the current sub-1.0 ratio represents a real change from normal behavior. Companies that always trade above 1.0 but suddenly drop below often present the best opportunities.
Data Limitations You Need to Know
ThinkOrSwim’s BookValuePerShare function updates annually, so there’s a lag. The historical plot typically stops at last year-end, which means you need external sources for current data. This isn’t a bug – it’s just how fundamental data works.
Cross-Checking Your Data
Since ThinkOrSwim’s data has limitations, you need other sources to get current information and avoid bad trades based on stale data.
Yahoo Finance Method
Yahoo Finance gives you current P/B ratios easily. Search your ticker, click Statistics, and find the Price to Book ratio in valuation measures. Yahoo also shows quarterly trends, helping you understand recent changes.
Koyfin for Better Analysis
Koyfin (free version works fine) offers better visualization tools. Search your ticker, go to “Multiples,” and you’ll get comprehensive P/B analysis with historical context and peer comparisons. Much easier to spot real opportunities versus normal variations.
Using multiple sources helps catch data discrepancies and ensures you’re working with accurate information before making trading decisions.
Real Examples from the Scanner
Let’s look at actual stocks from scanner results to see how this analysis plays out in practice.
Citigroup – The False Positive
Citigroup often shows up in P/B scans because it’s a bank. Historical analysis shows Citigroup has traded below 1.0 consistently for the past decade. The current sub-1.0 ratio isn’t special – it’s just normal for this stock. No opportunity here.
General Motors – The Real Deal
General Motors presents a better case. Historical data shows GM typically trades above 1.0, making the current 0.80 reading potentially significant. External sources confirm this ratio, well below historical norms. This suggests possible mean reversion, especially after earnings that might change sentiment.
Wells Fargo – The Data Problem
Wells Fargo shows why you need multiple sources. ThinkOrSwim might show sub-1.0, while Yahoo and Koyfin show above 1.0. These discrepancies happen due to timing differences and highlight why cross-checking matters for important decisions.
Sector Differences You Should Know
Different industries have different P/B ratio personalities. Understanding these patterns helps you avoid wasting time on false signals.
Financial Stocks
Banks often trade below book value during stress periods. Sometimes this means opportunity, sometimes it means the bank is in trouble. You need to look at asset quality and regulatory issues, not just the ratio.
Industrial Companies
Manufacturing companies with lots of physical assets often give clearer P/B signals. Their book values better reflect real asset values, making the ratio analysis more reliable.
Tech Companies
Tech stocks rarely show up in sub-1.0 scans because they don’t own much physical stuff and usually trade at premiums. When they do appear, it often means something’s seriously wrong rather than a value opportunity.
Risk Management for Value Plays
Value investing based on P/B ratios needs disciplined risk management. “Cheap” stocks can get cheaper, and timing mean reversion is tough.
Don’t Go All-In
Spread your bets across multiple names and sectors. Market conditions that create P/B opportunities often hit multiple stocks at once, increasing correlation risk.
Be Patient
P/B ratio opportunities often take time to work out. Think quarters or years, not days or weeks. Use smaller position sizes with longer time horizons rather than trying to time short-term moves.
Look for Catalysts
The best P/B trades often have something that might trigger revaluation – earnings, management changes, or sector rotation. Pure ratio plays without catalysts can stay cheap forever.
Improving Your Scanner Results
Add other filters to catch higher-quality opportunities and avoid obvious value traps.
Financial Health Checks
Add debt-to-equity ratios and current ratios to screen out companies that are cheap because they’re in trouble. Healthy balance sheets improve your odds of successful mean reversion.
Profitability Filters
Include return on equity and profit margin filters. Companies that generate decent returns on their book value while trading below it often represent better opportunities than money-losing enterprises.
Technical Confirmation
Consider adding technical filters like relative strength or moving average relationships to find stocks showing signs of stabilization rather than continued decline.
Common Mistakes to Avoid
Falling for Value Traps
Not every cheap stock is a bargain. Companies in dying industries or facing major disruption may deserve low valuations. Focus on temporary market overreactions, not permanent business problems.
Trusting Book Value Blindly
Accounting book value can be misleading due to asset write-downs, goodwill problems, or hidden liabilities. Don’t rely on ratios alone – check if the assets are actually worth what the books say.
Expecting Quick Results
Value investing takes time. Don’t use leverage or short-term options expecting quick mean reversion. Many of the best value plays take years to work out.
Concentrating in One Sector
Market conditions that create P/B opportunities often hit entire sectors. Diversify across industries and market caps to reduce the risk of being wrong about a whole sector.
Putting It All Together
The P/B ratio calculator and scanner give you a systematic way to find undervalued opportunities, but success comes from using them properly. Combine scanning with historical analysis and cross-reference multiple data sources before making decisions.
The best opportunities usually emerge during periods of maximum pessimism when quality companies trade at big discounts to historical valuations. But remember – P/B analysis works best as part of a broader research process, not as a standalone decision-making tool.
Use this system to identify candidates for further research rather than making buy decisions based purely on ratios. The companies that survive your screening process often represent genuinely attractive risk-adjusted opportunities, especially during market downturns when fear creates temporary mispricings.
#TOS Indicators
#Home of the Volatility Box
#Indicator: P/B Ratio
#Code written in 2022
#Full Tutorial: https://www.tosindicators.com/indicators/pb-ratio
// ... 7 more lines ...Here are some resources that you may find useful: