feat: Short-Seite im Runner + Walk-Forward-CLI (--shorts Flag)

- BacktestConfig.allowShort: boolean (required, explizit)
- Runner: Short-Entry (stop = close + mult×ATR), updateChandelierShort für Trail,
  Stop-Check auf High >= stop, Gap-Fill nach oben
- Bestehende Runner-Tests: allowShort: false ergänzt (Verhalten byte-identisch)
- Neuer E2E-Test: Short-Breakout → trailing_stop; Long-Only-Sanity-Check
- walkforward.ts script: --shorts Flag, Ausgabe "Shorts: AN/AUS"
- walkforward.test.ts: allowShort: false ergänzt

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 21:33:58 +00:00
parent 0e1b477e27
commit 736db184ab
4 changed files with 106 additions and 22 deletions

View File

@@ -19,7 +19,9 @@ for (const pair of PAIRS) {
console.log(`${pair}: ${cov.count} Candles (${cov.from.toISOString()}${cov.to.toISOString()})`);
}
const baseCfg = { startCapital: 1000, risk: DEFAULT_RISK, exec: DEFAULT_EXEC, maxPositions: 4 };
const allowShort = process.argv.includes('--shorts');
const baseCfg = { startCapital: 1000, risk: DEFAULT_RISK, exec: DEFAULT_EXEC, maxPositions: 4, allowShort };
console.log(`Shorts: ${allowShort ? 'AN' : 'AUS'}`);
console.log(`\nWalk-Forward über ${((dataTo - dataFrom) / 86400000).toFixed(0)} Tage…\n`);
const result = runWalkForward(candles15ByPair, baseCfg, dataFrom, dataTo, (msg) => console.log(msg));