summaryrefslogtreecommitdiff
path: root/cli/src/trading_cli/commands/backtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/trading_cli/commands/backtest.py')
-rw-r--r--cli/src/trading_cli/commands/backtest.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/cli/src/trading_cli/commands/backtest.py b/cli/src/trading_cli/commands/backtest.py
new file mode 100644
index 0000000..40617b6
--- /dev/null
+++ b/cli/src/trading_cli/commands/backtest.py
@@ -0,0 +1,26 @@
+import click
+
+
+@click.group()
+def backtest():
+ """Backtesting commands."""
+ pass
+
+
+@backtest.command()
+@click.option("--strategy", required=True, help="Strategy name to backtest")
+@click.option("--symbol", required=True, help="Trading symbol (e.g. BTCUSDT)")
+@click.option("--from", "from_date", required=True, help="Start date (ISO format)")
+@click.option("--to", "to_date", default=None, help="End date (ISO format, defaults to now)")
+@click.option("--balance", default=10000.0, show_default=True, help="Initial balance in USDT")
+def run(strategy, symbol, from_date, to_date, balance):
+ """Run a backtest for a strategy."""
+ to_label = to_date or "now"
+ click.echo(f"Running backtest: strategy={strategy}, symbol={symbol}, {from_date} → {to_label}, balance={balance}...")
+
+
+@backtest.command()
+@click.option("--id", "backtest_id", required=True, help="Backtest run ID")
+def report(backtest_id):
+ """Show a backtest report by ID."""
+ click.echo(f"Showing backtest report for ID: {backtest_id}...")