A behavioural signal model that correlates 56,571 presidential tweets with Google search behaviour — 2016 to 2021.
- Correlates Trump tweets with Google Trends search spikes across 6 topics
- Invents the Attention Elasticity Index (AEI) — weights learned via Ridge regression
- Backtests a volatility-targeted trading strategy against the S&P 500
- Predicts search spikes and attention half-life for any input tweet
Download the Trump tweets dataset from Kaggle: https://www.kaggle.com/datasets/codebreaker619/donald-trump-tweets-dataset Save as tweets.csv in the project folder, then run the scripts in order.
pip3 install dash plotly pandas numpy textblob scikit-learn yfinance pytrends
- python3 anylasis.py
- python3 trends.py
- python3 get_market.py
- python3 app.py Then open http://127.0.0.1:8050