Inspiration
Financial risk management tools are expensive, complex, and locked behind enterprise paywalls. Individual traders and small portfolio managers lack access to the same statistical analysis tools used by institutional investors. RiskScan AI democratizes portfolio risk assessment by providing professional-grade analytics as an open-source Python tool.
What it does
RiskScan AI is a comprehensive portfolio risk scanner that provides:
- Statistical Anomaly Detection: Z-score analysis on price returns and volume data to identify unusual market behavior
- Volatility Regime Classification: Automatically categorizes market conditions as Low, Normal, Elevated, or Crisis using rolling standard deviation analysis
- Risk Metrics Suite: Calculates Value-at-Risk (VaR), Conditional VaR (CVaR/Expected Shortfall), Sharpe Ratio, and Maximum Drawdown
- Composite Risk Scoring: Generates a 0-100 risk score with severity classifications (LOW/MODERATE/HIGH/CRITICAL)
- Interactive Visualizations: Plotly-powered candlestick charts with Bollinger Bands, volatility regime overlays, return distribution histograms, and correlation matrices
- HTML Dashboard Reports: Beautiful dark-mode reports with all metrics and charts for sharing and archiving
How I built it
Built entirely in Python using:
- NumPy/Pandas for statistical computation and data manipulation
- Plotly for interactive, publication-quality visualizations
- Rich for beautiful terminal output with progress bars and formatted tables
- Statistical methods: Rolling z-scores, exponential moving averages, percentile-based regime detection
The architecture follows a pipeline pattern: data ingestion → statistical analysis → anomaly detection → risk scoring → visualization → report generation.
Challenges I ran into
- Balancing sensitivity of anomaly detection thresholds — too sensitive produces false positives, too lenient misses real anomalies
- Designing a composite risk score that meaningfully aggregates multiple disparate metrics (volatility, drawdown, anomaly frequency)
- Making interactive Plotly charts that render well in both browser and embedded HTML report contexts
Accomplishments that I'm proud of
- Zero external API dependencies — works with any OHLCV data source
- The composite risk scoring algorithm produces intuitive results that match market conditions
- Clean, modular architecture under 700 lines of Python
- HTML report generation that looks professional enough for client-facing use
What I learned
- The importance of statistical robustness in financial applications — using percentiles and z-scores rather than absolute thresholds
- How to build publication-quality interactive visualizations with Plotly
- Effective risk metric aggregation techniques used in quantitative finance
What's next for RiskScan AI
- Real-time data feeds (Yahoo Finance, Alpha Vantage, crypto exchanges)
- Machine learning-based anomaly detection (Isolation Forest, LSTM autoencoders)
- Portfolio optimization suggestions based on risk metrics
- Slack/Discord alerting for risk threshold breaches
- Web dashboard for non-technical users
Log in or sign up for Devpost to join the conversation.