Umsetzung des Fable-Plans, Start mit dem risikoarmen Settings-Fundament (kein Hot-Path/CLOB-Verhalten geändert): - Alle Copytrading-Settings (alt + neu) haben jetzt [Description]/[DisplayName] -> im PropertyGrid als Erklärung sichtbar (Richards Vorgabe). Test erzwingt, dass jede einstellbare Option eine Beschreibung trägt. - ProfitTarget-Default -> 9999 (praktisch deaktiviert); Migration setzt zusätzlich bestehende Zeilen per SQL auf 9999 (Entscheidung 2). Take-Profit-LOGIK folgt. - Neue Account-Settings (noch nicht verdrahtet, für Phase 0.1/1.3/2): SellFloorPct (15), MaxSpreadPct (5), MinSellRatioPct (10). - Neue Master-Trader-Settings: AutoPauseEnabled (Default AN, per Master abschaltbar, Entscheidung 3) + MakerEntry (Default aus, Entscheidung 4). - EF-Migration AddCopytradingBehaviorSettings (neue Spalten + sinnvolle Defaults fuer Bestandszeilen) erstellt und auf MySQL angewendet. - Erklärung dokumentiert einen gefundenen Skalen-Verdacht: PreRedeemLimit wird gegen den 0-1-Preis verglichen; Alt-Werte 99.5 triggern nie (-> ggf. 0.995). Tests: 86 gruen. Build/Smoke gruen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
84 lines
2.8 KiB
C#
84 lines
2.8 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace PolyTrader.Modules.CopyTrading.Persistence.Ef.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddCopytradingBehaviorSettings : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "AutoPauseEnabled",
|
|
table: "mod_copytrading_traders",
|
|
type: "tinyint(1)",
|
|
nullable: false,
|
|
defaultValue: true);
|
|
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "MakerEntry",
|
|
table: "mod_copytrading_traders",
|
|
type: "tinyint(1)",
|
|
nullable: false,
|
|
defaultValue: false);
|
|
|
|
migrationBuilder.AddColumn<decimal>(
|
|
name: "MaxSpreadPct",
|
|
table: "mod_copytrading_account_settings",
|
|
type: "decimal(18,6)",
|
|
precision: 18,
|
|
scale: 6,
|
|
nullable: false,
|
|
defaultValue: 5m);
|
|
|
|
migrationBuilder.AddColumn<decimal>(
|
|
name: "MinSellRatioPct",
|
|
table: "mod_copytrading_account_settings",
|
|
type: "decimal(18,6)",
|
|
precision: 18,
|
|
scale: 6,
|
|
nullable: false,
|
|
defaultValue: 10m);
|
|
|
|
migrationBuilder.AddColumn<decimal>(
|
|
name: "SellFloorPct",
|
|
table: "mod_copytrading_account_settings",
|
|
type: "decimal(18,6)",
|
|
precision: 18,
|
|
scale: 6,
|
|
nullable: false,
|
|
defaultValue: 15m);
|
|
|
|
// Entscheidung Richard: ProfitTarget zunächst überall auf 9999 (praktisch deaktiviert),
|
|
// bis die Take-Profit-Logik (Phase 0.3) scharf geschaltet wird.
|
|
migrationBuilder.Sql("UPDATE mod_copytrading_account_settings SET ProfitTarget = 9999;");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "AutoPauseEnabled",
|
|
table: "mod_copytrading_traders");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "MakerEntry",
|
|
table: "mod_copytrading_traders");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "MaxSpreadPct",
|
|
table: "mod_copytrading_account_settings");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "MinSellRatioPct",
|
|
table: "mod_copytrading_account_settings");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "SellFloorPct",
|
|
table: "mod_copytrading_account_settings");
|
|
}
|
|
}
|
|
}
|