Repository navigation
Institutional operations: risk limits, kill switch, audit trail, repo… - #3
Merged
Merged
Conversation
…rts, CI, Docker Risk & kill switch - ridgeline/risk.py: pure portfolio limits (35% max position, 4.5% max open risk, 3% daily loss, 15% drawdown halt), overridable via "ridgeline_risk" in config.json. ridgeline/freqtrade_risk.py: RiskMixin that all three strategies inherit - vetoes entries and caps stakes in backtests, paper and live alike. Strategy parameters unchanged. - Panel: risk gauges plus Pause / Resume / Flatten (typed FLATTEN confirm; stopentry -> forceexit all -> stop) for any reachable bot. - ridgeline/audit.py: append-only, hash-chained audit log of control actions, risk events and watchdog alerts; tamper detection shown in the panel. Reporting - ridgeline/report.py + scripts/report.py: self-contained HTML tear sheet (monthly grid, equity vs BTC, drawdown, Sharpe/Sortino/Calmar, trade log, disclosures) from paper DBs or backtests; panel links for sessions/replays. Deployment & monitoring - Dockerfile + docker-compose.yml: bot, monitor-mode panel, watchdog; ports on 127.0.0.1 only. scripts/watchdog.py alerts via Telegram (or console) on bot down/stalled/paused/halted and limits >= 80%. - scripts/init_private_config.py generates API secrets for new machines/CI. Tests & CI - 48 pytest tests: limit boundaries, audit tampering, lookahead (prefix invariance) per strategy, point-in-time universe, panel dry-run guard and flatten sequence, report maths, repo hygiene. ruff lint. GitHub Actions. Research re-run with the risk layer: TrendRider4h OOS +17.3% (was +19.3%), still 8/9 gates (99 trades); drawdown halt cut TrendDipBuyer1h's IS loss from -20.7% to -8.0%. Docs: docs/OPERATIONS.md runbook, README sections, note on licensing for managing other people's money.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…rts, CI, Docker
Risk & kill switch
Reporting
Deployment & monitoring
Tests & CI
Research re-run with the risk layer: TrendRider4h OOS +17.3% (was +19.3%), still 8/9 gates (99 trades); drawdown halt cut TrendDipBuyer1h's IS loss from -20.7% to -8.0%. Docs: docs/OPERATIONS.md runbook, README sections, note on licensing for managing other people's money.