This Machine Turns Trump Tweets into Planned Parenthood Donations
Like many who call the United States their home, I have been worried and confused by the start to Donald Trump’s presidency. It’s hard to know how to react to the misdirected anger, the blatant racism, and the “alternative facts”, which are increasingly threatening our civil liberties and our planet. It’s important that we take to the streets and fight back. Seeing that happen does give me hope.
Personally, I have a very particular set of skills, skills that allow me to have some fun with Mr. Trump’s emotional incontinence and maybe effect positive change along the way.
Our new President really likes to use Twitter. He uses it to express strong opinions about all sorts of things. Occasionally, those opinions are targeted at publicly traded companies. You see where this is going.
Take this recent outburst of his, directed at Toyota. Their stock price abruptly dropped right after Trump’s tweet.
He does this a lot, a dozen times this January alone, and it’s not always negative. There’s also praise for companies who publicly act on his threats — or have it appear like they did.
So here’s the idea:
What if you wrote some code that constantly monitors Trump’s feed and analyzes each tweet for mentions of publicly traded companies? Then, you’d immediately trade the affected stocks based on the detected sentiment: buy if positive and short if negative. The whole thing could be 100% automated.
I just finished writing a bot which does exactly that. For your convenience, it also tweets out a summary as @Trump2Cash each time it springs into action.
But does it actually work? Let’s look at the numbers.
Check out the benchmark report. It’s essentially a test run that shows you how the algorithm performs on past tweets and market data. You’ll see that it sometimes misses a company or gets a sentiment wrong, but it also gets it right a lot. The trading strategy sometimes leaves you up and sometimes down.
Overall, the algorithm seems to succeed more often than not: The simulated fund has an annualized return of about 59% since inception. There are limits to the simulation and the underlying data, so take it all with a grain of salt.
I had fun building this. In fact, I started coding while on a plane to Europe and had the first version working by the time we touched down. (Shout-out to Cloud Platform!) But don’t bet your life savings on it. Markets are unpredictable. Trump is unpredictable.
As for my own fund, I’m donating the profits in equal parts to the American Civil Liberties Union, the Natural Resources Defense Council, and Planned Parenthood. (They always take your donations, even if the money wasn’t earned by a robot.)