for (i = 0; i 4) {
afterParagraphFour = true;
currentParagraph = storytext.childNodes[i];
heights += currentParagraph.clientHeight;
if (heights >= limit && insertAfterThisParagraphIndex === -1) {
insertAfterThisParagraphIndex = SMARTASSET.setDivIndex(i);
console.log(“insert after paragraph number ” + i);
console.log(“HEIGHTS = ” + heights);
console.log(“LIMIT = ” + limit);
/* div with id=”ie_column” */
else if (storytext.childNodes[i].nodeName.toLowerCase() === ‘div’ &&
storytext.childNodes[i].id !== “undefined” &&
storytext.childNodes[i].id ===”ie_column”) {
heights = 0;
limit = 80;
insertAfterThisParagraphIndex = -1
/* embeds from twitter, facebook, youtube */
else if (storytext.childNodes[i].nodeName.toLowerCase() === ‘div’ &&
storytext.childNodes[i].classList.contains(’embed’)) {
heights = 0;
limit = 80;
insertAfterThisParagraphIndex = -1
/* cnn video player */
else if (storytext.childNodes[i].nodeName.toLowerCase() === ‘div’ &&
storytext.childNodes[i].classList.contains(‘cnnplayer’)) {
heights = 0;
limit = 80;
insertAfterThisParagraphIndex = -1
/* images */
else if (storytext.childNodes[i].nodeName.toLowerCase() === ‘img’) {
heights = 0;
limit = 80;
/* images stored in figure tags */
else if (storytext.childNodes[i].nodeName.toLowerCase() === ‘figure’) {
heights = 0;
limit = 80;
if (heights >= 875 && afterParagraphFour) {
storytext.childNodes[insertAfterThisParagraphIndex].insertAdjacentHTML(‘afterend’, smartAssetDiv);
smartasset = document.getElementById(‘smartasset-article’);
smartasset.style.float = ‘left’; // allows module to have text float to right
smartasset.style.marginRight =’20px’;
smartasset.style.marginBottom =’25px’;

SMARTASSET.setSmartAssetScript = function() {
console.log(‘starting setSmartAssetScript’);
SA = document.SA || [];
embedUrl: “https://smartasset.com”,
container: “#smartasset-article”,
version: 1.1,
{ key: “bdknf2rinbhwvdksm6zbmhf3twrv4oih” }
/*{ key: “CNNe038d38a57032085441e7fe7010b0” }*/
console.log(‘finished in setSmartAssetScript push() call’);

var smscript = document.createElement(“script”);
smscript.type = “text/javascript”;
smscript.async = true;
smscript.src = (“https:” == document.location.protocol ? “https://” : “http://”) + “smartasset.com/embed.js”;

var s = document.getElementsByTagName(“script”)[0];
s.parentNode.insertBefore(smscript, s);
console.log(“finished entire function of setSmartAssetFunction()”);

Every Sunday in October, CNNMoney will check in on what the “market metrics” tell us about Election 2016. Right now, the S&P 500 test points to a Trump win, but everything else points to Clinton.

1. The stock market test

election metrics stocks

Watch the performance of the stock market between August 1 and October 31. If stocks go up during that three-month stretch, expect Clinton to win. If stocks slide, Trump will likely prevail.

At the moment, Trump has a slight edge because the S&P 500 (the main U.S. stock market index) has fallen a small amount since August 1. But it is nearly back to where it was on that day.

It might sound far-fetched, but the stock market has been astonishingly accurate at predicting the winner in every election since 1944, according to Sam Stovall, a stock market expert at S&P Global Market Intelligence.

2. ‘It’s the economy, stupid’

election metrics gas prices

The number crunchers over at Moody’s Analytics have a special model to predict who will end up in the White House based on how the economy is doing. The model has correctly predicted the winner every election since 1980.

This year, the model points to a solid Clinton win because of a relatively healthy economy.

Only two factors could change the model enough to point to a Trump victory: if gas prices spike above $3 a gallon, or President Obama’s approval rating falls substantially.

Americans currently pay $2.21 a gallon for gas, on average, according to AAA. Prices might go up a little after OPEC announced it would freeze production, but they aren’t expected to jump much.

3. The Mexican factor

election metrics peso

It might sound odd to look at Mexico’s currency for clues on who will win the U.S. presidency, but the Mexican peso has become a new proxy for the Clinton v. Trump matchup. At the moment, it’s signaling a Clinton victory.

Why? It all comes down to Trump’s comments on Mexico. He wants to build a wall between the U.S. and Mexico (that he wants Mexico to pay for), renegotiate NAFTA and come down hard on U.S. companies that move factories, and supposedly jobs, south of the border.

So every time investors think Trump’s chances of winning improve, the Mexican peso falls. And when Wall Street believes Trump doesn’t have much of a shot at the White House, the Mexican peso rises. After the first debate, the Mexican peso jumped.

4. Riding the railroad to victory

election metrics kansas city

Finally, take a peek at Kansas City Southern (KSU) stock now and then. It, too, signals what Wall Street thinks of Trump’s chances. When Wall Street thinks Trump is going to lose, the stock rises.

Rich Paterson, an equity analyst at Loop Capital Markets in New York, first figured out that there was a strong correlation between Trump’s poll numbers and KCS stock performance.

The reason is KCS operates in both the U.S. and Mexico. Roughly a quarter of the railroad company’s business is transporting items like cars between the two countries.

“Any threat to NAFTA is a threat to KCS,” says Paterson.

After the first debate, Kansas City Southern was the best performing railroad stock on Tuesday, gaining 1.6%. It climbed higher the rest of the week as well.

–CNNMoney’s Patrick Gillespie contributed to this report.

CNNMoney (New York) First published October 2, 2016: 9:09 AM ET

Terms & Conditions apply

NMLS #1136