Judge the variant in use and count the shadow cases for what they are

The quarterly review judged the best variant of the grid instead of the one
that trades: the plan now fixes the variant in use and the protocol measures
that one, while the tries are still those of the grid. A failure while the
history is prepared is a reason in the report and no longer stops the review,
and a strategy whose protocol does not exist says so when its data are there.

The volatility improvement compared books of different days and stages: the
book keeps its stage and its previous day, and a case without a book valid on
its day is left out. Fewer than six months give no interval, the others use
the clustered error with the Student t.

The restriction balance counts a case in the period in which its outcome
became known, so no case is lost or counted twice between two reviews.

The contact given to the SEC travels only on the client that never follows a
redirect, so it cannot reach another site.

refs #75

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-12-01 22:26:06 +01:00
1 parent 24e20584d4
commit 3543f29aba
23 files changed
+577 -126

No files matched your search

@@ -206,7 +206,7 @@
<td>
@foreach (var l in m.Lines)
{
<div>@(l.Label is null ? "" : l.Label + ": ")@(l.Mean is { } mean ? Anubis.Learning.ImprovementText.Percent(mean) : "—")@if (l.Interval is { } i) {<span class="note"> tra @Anubis.Learning.ImprovementText.Percent(i.Low) e @Anubis.Learning.ImprovementText.Percent(i.High)</span>}</div>
<div>@(l.Label is null ? "" : l.Label + ": ")@(l.Mean is { } mean ? Anubis.Learning.ImprovementText.Percent(mean) : "—")@if (l.Interval is { } i) {<span class="note"> tra @Anubis.Learning.ImprovementText.Percent(i.Low) e @Anubis.Learning.ImprovementText.Percent(i.High)</span>}@if (l.Missing is { } missing) {<span class="note"> (@missing)</span>}</div>
}
</td>
<td>@(m.Lines.Max(l => l.Cases) == 0 ? "—" : m.Trust)</td>
@@ -44,7 +44,7 @@
<tbody>
@Row("Esito", x => LabText.Verdict(x.Trial.Verdict))
@Row("Dati", x => LabText.Symbols(x.Trial.Plan.Data.Symbols) + ", " + LabText.Period(x.Trial.Plan.Data.From, x.Trial.Plan.Data.To))
@Row("Variante scelta", x => LabText.Parameters(x.Report.Chosen) + $" (di {x.Trial.Variants})")
@Row("Variante giudicata", x => x.Report.Judged is { } judged ? LabText.Parameters(judged) + " (in uso)" : LabText.Parameters(x.Report.Chosen) + $" (scelta, di {x.Trial.Variants})")
@Row("Risultato netto", x => LabText.Money(x.Report.Metrics.NetResult, x.Report.Currency, withSign: true))
@Row("Con costi doppi", x => x.Report.Costs.FirstOrDefault(k => k.Multiplier == 2m) is { } k ? LabText.Money(k.NetResult, x.Report.Currency, withSign: true) : LabText.Missing)
@Row("Rendimento annuo", x => LabText.Percent(x.Report.Metrics.AnnualReturn, 1, true))
@@ -68,9 +68,15 @@
var c = r.Currency;
var m = r.Metrics;
var b = r.Benchmark;
var variant = r.Judged is null ? "Variante scelta" : "Variante in uso";
var ofVariant = r.Judged is null ? "della variante scelta" : "della variante in uso";
<section class="panel" aria-labelledby="esito">
<h2 id="esito">Esito del protocollo</h2>
<p>Variante scelta: <strong>@LabText.Parameters(r.Chosen)</strong>, la migliore zona della griglia e non il singolo punto migliore.</p>
@if (r.Judged is { } judged)
{
<p>Il giudizio è sulla variante in uso: <strong>@LabText.Parameters(judged)</strong>.@(r.Variants.Any(v => v.OutsideGrid) ? " Non è nella griglia: è giudicata lo stesso, senza contare come un tentativo in più." : "")</p>
}
<div class="table-wrap">
<table class="table">
<thead><tr><th scope="col">Controllo</th><th scope="col" class="num">Valore</th><th scope="col" class="num">Soglia</th><th scope="col">Esito</th></tr></thead>
@@ -103,10 +109,10 @@
</section>
<section class="panel" aria-labelledby="risultato">
<h2 id="risultato">Risultato della variante scelta</h2>
<h2 id="risultato">Risultato @ofVariant</h2>
<div class="table-wrap">
<table class="table">
<thead><tr><th scope="col"></th><th scope="col" class="num">Variante scelta</th><th scope="col" class="num">Comprare e tenere</th></tr></thead>
<thead><tr><th scope="col"></th><th scope="col" class="num">@variant</th><th scope="col" class="num">Comprare e tenere</th></tr></thead>
<tbody>
<tr><th scope="row">Risultato netto</th><td class="num">@LabText.Money(m.NetResult, c, withSign: true)</td><td class="num">@LabText.Money(b.NetResult, c, withSign: true)</td></tr>
<tr><th scope="row">Rendimento totale</th><td class="num">@LabText.Percent(m.TotalReturn, 1, true)</td><td class="num">@LabText.Percent(b.TotalReturn, 1, true)</td></tr>
@@ -123,7 +129,7 @@
</tbody>
</table>
</div>
<EquityChart Points="_curve" Currency="@c" Native="true" Label="Patrimonio della variante scelta e di comprare e tenere" EquityLabel="Variante scelta" BenchmarkLabel="Comprare e tenere gli stessi strumenti" EquityColumn="Variante scelta" BenchmarkColumn="Comprare e tenere" />
<EquityChart Points="_curve" Currency="@c" Native="true" Label="@($"Patrimonio {ofVariant} e di comprare e tenere")" EquityLabel="@variant" BenchmarkLabel="Comprare e tenere gli stessi strumenti" EquityColumn="@variant" BenchmarkColumn="Comprare e tenere" />
</section>
<section class="panel" aria-labelledby="anni">
@@ -162,7 +168,7 @@
<h2 id="convalide">Convalide</h2>
<h3>Sharpe corretto per il numero di prove</h3>
@{ var d = r.DeflatedSharpe; var annual = Math.Sqrt(r.PeriodsPerYear); }
<p>Deflated Sharpe Ratio <strong>@LabText.Number(d.Value)</strong>: la probabilità che lo Sharpe della variante scelta (@LabText.Number(d.Sharpe * annual) all'anno) superi quello che il migliore di @d.Trials tentativi mostrerebbe per caso (@LabText.Number(d.Benchmark * annual) all'anno). Contati tutti i test di questa strategia: @r.TrialsCounted varianti. Su @d.Observations sedute, asimmetria @LabText.Number(d.Skewness), curtosi @LabText.Number(d.Kurtosis).</p>
<p>Deflated Sharpe Ratio <strong>@LabText.Number(d.Value)</strong>: la probabilità che lo Sharpe @ofVariant (@LabText.Number(d.Sharpe * annual) all'anno) superi quello che il migliore di @d.Trials tentativi mostrerebbe per caso (@LabText.Number(d.Benchmark * annual) all'anno). Contati tutti i test di questa strategia: @r.TrialsCounted varianti. Su @d.Observations sedute, asimmetria @LabText.Number(d.Skewness), curtosi @LabText.Number(d.Kurtosis).</p>
<h3>Probabilità di sovra-adattamento</h3>
@if (r.Overfitting is { } pbo)
@@ -231,9 +237,9 @@
@foreach (var v in r.Variants)
{
<tr>
<td>@LabText.Parameters(v.Parameters)@if (v.Chosen) {<span class="tag"> scelta</span>}</td>
<td>@LabText.Parameters(v.Parameters)@if (v.Chosen) {<span class="tag"> scelta</span>}@if (v.Parameters == r.Judged) {<span class="tag"> in uso</span>}</td>
<td class="num">@LabText.Number(v.Sharpe * annual)</td>
<td class="num">@LabText.Number(v.PlateauScore * annual)</td>
<td class="num">@(v.OutsideGrid ? LabText.Missing : LabText.Number(v.PlateauScore * annual))</td>
<td class="num">@LabText.Money(v.NetResult, c, true)</td>
<td class="num">@LabText.Percent(v.MaxDrawdown)</td>
<td class="num">@v.Trades</td>
@@ -39,7 +39,7 @@
}
@if (line.InUse is { } used)
{
<br /><span class="note">Variante in uso: @LabText.Parameters(used.Parameters), Sharpe @LabText.Number(used.Sharpe), calo massimo @LabText.Percent(used.MaxDrawdown). Non cambia da sola.</span>
<br /><span class="note">Variante in uso: @LabText.Parameters(used.Parameters), Sharpe @LabText.Number(used.Sharpe), calo massimo @LabText.Percent(used.MaxDrawdown).@(used.OutsideGrid ? " Non è nella griglia." : "") Non cambia da sola.</span>
}
</td>
<td>@foreach (var text in ReviewView.Live(line, r.RatesAfter ?? r.RatesBefore)) {<div>@text</div>}</td>
+1 -1
View File
@@ -19,7 +19,7 @@ internal static class ReviewView
ReviewVerdicts.Passed => "Superata",
ReviewVerdicts.Rejected => "Non superata",
ReviewVerdicts.Error => "Non riuscita",
_ => "In attesa dei dati",
_ => line.NoProtocol ? "Non riprovata" : "In attesa dei dati",
};
public static string? VerdictClass(ReviewLine line) => line.Verdict switch