When I wrote the original post, I wasn’t planning on writing a follow-up. Certainly not the week after. But what a difference a week can make in a dynamic system like the US stock market.
While re-running the computations testing the latest version of RStudio, I noticed something surprising – President Trump’s rally has advanced to 2nd place!
A mere week ago, that seemed unthinkable. Something abnormal must have happened. Two things happened. First, the current stock market advanced another 2%. Nothing to brag about just another positive vote of confidence in the economy’s direction.
The more impactful reason behind this sudden switch became clear when I took a look at the President H.W. Bush’s rally. Even from the above chart, it’s clear the rally lost significant amount of steam within a day, or two max. Is this a problem with data? A bit of forensics:
election.date = "1988-11-08" require(quantmod) dj = getSymbols("^DJI", from="1900-01-01", auto.assign=F) id = findInterval(as.Date(election.date), index(dj)) tail(ROC(Cl(dj[id:(id+239)]), type="discrete", na.pad=F))
And the truth reveals itself:
Low and behold, no problem with the data, just a 7% drop on October 13th 1989. A quick search reveals that this was indeed Friday the 13th mini-crash! Friday, the 13th … mini-crash … What a coincidence!
I will keep it brief and wrap up this post here. There were a few improvements and changes I did to the R code used to perform these analysis – the Gist contains all of them. Please review, and let me know if you find problems with the code.
It’s all optimism in the air, judging by the market behavior at least.