BuzzaMaker
BuzzaMaker encodes a stock's price history, its own news and broad macro news with a dual-stream Transformer, then lets a PPO agent decide how much of each stock — and cash — to hold every step, optimising log return after trading costs. Built on a real data pipeline that scrapes prices, crawls news and embeds it end to end.
The market is unpredictable — so let a model learn to act in it
Markets carry too many variables and too many unforeseeable shocks to script a strategy by hand. BuzzaMaker reframes the problem as one a model can learn: understand the recent past as a time series, then take an action, observe the outcome, and improve.
A Transformer reads each stock's price window together with the news that surrounds it — both the stock's own headlines and the macro backdrop — and a PPO agent turns that understanding into portfolio weights. The reward is the realised log return net of trading cost, so the policy is pushed toward risk-adjusted gains rather than raw bets.
A dual-stream Transformer that learns how much to trust the news
Dual-stream Transformer
Each StockNewsTransformerLayer runs self-attention over the price series and self-attention over the news embeddings separately, then a stock→news cross-attention lets price queries attend to the surrounding headlines. Stock and news each get their own 4× GELU feed-forward block.
Learnable news gate
Cross-attention is scaled by a learnable gate initialised to zero, so the model starts ignoring news and gradually learns how much to trust it during training — a built-in curriculum that keeps early training stable.
Portfolio-level aggregation
PortfolioMaker runs a StockNewsAgent per stock, then builds a macro token from global news and runs self-attention over [macro, stock₁ … stockₙ] so cross-asset and macro context shape every weight before the policy head reads them.
No future leakage
Causal masking on the price attention and learnable positional embeddings over a 60-day window keep the encoder strictly backward-looking — the model can only ever attend to information it would actually have had.
A PPO agent that allocates capital every step
Real prices and real news, scraped and embedded from scratch
Stock prices
OHLCV history pulled from Yahoo Finance via yfinance — 2017–2024 for training and early 2025 held out for testing (AAPL, given the cost of broader collection).
Stock-specific news
GDELT DOC 2.0 queried in 7-day rolling windows, articles fetched with the newspaper library, deduplicated by URL and parsed to text.
Macro news
Five themed keyword sets (politics, economy, technology, society, environment) scraped concurrently through a ThreadPoolExecutor with retry/backoff and resumable date logging.
Embeddings
Every article title embedded with Google Gemini (gemini-embedding-001) into 768-d vectors, batched and resumable so a stopped run picks up where it left off.
What it's built on
- Modeling
- PyTorchMulti-head attentionGated cross-attentionLearnable positional embedding
- Reinforcement learning
- Stable-Baselines3 PPOGymnasiumMultiInputPolicyCustom feature extractor
- Data
- yfinanceGDELT DOC 2.0newspaperpandas / numpy
- Embeddings
- Google Gemini (genai)768-d vectorsBatched & resumable
- Infra
- Python 3.12python-dotenvThreadPoolExecutor
Designed and built end to end — the scraping and embedding pipeline, the multi-modal Transformer encoder, and the reinforcement-learning portfolio policy.
