diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-01 15:56:35 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-01 15:56:35 +0900 |
| commit | 33b14aaa2344b0fd95d1629627c3d135b24ae102 (patch) | |
| tree | 90b214758bc3b076baa7711226a1a1be6268e72e /cli/src/trading_cli/commands/data.py | |
| parent | 9360f1a800aa29b40399a2f3bfbfcf215a04e279 (diff) | |
feat: initial trading platform implementation
Binance spot crypto trading platform with microservices architecture:
- shared: Pydantic models, Redis Streams broker, asyncpg DB layer
- data-collector: Binance WebSocket/REST market data collection
- strategy-engine: Plugin-based strategy execution (RSI, Grid)
- order-executor: Order execution with risk management
- portfolio-manager: Position tracking and PnL calculation
- backtester: Historical strategy testing with simulator
- cli: Click-based CLI for all operations
- Docker Compose orchestration with Redis and PostgreSQL
- 24 test files covering all modules
Diffstat (limited to 'cli/src/trading_cli/commands/data.py')
| -rw-r--r-- | cli/src/trading_cli/commands/data.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cli/src/trading_cli/commands/data.py b/cli/src/trading_cli/commands/data.py new file mode 100644 index 0000000..1fa5e30 --- /dev/null +++ b/cli/src/trading_cli/commands/data.py @@ -0,0 +1,31 @@ +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...") |
