FAQ
Frequently asked questions
Everything you need to know before installing KlawTrade. Can't find your answer? Ask on GitHub Discussions.
Is KlawTrade free?
Yes. KlawTrade is MIT-licensed open-source software. You can install it with pip install klawtrade and use it for paper or live trading without any subscription, usage fee, or account. If you opt into the AI strategy, you pay your own LLM provider (Anthropic or OpenAI) directly — KlawTrade never sits in the middle.
What brokers does KlawTrade support?
Six brokers out of the box: Alpaca (stocks and crypto), Interactive Brokers (stocks, futures, options), Coinbase, Binance, Kraken, and Tradier. Without API keys, KlawTrade automatically runs against a built-in simulation broker so you can try it immediately.
Can I use KlawTrade without writing code?
Yes. Install with pip, run klawtrade init to generate a config, then klawtrade start. The default config ships with a simulated broker, two rule-based strategies, and the 14-check risk manager already wired up. You only touch code if you want to write a custom strategy.
What is the 14-check risk management gate?
Every signal — whether rule-based or AI-generated — passes through fourteen deterministic checks before any order reaches the broker: symbol blacklist, max position size, max daily loss, max weekly loss, max drawdown, max single-trade loss, max open positions, max daily trades, minimum cash reserve, minimum volume, maximum spread, sector allocation, correlated exposure, and signal confidence. Any failed check blocks the trade.
What is the 7-trigger circuit breaker?
A separate layer on top of the risk gate that halts ALL trading when any of seven conditions fire: consecutive losses, daily loss limit, weekly loss limit, max drawdown, VIX spike, system error rate, or manual kill switch. Halt duration is configurable.
Does KlawTrade support AI-powered trading?
Yes — optionally. KlawTrade AI is the LLM-backed signal generator. Bring your own Anthropic or OpenAI API key, enable it in settings.yaml, and the bot runs Claude or GPT as an additional signal source alongside the rule-based strategies. Every AI signal still passes through the same 14-check risk gate, so accuracy is preserved.
How does KlawTrade preserve accuracy with AI?
Six stacked guardrails. (1) Strict JSON schema output via Claude tool_use or OpenAI response_format. (2) Temperature zero by default for deterministic responses. (3) Minimum confidence threshold higher than rule strategies. (4) Rule cross-validation — AI BUY/SELL must be seconded by at least one classic indicator. (5) Stop and take-profit sanity checks. (6) The 14-check risk gate as an absolute blocker.
How much does the AI strategy cost to run?
It depends on your model and watchlist size. On default settings — Claude Sonnet, 10-symbol watchlist, 60-second cache — budget 2 to 5 US dollars per trading day. The max_daily_cost_usd cap pauses the strategy automatically once reached. Using Claude Haiku or GPT-4o-mini drops cost roughly ten times.
Does KlawTrade support backtesting?
Yes. Run klawtrade backtest with a date range and symbol list. KlawTrade downloads historical data from yfinance, replays it through the configured strategies and risk manager, and reports total return, annualised return, Sharpe ratio, Sortino ratio, max drawdown, win rate, profit factor, best and worst trade, and the full equity curve.
Is there a real-time dashboard?
Yes. The dashboard runs at localhost:8080 by default and shows live equity, positions, open orders, trade log, risk-check history, and a manual kill switch — all streamed via WebSocket. It is disabled if dashboard.enabled is false in the config.
Is my broker key safe?
All credentials stay on your machine. KlawTrade reads them from environment variables or your config file and calls the broker APIs directly from your host — the project has no cloud component and no telemetry. The source is MIT-licensed and fully auditable on GitHub.
Can I run KlawTrade in Docker?
Yes. The repo ships with a Python 3.13-slim Dockerfile. docker build -t klawtrade . then docker run -p 8080:8080 klawtrade starts the system with the dashboard exposed. Mount a volume for /app/logs and /app/data to persist state across restarts.
Can I run KlawTrade with a local LLM (Ollama, vLLM, LM Studio)?
Yes — set provider to openai and override the base URL to your local endpoint. Any OpenAI-compatible server works, including Ollama, vLLM, LM Studio, and LocalAI. There is no per-call cost and your prompts never leave your network.
How do I contribute?
The repo is on GitHub at github.com/klawtrade/klawtrade. Open an issue, submit a PR, or just say hi in Discussions. Good first contributions: new broker adapters, additional rule strategies, or extra circuit-breaker triggers.
Does KlawTrade provide investment advice?
No. KlawTrade is software infrastructure for implementing your own trading strategies. Nothing in the project is investment advice. Algorithmic trading carries significant risk of loss; paper-trade extensively and consult a licensed professional before deploying real capital.