Put the candidate strategies in observation without capital

Relative momentum among coins and all-time highs on stocks are now in the
code as candidates: they collect signals, have no share, no capital and no
order path, and every way forward refuses them. The crypto one ran the
protocol once and failed it (DSR 0.744, worst fall 35.3%), so it is archived
and decides nothing; the stock one waits for the Alpaca history.

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 19:52:24 +01:00
1 parent 9d1a4f2f69
commit fb0ab223a5
33 files changed
+1747 -82

No files matched your search

+16 -1
View File
@@ -43,7 +43,9 @@ public sealed class StrategyScreensTests
// Mockup 04: the four stages, 58 days of 60, the same result as on Conti.
var strategies = await server.TextAsync("/strategie");
foreach (var text in new[] { "Il percorso verso i soldi veri", "Reale ridotto", "3 strategie", "+231,60", "Giorni in simulazione", "58", "Disponibile tra 2 giorni" })
foreach (var text in new[] { "Il percorso verso i soldi veri", "Reale ridotto", "3 strategie", "+231,60", "Giorni in simulazione", "58", "Disponibile tra 2 giorni", "1 strategia", "Nuovi massimi storici sulle azioni USA",
"Raccoglie segnali senza fare ordini: 14 in 31 giorni. Servono almeno 90 giorni per giudicarla.", "31 giorni su 90", "Momentum relativo tra crypto",
"Scartata nei test: tolti i costi, il risultato è vicino a zero. Resta in archivio, non riceve capitale.", "Non supera i test" })
{
StringAssert.Contains(strategies, text, $"Missing {text} on Strategie.");
}
@@ -83,6 +85,19 @@ public sealed class StrategyScreensTests
StringAssert.Contains(page, "In attesa dei dati");
Assert.IsFalse(page.Contains("/azioni/strategie/crypto_trend/simulazione", StringComparison.Ordinal), "No button for a strategy that did not pass.");
// The candidates of 8.4: the discarded one with its verdict, the other waiting, no button for either, and none by hand.
foreach (var text in new[] { "Momentum relativo tra crypto", "Scartata nei test", "Nuovi massimi storici sulle azioni USA", "0 in 0 giorni" })
{
StringAssert.Contains(page, text);
}
foreach (var (candidate, _) in StrategyNames.Candidates)
{
Assert.IsFalse(page.Contains("/azioni/strategie/" + candidate, StringComparison.Ordinal), "A candidate has no button.");
using var post = await server.PostFormAsync("/strategie", $"/azioni/strategie/{candidate}/simulazione");
Assert.AreEqual(StrategyStages.Observation, (await server.Host.Services!.Trading!.Stages.GetAsync(candidate, CancellationToken.None))!.Stage);
}
using var refused = await server.PostFormAsync("/strategie", "/azioni/strategie/crypto_trend/simulazione");
Assert.AreEqual("/strategie?errore=backtest", ServerHarness.Location(refused));
Assert.AreEqual(StrategyStages.Observation, (await server.Host.Services!.Trading!.Stages.GetAsync(StrategyNames.CryptoTrend, CancellationToken.None))!.Stage);