# One frozen backtest in Vibe-Trading and QuantDinger

Executed 18 November 2026. Six fictional OHLCV bars and two authored strategy adapters exercise the backtest components. This packet contains original fill and equity artifacts, a complete QuantDinger runner result, and a comparison script. The HTML apps, models and broker integrations are outside the replay.

## Verify the saved run

```sh
python3 compare.py > comparison-replay.json
diff -u comparison.json comparison-replay.json
```

## Replay using the pinned source

From this extracted directory, fetch the two source pins. The two commands below install Python libraries or build an image during setup. The engine invocations then use only the sample data.

```sh
git clone https://github.com/HKUDS/Vibe-Trading.git upstream-vibe
git -C upstream-vibe checkout --detach ebc849b37597f0d944f2a268178efaf9d6109c4d
git clone https://github.com/OpenByteInc/QuantDinger.git upstream-qd
git -C upstream-qd checkout --detach 79caf19b056e4bf04338e3d87c7d70fe2b4a932d
```

**Vibe-Trading.** Tested with Python 3.12.12 on macOS arm64. The harness calls the US equity engine with a CSV-backed loader. It checks the direct engine path and writes the engine's usual artifacts. It omits the surrounding CLI, model and web UI.

```sh
python3.12 -m venv .venv
.venv/bin/python -m pip install -r requirements-vibe.lock
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/upstream-vibe/agent" \
  .venv/bin/python reproduce.py vibe replay-vibe
```

**QuantDinger.** Tested in Linux arm64 with Docker and Python 3.12.12. The strategy compiler's memory enforcement needs OS support. The native macOS attempt stopped with `strategy sandbox memory limit could not be applied`. The included Dockerfile keeps the required Linux sandbox behavior.

```sh
docker build --tag investingstack-qd-replay --file Dockerfile .
mkdir -p replay-qd
docker run --rm --network=none \
  -e PYTHONPATH=/upstream/backend_api_python -e PYTHONDONTWRITEBYTECODE=1 \
  -v "$PWD/upstream-qd:/upstream:ro" \
  -v "$PWD:/fixture:ro" -v "$PWD/replay-qd:/results" \
  investingstack-qd-replay python /fixture/reproduce.py quantdinger /results
```

The isolated runner may log that PostgreSQL support is unavailable. The exercise supplies frames and saves the result as JSON without using a database. Finally compare positions, fills and cash from both replays:

```sh
python3 compare.py --vibe replay-vibe/artifacts \
  --quantdinger replay-qd/quantdinger-result.json > comparison-replay.json
diff -u comparison.json comparison-replay.json
```

Expected result: buy 50 at 100 on 7 January, sell 50 at 110 on 9 January, finish flat at 10,500 USD. Application metrics, metadata and benchmark conventions can differ. The comparator checks the two observed fills and ending equity only.

Original inputs, adapters and annotations may be reused under CC BY 4.0. Upstream code is referenced by commit and is subject to its own licences.
