Fase 13 — Campionato: unità di lavoro, piano e statistica (#188)
The tournament judge before the contenders (ADR 0029): the trial judge split into resumable work units on a pool of low-priority workers, the common count of trials and field statistics, the control against chance on surrogate prices, and the immutable tournament plan with a final tract read once. refs #122, refs #123, refs #124, refs #125, refs #126 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #188.
This commit is contained in:
1 parent
e0a438a0b2
commit
cfa2a4da0e
31 files changed
+4776
-225
No files matched your search
@@ -437,7 +437,7 @@ internal sealed partial class AnubisHost(
|
||||
}
|
||||
|
||||
// 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);
|
||||
_lab = options.Demo ? null : new Laboratory(_db, clock, Config.Data.Research, logger, ct => LaboratorySettings.WorkersAsync(settings, ct));
|
||||
if (_lab is { } laboratory && _trading is { } running && _market is { } market)
|
||||
{
|
||||
async Task<bool> HasAsync(string secret, CancellationToken ct) => (await secrets.StatusAsync(secret, ct).ConfigureAwait(false)).IsSet;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
@inject ShellData Shell
|
||||
@inject SecondFactorDrafts Drafts
|
||||
@inject Anubis.Core.IClock Clock
|
||||
@using Anubis.Backtest
|
||||
@using Anubis.Data
|
||||
@using Anubis.Trading
|
||||
|
||||
@@ -646,6 +647,16 @@
|
||||
</dl>
|
||||
<p class="hint">Motore e connessione del database si cambiano solo nella configurazione del container. Per passare a un altro database c'è l'esportazione e l'importazione: il manuale dice come.</p>
|
||||
|
||||
<h3>Laboratorio</h3>
|
||||
<form method="post" action="/azioni/impostazioni/@LaboratorySettings.Workers.Key" class="form-inline">
|
||||
<AntiforgeryToken />
|
||||
<input type="hidden" name="ritorno" value="/impostazioni#sistema" />
|
||||
<label for="lab-workers">@LaboratorySettings.Workers.Label</label>
|
||||
<input id="lab-workers" name="valore" inputmode="numeric" autocomplete="off" value="@_labWorkers.Value" readonly="@(_labWorkers.ReadOnly || Shell.IsDemo)" />
|
||||
<button class="btn btn-small" type="submit">Salva</button>
|
||||
</form>
|
||||
<p class="hint">Quanti calcoli di una prova del Laboratorio girano insieme: le prove restano una alla volta. Alzalo solo dopo averne misurato l'effetto: il Laboratorio non deve togliere tempo al trading. Vale dalla prossima prova. Su questo computer va da 1 a @LaboratorySettings.MaxWorkers.</p>
|
||||
|
||||
<h3>Salvataggi</h3>
|
||||
<p class="hint">Ogni notte alle 03:30 e prima di ogni aggiornamento dello schema. Tengo gli ultimi @Backups.Keep.</p>
|
||||
<form method="post" action="/azioni/salvataggio" class="form-inline"><AntiforgeryToken /><button class="btn" type="submit"><Icon Name="database" Size="18" />Salva adesso</button></form>
|
||||
@@ -722,6 +733,7 @@
|
||||
private SecretStatus _telegramChat = new(Anubis.Notifications.TelegramSettings.ChatSecret, false, false, null);
|
||||
private SecretStatus _heartbeat = new(TelegramServices.HeartbeatSecret, false, false, null);
|
||||
private SettingValue _telegramStatus = new(SettingsStore.TelegramStatus.Key, "never", false, null);
|
||||
private SettingValue _labWorkers = new(LaboratorySettings.Workers.Key, LaboratorySettings.Workers.Default, false, null);
|
||||
private Anubis.Notifications.NotificationSummary? _queue;
|
||||
private string? _draft;
|
||||
private string? _draftUri;
|
||||
@@ -784,6 +796,7 @@
|
||||
_telegramChat = await services.Secrets.StatusAsync(Anubis.Notifications.TelegramSettings.ChatSecret, ct);
|
||||
_heartbeat = await services.Secrets.StatusAsync(TelegramServices.HeartbeatSecret, ct);
|
||||
_telegramStatus = await services.Settings.GetAsync(SettingsStore.TelegramStatus.Key, ct);
|
||||
_labWorkers = await services.Settings.GetAsync(LaboratorySettings.Workers.Key, ct);
|
||||
_queue = services.Telegram is { } telegram ? await telegram.Sender.SummaryAsync(ct) : null;
|
||||
var ledger = new Ledger(services.Db, Clock);
|
||||
var capital = new Capital(services.Db, Clock, ledger, new FxStore(services.Db, Clock));
|
||||
@@ -818,6 +831,7 @@
|
||||
"segreto" => "La chiave è scaduta: ricarica la pagina e aggiungi di nuovo Anubis nell'app.",
|
||||
"salvataggio" => "Il salvataggio non è riuscito. Controlla lo spazio libero nella cartella dei dati.",
|
||||
"impostazione" => "Questa impostazione non si può cambiare così.",
|
||||
"operai" => $"Gli operai del Laboratorio sono un numero intero da 1 a {LaboratorySettings.MaxWorkers}.",
|
||||
"riunioni" => "L'elenco delle riunioni non è valido: una riga per riunione, con FED o BCE e la data, per esempio «FED 2027-01-27».",
|
||||
"bot" => "Comando non ammesso nello stato attuale del bot.",
|
||||
"motore" => "Il motore di trading non è attivo (modalità dimostrativa o ANUBIS_TRADING spento): qui non si cambia nulla.",
|
||||
|
||||
@@ -274,7 +274,7 @@ internal static partial class Forms
|
||||
var model = Anubis.News.NewsModelSettings.All.Any(d => d.Key == key);
|
||||
var rules = key == Anubis.News.ExternalRules.Setting.Key;
|
||||
if (key != SettingsStore.Theme.Key && key != SettingsStore.Currency.Key && key != SettingsStore.CentralBankMeetings.Key && key != SettingsStore.TelegramStatus.Key && key != Anubis.Trading.TaxExport.MethodSetting.Key &&
|
||||
!news && !model && !rules)
|
||||
key != Anubis.Backtest.LaboratorySettings.Workers.Key && !news && !model && !rules)
|
||||
{
|
||||
return Results.Redirect(With(back, "errore", "impostazione"));
|
||||
}
|
||||
@@ -324,6 +324,11 @@ internal static partial class Forms
|
||||
return Results.Redirect(With(back, "errore", refusal));
|
||||
}
|
||||
|
||||
if (key == Anubis.Backtest.LaboratorySettings.Workers.Key && Anubis.Backtest.LaboratorySettings.Workers.Check!(form["valore"].ToString()) is not null)
|
||||
{
|
||||
return Results.Redirect(With(back, "errore", "operai"));
|
||||
}
|
||||
|
||||
if (key == SettingsStore.CentralBankMeetings.Key && Anubis.Data.CentralBanks.Check(form["valore"].ToString()) is not null)
|
||||
{
|
||||
return Results.Redirect(With(back, "errore", "riunioni"));
|
||||
|
||||
Reference in new issue
Block a user