Review the base strategies every three months

Every quarter the base strategies are tried again on the longer history with
the slippage in force, compared with how they did live, and the report is
published in the laboratory with the base rates measured again and the balance
of the restrictions of 10.5. In observation the outcome replaces the old one and
a strategy that passed goes to simulation after its 90 days; with capital
nothing moves but the demotion condition of 12.3. A restart halfway goes on and
the review concludes once; the outcome of a review survives a restart with an
older build.

refs #74

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-12-01 20:59:20 +01:00
1 parent 79bb194de0
commit 2257c3e16c
34 files changed
+2308 -87

No files matched your search

+26
View File
@@ -273,6 +273,32 @@ public sealed class NewsRulesTests
Assert.IsTrue(first.Count > 0 && first.All(f => f == new DateTimeOffset(2026, 9, 1, 0, 5, 0, TimeSpan.Zero)), "The time it was first due is kept for the price check.");
}
/// <summary>A rule that appears after the decision and lasts past the deadline drops the purchase when it is due: the row says of which symbol (SPEC 10.5).</summary>
[TestMethod]
[TestCategory(Category.Integration)]
public async Task APurchaseDroppedWhenItIsDueKeepsItsSymbol()
{
var day = new DateOnly(2026, 9, 1);
await using var live = await LiveRig.CreateAsync(day, day.AddDays(39)).ConfigureAwait(false);
live.UseGate(new LateGate(new EntryHold(NewsReasons.Severe, new DateTimeOffset(2026, 9, 3, 0, 0, 0, TimeSpan.Zero), "fatto")));
await live.DayAsync(day).ConfigureAwait(false);
var rows = await live.Rig.QueryAsync("SELECT symbol, stage, outcome, reasons FROM decisions WHERE stage = @o", r => (Symbol: r.TextOrNull("symbol"), Outcome: r.Text("outcome"), Reasons: r.Text("reasons")),
("o", DecisionStages.Order)).ConfigureAwait(false);
CollectionAssert.AreEquivalent(new[] { "ETH-EUR", "SOL-EUR" }, rows.Where(r => r.Outcome == DecisionOutcomes.Refused && r.Reasons.Contains(NewsReasons.Severe, StringComparison.Ordinal)).Select(r => r.Symbol).ToList());
var balance = await Anubis.Learning.RestrictionBalance.LoadAsync(live.Rig.Db, live.Rig.Clock, DateTimeOffset.UnixEpoch, _none).ConfigureAwait(false);
Assert.AreEqual(2, balance.Lines.Single().Open);
}
// Says nothing at the decision, then holds each purchase.
private sealed class LateGate(EntryHold hold) : IEntryGate
{
private readonly HashSet<string> _asked = [];
public Task<EntryHold?> HoldAsync(InstrumentSpec spec, DateTimeOffset at, CancellationToken cancellationToken) => Task.FromResult(_asked.Add(spec.Symbol) ? null : at < hold.Until ? hold : null);
public Task<EntryHold?> KeepStopAsync(InstrumentSpec spec, DateTimeOffset at, CancellationToken cancellationToken) => Task.FromResult<EntryHold?>(null);
}
/// <summary>
/// The close of 1 September plans a mean reversion purchase of BBB (AbsenceTests). With its earnings on 3 September,
/// before the open, the strategy stays out; with the fourth row of 10.5 switched off it buys as before.