Commit Graph
4 Commits
Author SHA1 Message Date
Alby96andClaude Opus 5.5 fc5df0146e Prepare strategies before the host is ready; stop demo servers first (refs #44 #45)
ci / test (postgres) (push) Successful in 4m39s
ci / test (sqlite) (push) Successful in 2m57s
ci / image (push) Successful in 56s
ci / test (postgres) (pull_request) Successful in 5m27s
ci / test (sqlite) (pull_request) Successful in 3m14s
ci / image (pull_request) Successful in 10s
Loading the outcomes before "ready" was not enough: on a fresh database the
strategy rows did not exist yet, so the load did nothing and CI run 220
failed the same way on PostgreSQL. The new TradingService.PrepareAsync
creates accounts and strategies, then loads the outcomes; the host runs it
before it is ready and logs a failure without blocking the interface.
StartAsync repeats it, which changes nothing.

The demo tests deleted the demo folder while the server still held its
SQLite file, which Windows refuses at random. They now stop the server
first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 17:19:15 +01:00
Alby96andClaude Opus 5.5 1a0912e436 Fix the defects found by the Phase 3 review (refs #33 #26 #27 #28 #29 #30 #31 #32)
ci / test (postgres) (push) Successful in 3m9s
ci / test (sqlite) (push) Successful in 2m28s
ci / test (postgres) (pull_request) Successful in 4m1s
ci / test (sqlite) (pull_request) Failing after 2m31s
ci / image (pull_request) Skipped
ci / image (push) Successful in 1m34s
- Splits multiply only the shares held before the ex-date. Old splits in
  the table no longer inflate positions bought later; the simulator's book
  follows the same split once, together with the ledger.
- Dividends pay the simulator once on the ex-date holdings, and each
  payment is marked in the same write, so a failure never pays twice.
- Positions are marked to market before every equity photograph; until
  now equity, drawdown and the Conti screen stayed at the last fill.
- A sale with no price keeps its broker stops until it can really leave;
  a purchase with no price is dropped.
- A refused sale is retried with pauses of 1, 2, 4, 8 and 15 minutes
  instead of every tick, and one failing execution no longer stops the
  stop alignment of the whole account.
- On Alpaca a purchase clears the sell stops of every strategy on the
  symbol and holds them until it ends.
- OKX order lookups treat only 51603 as unknown; any other failure is an
  error, so a lost order is never sent twice.
- The reconcile choice and key removal forms now require the antiforgery
  token; the choice re-runs the comparison and is only offered after the
  15 minutes; stale differences are dropped.
- A replaced key that cannot withdraw releases the prudent mode.
- Re-entering the same euro capital for Alpaca changes nothing; a new
  amount converts only the euro difference at today's rate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 21:47:36 +01:00
Alby96andClaude Opus 5.5 60d5ebbc05 Document Phase 3; fix CSV decimals and Alpaca price steps (refs #33 #31 #32 #27)
ADR 0009 records the Phase 3 choices; API-NOTES gains the verified trading
facts and what Anubis does with each; ROADMAP and STATE mark the phase done
with the live-demo conformance waiting for the user's keys.

Two defects found while writing the notes:
- The positions CSV used dot decimals; SPEC 13 asks for decimal commas.
  Trailing zeros are dropped so both engines give the same text.
- Alpaca's catalogue has no tick, so limit and stop prices were sent
  unrounded and would get 422 "sub-penny". OrderRules.TickOf applies
  Alpaca's rule (2 decimals from 1 $, 4 below) to orders, stops and the
  simulator's own check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 21:24:38 +01:00
Alby96andClaude Opus 5.5 4c4f848d80 Add the Conti screen, account keys and entrusted capital (refs #32 #29 #31)
The Conti e posizioni screen follows mockup 02: totals split by strategy,
one card per account with key permissions and the last reconciliation,
positions with a per-account filter and CSV export, pending stops (Alpaca
grouped into permanent and day stops), residues, and exposure by currency.
It shows one world only, real accounts when there are any, so simulated
and real money never add up. Position values are rounded to the cent per
row, as the table shows them, so the figures add up on screen.

Settings gain "Conti e chiavi": practice keys are asked to the broker
before they are saved and refused when they may withdraw or cannot trade;
they are never shown again and the engine restarts to use them. The
capital entrusted to each broker is set there in euro. Until any capital
is set, the overview points to that section as the first step.

The overview now reads one world, nets capital flows out of its results
and uses the time-weighted index; open orders exclude protective stops.

The demo seed gains cash rows, closed trades, stops, the ECB rate and the
reconciliation state, so the ledger itself computes the mockup's figures.
Screenshots now capture the whole page and include Conti.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 21:16:42 +01:00