Fase 11 — Decisioni solo matematiche (#186)
News, the economic calendar and earnings dates no longer change any decision (ADR 0023, choices in ADR 0027). The outside rules are measured in the shadow; a switch in the settings turns them back on. refs #116, refs #117 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 #186.
This commit is contained in:
1 parent
ed22d1c8b5
commit
93cdf7850d
47 files changed
+1743
-169
No files matched your search
@@ -396,13 +396,53 @@
|
||||
|
||||
<section class="panel" id="notizie">
|
||||
<h2>Notizie e calendario</h2>
|
||||
<p class="hint">Le notizie e gli eventi in calendario non fanno mai comprare: possono solo fermare o rimandare un acquisto, e ogni volta il diario dice perché.</p>
|
||||
@if (_measured)
|
||||
{
|
||||
<p class="hint">Notizie, calendario e trimestrali non cambiano nessuna decisione: le decisioni guardano solo i numeri del mercato. Per ogni regola registro solo cosa avrebbe fatto, e il Laboratorio mostra quanto avrebbe reso.</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p class="hint">Le notizie e gli eventi in calendario non fanno mai comprare: possono solo fermare o rimandare un acquisto, e ogni volta il diario dice perché.</p>
|
||||
}
|
||||
|
||||
<h3>Regole</h3>
|
||||
@if (_rules is { } switchValue)
|
||||
{
|
||||
var key = Anubis.News.ExternalRules.Setting.Key;
|
||||
var toMeasured = !_measured;
|
||||
<form method="post" action="/azioni/impostazioni/@key" class="form-inline">
|
||||
<AntiforgeryToken />
|
||||
<input type="hidden" name="ritorno" value="/impostazioni#notizie" />
|
||||
<label for="@key">@Anubis.News.ExternalRules.Setting.Label</label>
|
||||
<select id="@key" name="valore" disabled="@(switchValue.ReadOnly || Shell.IsDemo)" data-autosubmit="@(_anyLive && toMeasured ? null : "")">
|
||||
<option value="@Anubis.News.ExternalRules.Measured" selected="@_measured">Solo misurate</option>
|
||||
<option value="@Anubis.News.ExternalRules.Active" selected="@(!_measured)">Attive</option>
|
||||
</select>
|
||||
@if (switchValue.ReadOnly)
|
||||
{
|
||||
<span class="hint">Fissato da @switchValue.Source: si cambia lì.</span>
|
||||
}
|
||||
else if (!Shell.IsDemo && _anyLive && toMeasured)
|
||||
{
|
||||
<p class="note">Una strategia usa soldi veri: per misurare soltanto le regole servono la frase e la password.</p>
|
||||
<label>Scrivi: <code>@StageBook.RaisePhrase</code><input name="frase" autocomplete="off" /></label>
|
||||
<label>Password<input name="password" type="password" autocomplete="current-password" /></label>
|
||||
<label>Codice a sei cifre (se attivo)<input name="codice" inputmode="numeric" autocomplete="one-time-code" /></label>
|
||||
<button class="btn btn-small" type="submit">Salva</button>
|
||||
}
|
||||
else if (!Shell.IsDemo)
|
||||
{
|
||||
<noscript><button class="btn btn-small" type="submit">Salva</button></noscript>
|
||||
}
|
||||
</form>
|
||||
<p class="hint">@(_measured
|
||||
? "Le righe qui sotto valgono quando le regole sono attive. Per riaccenderne una sola, spegni le altre e poi scegli «Attive». Il bot non le riaccende mai da solo."
|
||||
: "Ogni cambio scrive una riga nel diario.")</p>
|
||||
}
|
||||
@foreach (var rule in _newsRules)
|
||||
{
|
||||
var definition = SettingsStore.Definition(rule.Key);
|
||||
<form method="post" action="/azioni/impostazioni/@rule.Key" class="form-inline">
|
||||
<form method="post" action="/azioni/impostazioni/@rule.Key" class="form-inline @(_measured ? "rules-off" : null)">
|
||||
<AntiforgeryToken />
|
||||
<input type="hidden" name="ritorno" value="/impostazioni#notizie" />
|
||||
<label for="@rule.Key">@definition.Label</label>
|
||||
@@ -464,7 +504,7 @@
|
||||
}
|
||||
|
||||
<h3>Modello linguistico</h3>
|
||||
<p class="hint">Facoltativo. Rilegge le notizie delle ultime 24 ore sulle tue posizioni e sugli strumenti candidati, otto per richiesta: può aggiungere una restrizione, mai toglierla, e non vede né chiavi né conti. Senza chiave tutto funziona lo stesso con il classificatore locale. Con Ollama, sul tuo computer o nella tua rete, la chiave non serve.</p>
|
||||
<p class="hint">Facoltativo. Rilegge le notizie delle ultime 24 ore sulle tue posizioni e sugli strumenti candidati, otto per richiesta: @(_measured ? "con le regole solo misurate la sua rilettura entra nella misura in ombra, come farebbe se fossero attive" : "può aggiungere una restrizione, mai toglierla"), e non vede né chiavi né conti. Senza chiave tutto funziona lo stesso con il classificatore locale. Con Ollama, sul tuo computer o nella tua rete, la chiave non serve.</p>
|
||||
@DataKey(Anubis.News.NewsModelSettings.KeySecret, "Chiave del modello linguistico")
|
||||
@ModelSetting(Anubis.News.NewsModelSettings.Provider.Key, "servizio", "Servizio", null)
|
||||
@ModelSetting(Anubis.News.NewsModelSettings.Model.Key, "modello", "Modello", null)
|
||||
@@ -475,7 +515,7 @@
|
||||
<p class="note">I prezzi in dollari li conto come euro: la spesa calcolata è un po' più alta di quella vera, mai più bassa. Il tetto vale da mezzanotte a mezzanotte; prima di ogni richiesta controllo che anche il caso peggiore ci stia dentro.</p>
|
||||
|
||||
<h3>Calendario</h3>
|
||||
<p class="hint">Senza chiave di Finnhub non conosco le date delle trimestrali e la mean reversion non usa il suo filtro; senza chiave di FRED il calendario usa solo Forex Factory. Le chiavi sono gratuite.</p>
|
||||
<p class="hint">Senza chiave di Finnhub non conosco le date delle trimestrali: @(_measured ? "la misura in ombra del filtro della mean reversion non parte" : "la mean reversion non usa il suo filtro"); senza chiave di FRED il calendario usa solo Forex Factory. Le chiavi sono gratuite.</p>
|
||||
@DataKey("FINNHUB_API_KEY", "Chiave di Finnhub")
|
||||
@DataKey("FRED_API_KEY", "Chiave di FRED")
|
||||
<h3>Settori delle società</h3>
|
||||
@@ -666,6 +706,10 @@
|
||||
|
||||
private SettingValue _meetings = new(SettingsStore.CentralBankMeetings.Key, "", false, null);
|
||||
private readonly List<SettingValue> _newsRules = [];
|
||||
|
||||
private SettingValue? _rules;
|
||||
|
||||
private bool _measured;
|
||||
private readonly List<SettingValue> _model = [];
|
||||
private int? _undoTo;
|
||||
private readonly Dictionary<string, SettingValue> _llm = [];
|
||||
@@ -702,6 +746,8 @@
|
||||
_sources = await new Anubis.Data.SourceStateStore(services.Db, Clock).ListAsync(ct);
|
||||
_taxMethod = await services.Settings.GetAsync(Anubis.Trading.TaxExport.MethodSetting.Key, ct);
|
||||
_taxChoices = await Anubis.Trading.TaxExport.ChoicesAsync(services.Db, ct);
|
||||
_rules = await services.Settings.GetAsync(Anubis.News.ExternalRules.Setting.Key, ct);
|
||||
_measured = _rules.Value == Anubis.News.ExternalRules.Measured;
|
||||
foreach (var rule in Anubis.News.NewsRuleSettings.All)
|
||||
{
|
||||
_newsRules.Add(await services.Settings.GetAsync(rule.Key, ct));
|
||||
@@ -941,6 +987,8 @@
|
||||
"fifo" => "Primo comprato, primo venduto (FIFO)",
|
||||
"EUR" => "Euro (EUR)",
|
||||
"USD" => "Dollaro (USD)",
|
||||
Anubis.News.ExternalRules.Measured => "Solo misurate",
|
||||
Anubis.News.ExternalRules.Active => "Attive",
|
||||
"active" => "Attivo",
|
||||
"paused" => "In pausa",
|
||||
"stopped" => "Fermo",
|
||||
|
||||
Reference in new issue
Block a user