Live data from Hacker News

Trump2cash – A stock trading bot powered by Trump tweets

github.com

71–80 of 163 posts

Re: Trump2cash – A stock trading bot powered by Trump tweets

#71
post #55

Very cool. Funds have been capitalizing on Trump's tweets since at least December (but probably November) of 2016: https://www.bloomberg.com/view/articles/2016-12-07/flash-cra... I'd be interested in learning why TradeKing was used , as I haven't used it myself - was it for an especially solid API, or just because TradeKing is easy to get set up and doesn't require a minimum investment? If anyone wants to play around…

> OP, you might be interested in Quantopian's Zipline algorithmic trading library, which is also in Python: https://github.com/quantopian/zipline

Or backtrader (backtesting and live trading with Oanda and IB)

https://github.com/mementum/backtrader

Re: Trump2cash – A stock trading bot powered by Trump tweets

#72
post #71
post #55

Very cool. Funds have been capitalizing on Trump's tweets since at least December (but probably November) of 2016: https://www.bloomberg.com/view/articles/2016-12-07/flash-cra... I'd be interested in learning why TradeKing was used , as I haven't used it myself - was it for an especially solid API, or just because TradeKing is easy to get set up and doesn't require a minimum investment? If anyone wants to play around…

> OP, you might be interested in Quantopian's Zipline algorithmic trading library, which is also in Python: https://github.com/quantopian/zipline Or backtrader (backtesting and live trading with Oanda and IB) https://github.com/mementum/backtrader

Nice, now I've got something else to play with this weekend.

Re: Trump2cash – A stock trading bot powered by Trump tweets

#73
Regardless of this bot being complete, there are better options already mentioned using options instead of short term stock purchases.

Looks like deciding the sentiment of the tweet is still on the to-do list.

def get_sentiment(self, text): """Extracts a sentiment score [-1, 1] from text."""

        # TODO: Determine sentiment targeted at the specific entity.

Re: Trump2cash – A stock trading bot powered by Trump tweets

#75
another version could be to capitialize on this:

"The efficient markets hypothesis may be "the best established fact in all of social sciences," but the best established fact in all of financial markets is that, when there is news about a big famous private company going public or being acquired, the shares of a tiny obscure public company with a similar name will shoot up. I don't know what that tells you about the efficient markets hypothesis, but it happened to Nestor, Inc., and to Tweeter Home Entertainment, and to Oculus VisionTech Inc., and now it has happened to SNAP Interactive Inc.:

In what is almost surely a case of mistaken identity, investors sent shares in a little known startup called SNAP Interactive Inc., ticker STVI, surging 164 percent in the four days since Snap Inc. filed for a $3 billion initial public offering. The $69 million SNAP Interactive makes mobile dating apps, while the IPO aspirant is the parent of the popular Snapchat photo-sharing app. These stories are always less impressive when expressed in dollar terms than they are in percentages. In the four trading days since Snap Inc. filed its S-1, SNAP Interactive has traded 19,963 shares, worth less than $200,000, according to Bloomberg data. If you had a cunning plan to buy up SNAP shares and sell them for a quick profit when Snap filed to go public, it might have worked, but not in particularly huge size."

article here: https://www.bloomberg.com/view/articles/2017-02-09/quasi-ind...

Re: Trump2cash – A stock trading bot powered by Trump tweets

#76
post #28
post #22

Earlier quoted context omitted.

That would likely be classed as "insider trading": https://en.wikipedia.org/wiki/Insider_trading

For that you'd have to be an "insider" which obviously isn't the case here.

You don't need to be hired by the company to be classed as an insider (though that obviously also counts). If you are privy to non-public information (which you would be if you were forewarned about a Trump PR stunt before it happened) and then you trade stock based on that information then legally you could be classed as an insider.

In fact that wiki link I posted earlier previously says just this: https://en.wikipedia.org/wiki/Insider_trading#Definition_of_... (last paragraph on 'Definition of "Insider"')

Re: Trump2cash – A stock trading bot powered by Trump tweets

#78
>This bot watches Donald Trump's tweets and waits for him to mention any publicly traded companies.

Ok, simple enough, go on.

> When he does, it uses sentiment analysis to determine whether his opinions are positive or negative toward those companies.

Eh, sentiment analysis isn't perfect but it has come a long way, plus Trump does typically say what he means in simplistic language.

> The bot then automatically executes trades on the relevant stocks according to the expected market reaction.

Ah market psychology. Stop. Do not pass Go. Do not collect $200. This is the tricky bit that a toy project will never get right and turns your slick algorithmic trading project into a monkey and a dart board.

Though this is a sweet example of an API mashup.

Re: Trump2cash – A stock trading bot powered by Trump tweets

#80

    This bot watches Donald Trump's tweets and waits for him to mention any publicly traded companies. When he does, it uses sentiment analysis to determine whether his opinions are positive or negative toward those companies. The bot then automatically executes trades on the relevant stocks according to the expected market reaction.
OK, so what's the expected market reaction? If Trump hates your company, does that make your stock go up, or down?
Post reply on HN