A Python bot that analyzes Trump tweets for company mentions, performs sentiment analysis, and automatically executes stock trades.
Trump2Cash is a Python-based automated trading bot that monitors Donald Trump's tweets for mentions of public companies. It performs sentiment analysis on those mentions to predict market reactions and automatically executes stock trades through brokerage APIs. The bot also tweets real-time summaries of its analysis and trades.
Developers and hobbyists interested in algorithmic trading, sentiment analysis, and API automation, particularly those exploring the intersection of social media data and financial markets.
It provides a fully automated, real-world example of a social media-driven trading strategy, with modular code that can be adapted or extended. Unlike generic trading bots, it focuses on a specific, high-impact data source (Trump's tweets) and demonstrates integration with multiple cloud APIs.
A stock trading bot powered by Trump tweets
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Twitter Streaming APIs to instantly capture and process new tweets from Donald Trump, enabling prompt reaction as shown in the main.py callback setup.
Integrates Google Cloud Natural Language API to detect companies and assign sentiment scores automatically, removing manual analysis steps.
Code is split into analysis.py, trading.py, and twitter.py modules, making it easy to understand, test, and extend based on the README structure.
README provides detailed steps for setting up API keys, dependencies, and deployment on Google Compute Engine or Docker, reducing guesswork.
Requires setting up and maintaining API keys for Twitter, Google Cloud, TradeKing, and optionally Polygon, which is complex and error-prone as outlined in the auth steps.
Trades are executed based solely on tweet sentiment without considering market conditions or risk diversification, as implied by the basic buy/sell strategies in trading.py.
Relies on specific APIs like TradeKing (which may be deprecated) and Google Cloud services, making the bot fragile to external changes without code updates.
Automates real-money trades with minimal safeguards; the README warns to test with USE_REAL_MONEY=NO first, highlighting potential for losses.