silentfleetkk/riskguard — explained in plain English
Analysis updated 2026-05-18
Cap how much of an account's equity can go into a single trade to prevent overexposure.
Automatically block new trades when losses cross a drawdown threshold, while still allowing position reductions.
Size trades using the Kelly criterion or volatility-targeting instead of guessing position size manually.
Run a background monitor that auto-liquidates positions if a risk limit is breached while unattended.
| silentfleetkk/riskguard | 1ove9/antenna-forge | ali-vilab/diffusionopd | |
|---|---|---|---|
| Stars | 64 | 64 | 64 |
| Language | Python | Python | Python |
| Setup difficulty | moderate | hard | hard |
| Complexity | 3/5 | 5/5 | 5/5 |
| Audience | developer | researcher | researcher |
Figures from each repo's GitHub metadata at analysis time.
Not yet on PyPI, install directly from the GitHub repository with pip, core has zero dependencies.
RiskGuard is an open-source Python library that adds a risk control layer to an algorithmic trading system. The author frames it as the missing piece in the usual quant trading stack: tools already exist for data, research, backtesting, and execution, but not for enforcing hard trading discipline, so RiskGuard fills that gap with a small, dependency-free core. The core idea is that risk rules work best when they are written into code ahead of time rather than relied on as willpower in the moment, since a trader's judgment tends to fail exactly when losses are mounting. RiskGuard enforces a cap on how much of an account's equity can go into a single position, and a drawdown circuit breaker that blocks new trades once losses cross a set threshold, while always still allowing trades that reduce an existing position. It also offers position sizing formulas, including the Kelly criterion and a volatility-targeting method, so bet size is calculated by formula rather than guessed emotionally, and it automatically avoids sizing a trade at all when the expected edge is negative. Beyond static rules, a background RiskMonitor thread can watch an account continuously and automatically cut positions if a drawdown limit is breached while no one is actively watching. Every decision, breach, and trade can be recorded to a tamper resistant audit log using a hash chain, with an optional cryptographic key so the log's integrity can be verified later. Account state, including drawdown and circuit breaker status, can be saved to disk so that restarting the trading process does not accidentally bypass a triggered circuit breaker. The library connects to a paper trading simulator with configurable slippage and fees, or to a real broker such as Alpaca, through a pluggable broker interface. It is not yet published to PyPI, so installation is currently done directly from the GitHub repository with pip. The project is written in Python 3.10 or newer, has continuous integration set up, and is released under the MIT license. Documentation is provided in both Chinese and English.
RiskGuard is a Python library that enforces trading discipline like position caps, drawdown circuit breakers, and dynamic position sizing for algorithmic trading.
Mainly Python. The stack also includes Python.
MIT license: free to use, modify, and distribute, including commercially, with attribution.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.