Write the manuals and fix what following them found
The manual, the runbook and the go-live list are written and checked claim by claim against the code, and the installation is done from zero by following them on both engines. That found real defects, now fixed: - with SQLite a missing database file left no way to restore a backup: the choices appear, and the file is created only by the user's choice; - an account whose difference vanished after the 15 minutes stayed prudent with no button, a missing stop could be left out for good, and a choice made while the broker was silent used old numbers; - after "Ferma tutto" the positions could not be closed without restarting; - a refused key looked like a silent broker: it has its own notice now; - the split of the capital between the strategies of a broker (SPEC 13.5) could not be changed from the interface. refs #72 #68 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2257c3e16c
commit
24e20584d4
28 files changed
+1147
-57
No files matched your search
@@ -175,12 +175,18 @@ internal sealed class FaultyBroker(IBrokerAccount inner, string? environment = n
|
||||
/// <summary>The next order is refused with this code.</summary>
|
||||
public string? RejectNext { get; set; }
|
||||
|
||||
/// <summary>Stop orders are refused, everything else is taken.</summary>
|
||||
public bool RefuseStops { get; set; }
|
||||
|
||||
/// <summary>Every fill is reported twice.</summary>
|
||||
public bool DuplicateFills { get; set; }
|
||||
|
||||
/// <summary>Every call fails as if the network were down.</summary>
|
||||
public bool Down { get; set; }
|
||||
|
||||
/// <summary>With <see cref="Down"/>: the broker answers, but does not accept the key.</summary>
|
||||
public bool KeyRefused { get; set; }
|
||||
|
||||
public List<OrderRequest> Sent { get; } = [];
|
||||
|
||||
public string Venue => inner.Venue;
|
||||
@@ -214,6 +220,11 @@ internal sealed class FaultyBroker(IBrokerAccount inner, string? environment = n
|
||||
throw new OrderRejectedException("rifiutato", code);
|
||||
}
|
||||
|
||||
if (RefuseStops && request.Kind == OrderKind.Stop)
|
||||
{
|
||||
throw new OrderRejectedException("rifiutato", "stop");
|
||||
}
|
||||
|
||||
Sent.Add(request);
|
||||
var answer = await inner.SubmitOrderAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
if (LoseNextAnswer)
|
||||
@@ -246,5 +257,5 @@ internal sealed class FaultyBroker(IBrokerAccount inner, string? environment = n
|
||||
|
||||
public IAsyncEnumerable<OrderUpdate> StreamOrderUpdatesAsync(CancellationToken cancellationToken) => inner.StreamOrderUpdatesAsync(cancellationToken);
|
||||
|
||||
private Task<T> Guard<T>(Func<Task<T>> call) => Down ? throw new BrokerException("rete giù", retryable: true) : call();
|
||||
private Task<T> Guard<T>(Func<Task<T>> call) => Down ? throw new BrokerException(KeyRefused ? "chiave" : "rete giù", retryable: !KeyRefused) { KeyRefused = KeyRefused } : call();
|
||||
}
|
||||
Reference in new issue
Block a user