Market Lab
Market Lab is a private, local-first paper-trading research platform. It compares rule-based strategies against real market data through isolated simulated wallets, with no brokerage client and no ability to place a real order.
The purpose is not to crown whichever wallet happens to show the highest balance today. The experiment is designed to ask whether a transparent strategy can produce repeatable returns relative to a passive reference without hiding excessive drawdown, volatility, fees, or one lucky period.
Six comparable arenas
The initial experiment contains 48 wallets: seven fixed strategies and one adaptive learner for each of six markets.
| Arena | Starting research universe | Currency | | --- | ---: | --- | | ETFs | 20 diversified liquid ETFs | USD | | US stocks | 100 established companies | USD | | Danish stocks | 100 Nasdaq Copenhagen companies | DKK | | Danish funds | 20 Copenhagen-listed funds | DKK | | Crypto | 20 Alpaca-supported assets | USD | | Currencies | 100 crosses derived from ECB rates | USD |
The dashboard can narrow an arena to a shared subset or create additional independent strategies from the same validated tuner controls. Every wallet starts with its own simulated balance, positions, decisions, fills, and dated equity history.
Real prices, simulated execution
US equities, ETFs, and crypto use Alpaca's read-only market-data API. Currency rates come from the European Central Bank. Danish stocks and funds use adjusted, completed Nasdaq Copenhagen sessions obtained through Yahoo Finance's chart data.
Only execution is simulated: cash, holdings, adverse slippage, fees, purchases, sales, and profit or loss. Runtime adapters fail closed if required data is unavailable. Synthetic prices exist solely in automated-test fixtures and cannot be selected by the worker or configuration.
The worker persists the exact executable quote and timestamp used for a decision. Wallet totals, position details, and graph endpoints therefore use the same valuation instead of mixing an intraday number with a previous closing price.
Strategy families
Each arena starts with Conservative Trend, Balanced Trend, Fast Momentum, Deep Reversion, Gentle Reversion, Defensive Trend, Confirmed Breakout, and an Adaptive Learner. Thresholds and exposure are calibrated per market rather than assuming that stocks, currencies, and crypto behave alike.
Trend strategies compare moving averages and use RSI filters. Reversion strategies wait for oversold pullbacks within a positive longer trend. Breakout strategies require a fresh multi-week high inside a confirmed uptrend and rank competing signals by strength.
A configured profit percentage arms trailing protection rather than forcing an immediate sale. A position can continue making new highs and closes on a later observed downtick. Failed trends, loss controls, and drawdown limits can still close a losing position; refusing every realised loss would allow weak holdings to trap capital indefinitely.
Adaptive learners
The adaptive wallet in each arena is a bounded, inspectable hill-climber rather than a claim of artificial intelligence. After a warm-up it scores recent return, drawdown, volatility, and performance relative to the passive reference. It can test one constrained parameter change, reverse a materially worse trial, or reduce exposure after a severe period.
When it has not traded, it analyses valid signals, near misses, and later returns rather than learning from an empty profit figure. Every adjustment and explanation is stored, shown on the dashboard, and included in the statistical export. It cannot change the instrument universe, remove cash floors, enable leverage, short assets, or contact a broker.
Risk and auditability
All strategies are long-only. They cannot borrow, use leverage, trade derivatives, or short. Market-specific cash floors, position caps, trade caps, cooldowns, simulated costs, and maximum portfolio drawdown limits reduce exposure. These controls improve survival; they do not guarantee profit or make an asset safe.
The trade ledger reconstructs every purchase and sale with the simulated fill price, quantity, fees, net cash movement, matched entry cost, and all-in realised result. Database uniqueness constraints prevent duplicate decisions and fills, while repeated unchanged holds are compressed rather than filling the ledger with noise.
Each wallet is compared with a passive reference normalised to that wallet's own starting observation. The dashboard and Excel workbook expose total and periodic return, drawdown, daily volatility, profitable closes, time invested, cash use, monthly consistency, and passive-relative performance.
Private operation
Market Lab runs on the home server behind the local network or VPN. The Next.js dashboard is primarily read-only. Runner-token-protected controls can reset one wallet, every wallet in an arena, or the complete experiment without deleting downloaded market history. Resets wait until the worker releases its evaluation lease.
The application is intentionally not hosted at jeeblejuice.dk. This page describes the engineering and research model; it does not expose the dashboard, private experiment data, or a route into the service.
Technology
- Next.js and React dashboard
- TypeScript worker and strategy engine
- Prisma with SQLite
- Alpaca, ECB, and Copenhagen market-data adapters
- ExcelJS statistical workbooks
- Vitest tests and data-source verification
- Docker Compose for continuous private deployment
Market Lab remains a research environment. A strategy that survives a long observation period may be frozen and sent to Trade Operator for shadow testing, but simulated balances and fills never become broker state.