Algorithmic trading, simplified
Features
Everything you need to trade algorithmically
From strategy execution to risk management to backtesting — all in a single pip-installable package.
Rule-Based Strategies
Momentum and mean reversion strategies using SMA crossover, RSI, MACD, Bollinger Bands, and Stochastic RSI. No black-box ML.
14-Check Risk Gate
Every signal passes through position sizing, loss limits, drawdown protection, sector allocation, and correlation checks. No overrides.
7-Trigger Circuit Breaker
Automatic trading halt on consecutive losses, daily/weekly loss limits, max drawdown, VIX spikes, or system errors.
Historical Backtesting
Download market data, replay through strategies and risk management, get Sharpe ratio, win rate, drawdown, and full trade logs.
Real-Time Dashboard
Live equity curve, positions, trade log, and kill switch via WebSocket. See everything happening in real time at localhost:8080.
Alpaca Integration
Add your API keys to trade with real money via Alpaca. Works in simulation mode without any keys — no signup required.
Backtesting
Test before you trade
Run your strategies against historical market data to evaluate performance before risking real capital.
$ klawtrade backtest \
--start-date 2024-01-01 \
--end-date 2024-12-31 \
--symbols AAPL,MSFT,NVDA \
--strategy momentum
Downloading historical data...
Computing technical indicators...
Replaying 252 bars across 3 symbols...
Sample output is illustrative. Actual results depend on market conditions and configuration.
Up and running in 3 steps
Install
pip install klawtradeConfigure
klawtrade initTrade
klawtrade startBuilt in the open. MIT licensed.
KlawTrade is fully open source. Inspect every line of code that touches your money. Contribute strategies, fix bugs, or fork it and make it your own. No black boxes, no vendor lock-in.
View on GitHub