This is an experiment in calibration, not investment advice. The next-day direction of a large-cap stock is close to a coin flip, and the accuracies below are meant to show exactly how close. Every published probability is kept in history.json and scored against what the market actually did, so the track record is the number to watch, not any single forecast.
How to read a row: blue bars grow to the right of the centre tick as the probability of a higher close rises above 50%; orange bars grow to the left as it falls below. The track spans 30% to 70%. Holdout acc. is walk-forward accuracy over the last trading year, with the always-majority baseline in grey after the slash. Click a row for the full validation numbers, the model's top features, and the backtest chart: the walk-forward model's daily probabilities drawn against what the stock actually did.
Taiwan
The table scrolls sideways on narrow screens.
Loading…
United States
The table scrolls sideways on narrow screens.
Loading…
Track record
Forecast log
Loading…
How it works
Data. Daily bars from Yahoo Finance through yfinance,
from January 2014 to the latest close, for each stock and for its market index
(TAIEX for Taiwan, S&P 500 for the US). Prices are adjusted for splits and
dividends before anything is computed; the close shown in the table is the raw one.
Features. About 35 numbers per day, all computable at the close: the last five daily returns; cumulative returns over 5, 10, 20 and 60 days; realised volatility over 5, 20 and 60 days; distance to the 5, 10, 20, 50 and 200-day moving averages; MACD and its histogram; RSI(14); Bollinger %B; volume relative to its 20-day mean; the day's range and where the close sat inside it; the overnight gap; distance to the 52-week high and low; the index's 1, 5 and 20-day returns and 20-day volatility; 20-day return relative to the index; and the day of the week.
Model. One XGBClassifier per stock and horizon, predicting
whether the adjusted close will be higher one trading day ahead, and separately
five trading days ahead. Shallow trees, a small learning rate and heavy
regularisation; the exact parameters are below.
Validation. Walk-forward over the last 250 labelled trading days. Every 21 days the model is refit on every row whose label was already known at that point, then scores the next 21 rows. For the five-day horizon the last five rows before each cut are excluded from training, since their labels were not yet observable. The accuracy in the table is over those 250 out-of-sample rows, and the grey baseline is what you get by always predicting the class that was more common in the training data. AUC, Brier score and accuracy on the confident subset (probability at least 10 points from 50%) are in each row's detail panel.
Schedule. A GitHub Actions workflow runs the whole pipeline at
23:47 UTC Monday to Friday, which is 07:47 in Taipei the next morning, after both
markets have closed, and again at 03:47 UTC in case Yahoo had not yet published the
previous US session. A third pass at 14:17 Taipei, after the Taipei close, scores the
morning's Taiwan forecasts the same day; it makes no new Taiwan forecast, since those
features need the US session that closes at 04:00 Taipei. Only sessions that have
closed are used: a bar of a session still in progress is dropped, so a run that lands
inside the Taipei morning session still forecasts from the last close. It commits
predictions.json and
history.json back to this repository, and the page reads them on load.
Before appending the day's forecasts it fills in the outcome of every earlier
forecast whose target bar now exists, which is where the track record comes from.
Model parameters and feature list from the latest run
Source: tools/stocks/predict.py, basket in tickers.json, schedule in stocks.yml.