git404hub

what is riskguard fr?

silentfleetkk/riskguard — explained in plain English

Analysis updated 2026-05-18

64PythonAudience · developerComplexity · 3/5LicenseSetup · moderate

tl;dr

RiskGuard is a Python library that enforces trading discipline like position caps, drawdown circuit breakers, and dynamic position sizing for algorithmic trading.

vibe map

mindmap
  root((RiskGuard))
    What it does
      Position size caps
      Drawdown circuit breaker
      Dynamic position sizing
    Tech stack
      Python
    Use cases
      Algorithmic trading safety
      Kelly criterion sizing
      Tamper-resistant audit log
    Features
      Background risk monitor
      State persistence
      Pluggable broker interface

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Cap how much of an account's equity can go into a single trade to prevent overexposure.

VIBE 2

Automatically block new trades when losses cross a drawdown threshold, while still allowing position reductions.

VIBE 3

Size trades using the Kelly criterion or volatility-targeting instead of guessing position size manually.

VIBE 4

Run a background monitor that auto-liquidates positions if a risk limit is breached while unattended.

what's the stack?

Python

how it stacks up fr

silentfleetkk/riskguard1ove9/antenna-forgeali-vilab/diffusionopd
Stars646464
LanguagePythonPythonPython
Setup difficultymoderatehardhard
Complexity3/55/55/5
Audiencedeveloperresearcherresearcher

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · moderate time til it works · 30min

Not yet on PyPI, install directly from the GitHub repository with pip, core has zero dependencies.

MIT license: free to use, modify, and distribute, including commercially, with attribution.

in plain english

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.

prompts (copy fr)

prompt 1
Show me how to install RiskGuard from GitHub with pip and set up a basic RiskEngine with a paper broker.
prompt 2
Explain how RiskGuard's drawdown circuit breaker works and how to reset it after it triggers.
prompt 3
How do KellySizer and VolatilityTargetSizer differ for calculating position size in RiskGuard?
prompt 4
Walk me through connecting RiskGuard to a real broker like Alpaca using its pluggable broker interface.

Frequently asked questions

what is riskguard fr?

RiskGuard is a Python library that enforces trading discipline like position caps, drawdown circuit breakers, and dynamic position sizing for algorithmic trading.

What language is riskguard written in?

Mainly Python. The stack also includes Python.

What license does riskguard use?

MIT license: free to use, modify, and distribute, including commercially, with attribution.

How hard is riskguard to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is riskguard for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.