Every intent of a strategy now crosses a risk engine that only refuses or shrinks: loss limits per world with the 24-hour block, the weekly halving, the halving and the switch on the fall from the high, the size limits on invested capital, single position, crypto share and trade risk, the technical checks, no short sales and no leverage, the day-trade guard (off by default). The switch, "Ferma tutto", "Ferma e chiudi", the STOP file and the orders-per-minute anomaly stop the bot until the user confirms a restart, and a restart after a trip measures the high from then on. The correctives of SPEC 8.5 (crypto regime, economic calendar) and the risk rules also run inside the backtests of the base strategies, so the reports show what would happen live. Each stage of a decision is written to a new decisions table with reason codes. The stage book is the only way to real money: an order on a real account needs the startup consent, every requirement of SPEC 12.3 met, the typed phrase and a fresh password and second factor. Order managers on real accounts fail closed and ask again before each order leaves. A demoted or revoked strategy keeps its real positions in exit only, with stops, until they are at zero. The simulated twin stays out of totals and of the reference equity. Tests cover each rule of 9.1 and 9.2, with property tests for "never larger than asked" and "never larger after a loss", and both proofs on a fake real account: nothing reaches it without the procedure, and a demoted strategy manages exits and stops down to zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2409e74b26
commit
8def84e122
25 files changed
+3737
-11
No files matched your search
@@ -292,7 +292,8 @@ internal sealed partial class AnubisHost(
|
||||
: null;
|
||||
_trading = TradingEnabled && (identity.File ?? Installation.ReadFile(Config.Data)) is { } file
|
||||
? new TradingService(_db, clock, bus, secrets, _market, new FxStore(_db, clock), TradingConsent.From(Config), file.InstallationId,
|
||||
overrides?.MarketHttp, overrides?.MarketSockets, logger)
|
||||
overrides?.MarketHttp, overrides?.MarketSockets, logger, settings, (password, code, ct) => access.ReauthenticateAsync(password, code, ct),
|
||||
Path.Combine(Config.Data.Root, "STOP"))
|
||||
: null;
|
||||
// The laboratory computes on its own thread and reads only local data; the demo shows appendix F and runs none.
|
||||
_lab = options.Demo ? null : new Laboratory(_db, clock, Config.Data.Research, logger);
|
||||
|
||||
Reference in new issue
Block a user