Static web app that lets you pick any stock ticker and play a simple up/down prediction game using real data from Alpha Vantage.
Uses:
- Alpha Vantage TIME_SERIES_DAILY_ADJUSTED (real market data)
- Chart.js for visualization
- Enter a valid ticker (e.g.,
MSFT,AAPL,COF). - The app fetches real daily prices from Alpha Vantage.
- It chooses a random starting trading day between 7 and 100 days before today.
- It shows the 7 trading days before that start date plus the start date itself.
- You predict whether the next day's close will go up or down. The app reveals the next day, updates the chart and your score, and you continue until you stop.
Just open index.html in a modern browser. Because the app calls Alpha Vantage from the browser, there is no build step required.
If you run into CORS caching issues, try using a simple HTTP server (examples):
# Python 3
python3 -m http.server 8000
# Node
npx http-server -p 8000Then open http://localhost:8000.
Option A: Deploy from the root of main branch
- Create a new GitHub repository and push these files.
- Go to Settings → Pages.
- Under "Build and deployment", set:
- Source: Deploy from a branch
- Branch:
main(or your default) and root (/).
- Save. Your site will be published at
https://<your-username>.github.io/<repo-name>/.
Option B: Deploy from docs/ folder
- Move all files into a
docs/folder at the repo root. - In Settings → Pages, choose the
mainbranch and/docsfolder.
The app uses the provided API key in app.js:
const API_KEY = "MBX1XO94WJHYAW9P";If you prefer to use your own key, replace it there.
- Alpha Vantage free tier has rate limits (typically 5 req/min, 500/day). If you see an API limit message, wait a minute and try again.
- The app only uses real market data. No mock or demo data is used.