Perché: l'utente ha chiesto un bot che operi cinque basket di coppie forex correlate su eToro, autonomo, con ledger, feed gratuiti e apprendimento costruito da zero, e ha deciso di eliminare tutto ciò che restava delle gestioni precedenti (Binance, cTrader/proba, ricerca con SQLite, GBDT, RL, TA-Lib) e di non avere approvazioni manuali sui singoli ordini. Cosa cambia: - nuovo Core dei basket (cross sintetici, decisore, cost gate, sizing, esecutore leg-risk, backtest con PSR/DSR/PBO, livelli 0-3 di apprendimento), adattatore eToro Public API, motore autonomo con equity stop, kill-switch, riconciliazione, ledger append-only, calendario e notizie con sentiment; - modalità Paper / Demo / Live (Live con flag e frase CONFERMO LIVE); - interfaccia rifatta: barra in alto con tre schede, dashboard con i soli numeri principali, fuso orario selezionabile, test di rendering in PNG; - corretto il parser dei costi eToro (campo "value"): markup e overnight non venivano letti; - strumento di ricerca ridotto a ticks / baskets / falsify con due scenari di costo; risultati in results/ e reports/: nessuna configurazione è profittevole al netto dei costi (docs/STRATEGY.md lo dice con i numeri); - documentazione completa (STRATEGY, ML_AND_LEARNING, RUNBOOK, GLOSSARY, KNOWN_ISSUES, ADR-0004, ADR-0005) e catena di rilascio aggiornata. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
using System.Windows;
|
|
|
|
namespace Encelado.Bot.Ui;
|
|
|
|
/// <summary>
|
|
/// One line of typed input with a validator: the phrase that unlocks a live or an
|
|
/// automatic mode, or the written reason that lifts an equity stop. A checkbox would
|
|
/// not do for either — the point is that the operator writes the words.
|
|
/// </summary>
|
|
public partial class PromptWindow : Window
|
|
{
|
|
private readonly Func<string, string?> _validate;
|
|
|
|
public PromptWindow(string title, string body, string label, Func<string, string?> validate, string okText = "Conferma")
|
|
{
|
|
InitializeComponent();
|
|
_validate = validate ?? (static _ => null);
|
|
TitleText.Text = title;
|
|
BodyText.Text = body;
|
|
LabelText.Text = label;
|
|
OkButton.Content = okText;
|
|
Loaded += (_, _) => InputBox.Focus();
|
|
}
|
|
|
|
public string Value => InputBox.Text.Trim();
|
|
|
|
private void OnOk(object sender, RoutedEventArgs e)
|
|
{
|
|
string? problem = _validate(Value);
|
|
if (problem is not null)
|
|
{
|
|
ErrorText.Text = problem;
|
|
ErrorText.Visibility = Visibility.Visible;
|
|
return;
|
|
}
|
|
|
|
DialogResult = true;
|
|
}
|
|
|
|
private void OnCancel(object sender, RoutedEventArgs e) => DialogResult = false;
|
|
|
|
/// <summary>The exact phrase the specification requires before anything live starts.</summary>
|
|
public const string LivePhrase = "CONFERMO LIVE";
|
|
}
|