summaryrefslogtreecommitdiff
path: root/cli/src/trading_cli/commands/data.py
blob: 25d16933c2fb1745d6c8122af7df87facd843954 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import click


@click.group()
def data():
    """Data collection and management commands."""
    pass


@data.command()
@click.option("--symbol", required=True, help="Trading symbol (e.g. BTCUSDT)")
@click.option("--timeframe", default="1m", show_default=True, help="Candle timeframe")
def collect(symbol, timeframe):
    """Start collecting live market data for a symbol."""
    click.echo(f"Starting data collection for {symbol} at {timeframe} timeframe...")


@data.command()
@click.option("--symbol", required=True, help="Trading symbol (e.g. BTCUSDT)")
@click.option("--timeframe", default="1m", show_default=True, help="Candle timeframe")
@click.option("--from", "since", default=None, help="Start date (ISO format)")
@click.option("--limit", default=1000, show_default=True, help="Number of candles to fetch")
def history(symbol, timeframe, since, limit):
    """Download historical market data for a symbol."""
    click.echo(
        f"Downloading {limit} {timeframe} candles for {symbol}"
        + (f" since {since}" if since else "")
        + "..."
    )


@data.command("list")
def list_():
    """List available data streams and symbols."""
    click.echo("Fetching available data streams and collected symbols...")