# Rebalance with cash or trades — evidence version 1

Article: https://investingstack.ai/research/rebalance-cash-or-trades

All holdings, fund constituents, fees and return observations are invented.
The starting EUR values are 45,000 / 25,000 / 25,000 / 5,000. They are a
fictional variation of the earlier portfolio, not a later observed history.

## What ran

- Six exact cash-ledger plans and six boundary tests.
- Three separate skfolio 1.12.9 utility-maximizing fits on 240 artificial
  observations, with fund cost assumptions of 0, 10 and 100 basis points.
- Costs are divided by an assumed holding period of 21 observations; the cash
  proxy has no transaction cost. Weight comparison tolerance: 0.000001.

`plans.json`, `holdings.csv`, `policy.json` and `fund-holdings.json` define
the ledgers. `synthetic-returns.csv` is the authoritative optimizer input.
`results.json` supplies the article tables; `sources.json` pins the reviewed
skfolio source. `policy_checks.py` implements only the enumerated fixture rules.

## Exact ledger reproduction

Unpack the archive, enter its directory and use Python 3.9 or newer:

```bash
python3 -m unittest -v test_evidence
python3 reproduce.py --ledger-only --verify
```

## Optional optimizer reproduction

The recorded full run used CPython 3.12.12 on macOS arm64. Create a fresh
Python 3.12 environment:

```bash
python3.12 -m venv .venv
.venv/bin/python -m pip install -r requirements.lock
.venv/bin/python reproduce.py --verify --output observed-results.json
```

The ledger removes euro fees from cash and total value. The optimizer instead
applies a cost penalty to expected return in weight space. Its previous weights
use the same invented snapshot but it does not settle an execution cash ledger.
The sum of absolute fund weight changes excludes cash and counts purchases and
sales; no universal turnover convention is claimed. The high-cost input is an
arbitrary stress, not a broker quote. The synthetic data are not a backtest.

No tax, minimum fee, extra spread, settlement restriction, price change, FX
change or pending order is modeled. A cash contribution is external capital,
not an investment return. Published numerical limits are teaching choices.
`--output` writes a separate result; only choose `results.json` deliberately.

## Integrity and reuse

`manifest.json` records SHA-256 for every other packet file and does not hash
itself. The companion `.zip.sha256` identifies the archive bytes. Verify the
manifest with Python:

```bash
python3 - <<'CHECK'
import hashlib, json, pathlib
root = pathlib.Path('.')
for name, digest in json.loads((root / 'manifest.json').read_text())['files'].items():
    assert hashlib.sha256((root / name).read_bytes()).hexdigest() == digest, name
print('Packet files verified')
CHECK
```

Original prose and fictional data: CC BY 4.0. Original Python: MIT. See
`LICENSE.txt`. Linked third-party sources and installed dependencies retain
their licenses. Cite InvestingStack, the article URL, packet version and manifest.

Prepared with AI assistance and executed offline on 2026-11-12. The exact
reference checker was extracted from the previously published investment-policy
worked example; its provenance is in `sources.json`. The format is a teaching
fixture, not an investing.md standard or an Investboard export. David Bartas
operates InvestingStack and founded Investboard. No authenticated product,
real portfolio, AI response or broker action was tested.
