From 768eab56d91dc2d7c7d4fcd968b97255f3b8de65 Mon Sep 17 00:00:00 2001 From: Natercio Moniz Date: Sun, 6 Sep 2026 16:13:54 +0100 Subject: [PATCH 1/2] Update readme with year over year instructions --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index fea41d5..5d64267 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,31 @@ go install github.com/nmoniz/any2anexoj/cmd/any2anexoj-cli@latest cat statement.csv | any2anexoj-cli --platform=tranding212 ``` +## Incremental Reports + +For multi-year reporting, pass `--state-file ` to keep the FIFO buy-queue between runs. The typical workflow is: + +1. Generate the first year Anexo J report from the first year broker statement and keep the state file. +2. Next year, generate the next report from the second year broker statement **only**, using the same state file. + +```bash +# first year +cat 2024-statement.csv | any2anexoj-cli --platform=trading212 --state-file=trading212-state.json + +# following year +cat 2025-statement.csv | any2anexoj-cli --platform=trading212 --state-file=trading212-state.json +``` + +The first run behaves like a normal run and creates the state file. +On later runs the tool loads the previously saved buy queues per symbol (including partially filled lots), processes only the new transactions from the input, and writes the updated state. +The state file is a JSON document. + +> [!IMPORTANT] +> Each new input must contain **only** the new transactions, not the previous ones. +> The state file already holds the unmatched buy lots from earlier runs, so including previous trades again will cause them to be processed twice and may fail with insufficient bought volume. + +State is only persisted once the input reaches EOF, so a crash or `Ctrl-C` before the end of input will discard progress from that run. + ## Rounding All Euro values are rounded to cents (2 decimal places) but internal calculations use the statement values with full precision. -- 2.54.0 From 7019108c3aa86aafcdadbd9006c7e31c2805627f Mon Sep 17 00:00:00 2001 From: Natercio Moniz Date: Sun, 6 Sep 2026 16:15:44 +0100 Subject: [PATCH 2/2] improve header levels and language --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5d64267..8026a23 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ go install github.com/nmoniz/any2anexoj/cmd/any2anexoj-cli@latest cat statement.csv | any2anexoj-cli --platform=tranding212 ``` -## Incremental Reports +### Incremental Reports -For multi-year reporting, pass `--state-file ` to keep the FIFO buy-queue between runs. The typical workflow is: +For year over year reporting, pass `--state-file ` to keep the FIFO buy-queue between runs. The typical workflow is: 1. Generate the first year Anexo J report from the first year broker statement and keep the state file. 2. Next year, generate the next report from the second year broker statement **only**, using the same state file. -- 2.54.0