04Interactive forecasting and market researchIndependent project
Signal Market Lab
A market research dashboard for exploring prices, running forecasts, and comparing models. It combines Python data workflows with a Next.js demo where visitors can import CSV files and run calculations in their browser.
I wanted people to be able to inspect a forecast: the data behind it, the prediction horizon, and whether it improved on repeating the last price. Stocks, currencies, and Bitcoin also needed different explanations of their fundamental data.
The first version used a Python API, SQLite, and background workers. For the public demo, I needed visitors to run experiments without an always-on application server or access to provider credentials.
02 / Approach
How I built it
I built the initial research engine in Python, with versioned datasets, CSV validation, walk-forward backtesting, and saved experiments in SQLite. It compares a rolling 30-observation log-linear trend with a last-price naive model, reporting MAE over the same evaluation dates and observation horizon.
For v2, I separated data refresh from visitor computation. GitHub Actions fetches provider data on a six-hour schedule and publishes normalized JSON snapshots. Next.js on Vercel serves those snapshots, while TypeScript calculates visitor experiments in the browser. CSV imports remain on the visitor's device, along with up to 20 saved experiments and the datasets needed to replay them.
The interface starts with historical prices. Run experiment reveals the forecast, backtest metrics, and completion status; Compare models evaluates both models on the same dataset. A separate fundamentals workspace uses charts, source dates, mathematical notation, and Beginner, Intermediate, and Expert explanations tailored to each asset class.
03 / Product highlights
How people use it
01
Run an experiment and inspect the result
Visitors select an asset, model, and horizon of 1, 7, 14, or 30 observations. Running the experiment reveals the forecast, historical residual band, and walk-forward error metrics. Compare models places trend and naive results side by side on the same dataset and evaluation origins.
02
Bring a dataset without uploading it
The browser validates date-and-close CSVs, sorts observations, resolves duplicate dates, and assigns a content-derived dataset ID. Imports stay on the device. Up to 20 experiments retain the data needed for replay, with controls to return to published prices or clear browser storage.
03
Explore the data behind each asset
Separate modules interpret company financial statements, the two economies behind EURUSD, and Bitcoin network activity. Reading levels, a glossary, charts, and source evidence help users move from a plain-language explanation to the underlying figures. These explanations do not enter the price forecasting model.
4Price datasets across 3 asset classes
2Models with walk-forward evaluation
32Python–TypeScript parity test cases
04 / Evidence
What the app does now
The v2 workflow supports AAPL, MSFT, EURUSD, and BTCUSD price research through one interface. Visitors can change models and horizons, run their own calculations, import CSVs, and replay saved experiments without changing the shared public data.
The deployment no longer requires an always-on application backend. Scheduled refreshes retain the last successful data when a provider fails, and credentials stay in GitHub Actions. The local Python and SQLite workflow remains available. The EURUSD fundamental feed still needs an upstream FRED error resolved; its price-data workflow is separate.
05 / Engineering decisions
Technical choices
01
Keep the baseline visible
The trend model is evaluated against a last-price baseline using identical dates and horizons. Results show MAE, the evaluation sample count, and improvement or deterioration against that baseline. Residual bands are labeled exploratory and uncalibrated.
02
Separate scheduled data work from interactive analysis
GitHub Actions performs finite refresh jobs; Vercel reads the published snapshots; the visitor's browser runs experiments. This removed the need for an always-on backend in the public demo while preserving the local Python research workflow. The six-hour refresh schedule is best effort, not a real-time feed.
03
Save the dataset with each experiment
Results are tied to the asset, dataset version, model, and horizon. Changing the selection hides the previous output. Saved browser experiments retain their original observations, and stock replays preserve published exchange-calendar dates.
04
Show data dates and refresh failures
Provider data carries source and observation dates. A failed refresh preserves available prior snapshots and exposes a safe diagnostic category. Missing observations remain unavailable; the scheduled public workflow does not substitute synthetic prices when a fetch fails.
06 / Validation
Checks I ran
Compared TypeScript experiment outputs with Python reference outputs in 32 cases spanning both models, all four horizons, and stock, forex, and calendar-day date policies.
Tested CSV parsing, invalid observations, duplicate-date handling, dataset identity, saved-dataset replay, and the 20-run browser-history limit.
Used offline request tests to confirm that visitor experiment and CSV-import actions issue no HTTP write requests, and that storage-quota failures preserve previously saved data.
Ran TypeScript checks and backend regression tests during development, and added GitHub Actions checks for backend tests, browser-demo tests, and the frontend production build.
07 / Next iteration
Next steps
01Add more market indexes and forex pairs, then compare additional models against the existing baseline.
02Add an untouched final evaluation window before extending the forecasting models or making stronger performance claims.
03Move heavier browser calculations into a Web Worker as dataset sizes and model complexity grow.
04Complete browser-based usability, accessibility, and responsive-layout checks for the public experiment flow.