Phase 2 (Fundament): proportionale Teilverkauf-Logik pure + getestet
- SellLogic.SharesToSell (pure): spiegelt die Verkaufsquote des Masters. 0 = ignorieren (< MinSellRatioPct = Rauschen), = ourShares = Voll-Exit (Master ganz raus oder Rest/Teil unter Polymarket-Minimum -> kein Dust), sonst proportional. - 7 Tests (Teilverkauf, Rausch-Schwelle, Voll-Exit-Faelle, Dust-Grenzen). Wiring in die Engine bewusst zurueckgestellt: braucht Partial-Fill-Handling (Phase 1.1 CLOB User-Channel, API-abhaengig -> Zielland). Aktuelles Voll-Exit- Verhalten unveraendert. 200 Tests gruen. Build gruen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
4619edbb99
commit
b259f310d3
@@ -25,6 +25,26 @@ namespace PolyTrader.Modules.CopyTrading.Logic
|
||||
return signalSize / total;
|
||||
}
|
||||
|
||||
// ----- Proportionaler Teilverkauf (Phase 2, pure Logik – Wiring braucht Partial-Fill) -----
|
||||
|
||||
/// <summary>
|
||||
/// Wie viele unserer Shares sollen wir verkaufen, um die Verkaufsquote des Masters zu spiegeln?
|
||||
/// <para>0 = ignorieren (Verkauf unter <paramref name="minSellRatioPct"/> % = Rauschen);
|
||||
/// = <paramref name="ourShares"/> = Voll-Exit (Master ganz raus ODER Restbestand/Teil unter
|
||||
/// Polymarket-Minimum → kein Dust); sonst der proportionale Anteil.</para>
|
||||
/// </summary>
|
||||
public static decimal SharesToSell(decimal ourShares, decimal sellRatio, decimal minShares, decimal minSellRatioPct)
|
||||
{
|
||||
if (ourShares <= 0m) return 0m;
|
||||
if (sellRatio < minSellRatioPct / 100m) return 0m; // Rauschen (Day-Trader-Zappeln)
|
||||
if (sellRatio >= 1m) return ourShares; // Master voll raus → wir auch
|
||||
|
||||
decimal target = ourShares * sellRatio;
|
||||
decimal remaining = ourShares - target;
|
||||
if (target < minShares || remaining < minShares) return ourShares; // Dust vermeiden → Voll-Exit
|
||||
return target;
|
||||
}
|
||||
|
||||
// ----- Eskalationsleiter (Phase 0.1, noch nicht verdrahtet) -----
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user