How to build a chart that displays the ratio of the Dow Jones Industrial average to the price of gold using thinkScript in the thinkorswim platform by TD Ameritrade
When asked to describe a widespread problem and then offer a solution I thought they meant for something like global warming. But alas, it was to solve a problem related to thinkorswim® using thinkScript®, the do-almost-anything-we-didn’t-think-of tool.
For my first trick, I want to show you how to build a chart that displays the ratio of the Dow Jones Industrial average to the price of gold. Despite the name, the “Dow-to-Gold Ratio” is used by many traders to tell how overpriced the S&P 500 (SPX) might be.
Referring to Figure 1 below, you can see historically as the SPX hit new highs, gold was also at highs, and the ratio remained relatively low. But at the time of writing, as SPX continues to rise, gold is going down. So SPX is becoming expensive valued in gold as well as U.S. dollars.
The Dow-to-gold ratio has been used to analyze everything from stock-market moves to predicting upcoming interest-rate decisions. We aren’t going to delve into Dow-to-gold theories, but rather describe how to see this ratio on thinkorswim. The problem we face is you can’t enter ratios in the symbol entry box on thinkorswim. So we need to think outside the (symbol entry) box to solve this one.
FIGURE 1: HOW OVERPRICED IS IT?
The Dow-to-Gold ratio (the lower indicator above) helps you see how overpriced the SPX (upper chart) might be relative to the ratio. For illustrative purposes only.
Starting on the thinkorswim Charts tab, bring up a one-year daily chart of the S&P 500 index by entering SPX in the symbol box. We’re going to build a study for a lower sub-graph of the chart in which the displayed data will be independent of the charted symbol—meaning, you can change the symbol without changing the new study. Once you see an SPX chart, fire up the thinkScript Editor by following the sidebar “Scripting from the Charts.” Then enter the following script:
After you’ve entered the above code, press Apply and OK and you’ll see a chart similar to Figure 2, with the Dow-to-gold indicator at the bottom.
Now let’s break down the code line by line to help you figure out how you got there.
Congrats, you have your own Dow-to-gold ratio chart. And since you solved this in a smart way, you now create any ratio chart you desire simply by editing the symbols in lines 3 and 4. We may not have solved global warming today, but we did make one small step for a legion of traders!
for thinkMoney ®
Financial Communications Society 2016
for Ticker Tape
Content Marketing Awards 2016
Content intended for educational/informational purposes only. Not investment advice, or a recommendation of any security, strategy, or account type.
Be sure to understand all risks involved with each strategy, including commission costs, before attempting to place any trade. Clients must consider all relevant risk factors, including their own personal financial situations, before trading.
Market volatility, volume, and system availability may delay account access and trade executions.
Past performance of a security or strategy does not guarantee future results or success.
Options are not suitable for all investors as the special risks inherent to options trading may expose investors to potentially rapid and substantial losses. Options trading subject to TD Ameritrade review and approval. Please read Characteristics and Risks of Standardized Options before investing in options.
Supporting documentation for any claims, comparisons, statistics, or other technical data will be supplied upon request.
This is not an offer or solicitation in any jurisdiction where we are not authorized to do business or where such offer or solicitation would be contrary to the local laws and regulations of that jurisdiction, including, but not limited to persons residing in Australia, Canada, Hong Kong, Japan, Saudi Arabia, Singapore, UK, and the countries of the European Union.
TD Ameritrade, Inc., member FINRA/SIPC, a subsidiary of The Charles Schwab Corporation. TD Ameritrade is a trademark jointly owned by TD Ameritrade IP Company, Inc. and The Toronto-Dominion Bank. © 2021 Charles Schwab & Co. Inc. All rights reserved.