Investment-Bot
A deterministic research platform for testing trading strategies without letting future information leak into past decisions.
- Problem
- Backtests are easy to get subtly wrong. A strategy that can see a price before it was published, or a result that cannot be reproduced, says nothing about the strategy.
- Built
- A single-process Python platform with immutable data snapshots, a clock-bound view of the data, explicit costs and an append-only accounting journal. Version 0.1 tests the mechanics of a seven-ETF monthly momentum strategy.
Design priorities
In order: quantitative correctness, prevention of look-ahead leakage, reproducibility, testability, modularity, separation of research from execution, extensibility, and only then performance.
How it works
- Immutable snapshots. Market data is stored as explicit-schema Parquet plus canonical JSON metadata and identified by a SHA-256 hash of its content. Writers refuse to overwrite, and every load validates schema and identity.
- Time is enforced, not assumed. Every bar carries the time it became available. A strategy only ever receives a view of the data bound to its decision time, and that view selects the latest revision available at that moment. Orders execute at the next session’s open.
- Accounting as a journal. Costs are explicit debits; there are no hidden price adjustments. Holdings and valuations are replayed from an append-only journal, and evaluation reads the journal rather than reconstructing positions from weights.
- Reproducible runs. Each run records a manifest with its configuration, source-tree hash, data hashes and dependency versions, so a result can be traced to exactly what produced it.
What it does not claim
The included demonstration runs on synthetic, deterministic data. Its numbers test the mechanics of the system; they are not investment returns and say nothing about whether the strategy works. The software does not connect to a broker and is not investment advice.