feat: configurable ticker window for market stats (1h, 4h, 1d)

- Replace hardcoded ticker_24h with ticker_stats supporting configurable window
- Add -w/--window flag to `market tickers` (choices: 1h, 4h, 1d, default 1d)
- Update TUI title and JSON output to include window field
- Keep opportunity/pf service on 1d default
- Sync tests and doc comments

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-20 11:11:11 +08:00
parent cf26a3dd3a
commit 4312b16288
7 changed files with 37 additions and 24 deletions

View File

@@ -26,7 +26,7 @@ class FakeSpotClient:
return list(prices.values())
return [prices[symbol] for symbol in symbols]
def ticker_24h(self, symbols=None):
def ticker_stats(self, symbols=None, *, window="1d"):
rows = [
{
"symbol": "BTCUSDT",

View File

@@ -27,7 +27,7 @@ class FakeSpotClient:
}
return [mapping[symbol] for symbol in symbols]
def ticker_24h(self, symbols=None):
def ticker_stats(self, symbols=None, *, window="1d"):
rows = {
"BTCUSDT": {
"symbol": "BTCUSDT",