Skip to content

MeridianAlgo/Cryptvault

CryptVault

AI-powered cryptocurrency & stock analysis β€” desktop, CLI, and Python API.

Python Version License: MIT Tests Lint Coverage Ruff

Quick Start Β· Desktop App Β· CLI Β· Patterns Β· ML Β· Docs


Warning

Educational and research use only. CryptVault is not financial advice and must not be used for live trading decisions. Past performance does not guarantee future results. You are solely responsible for any investment outcomes.


🧭 What is CryptVault?

CryptVault is a research-grade analysis platform for crypto and equities that combines:

  • πŸ–₯️ A native desktop terminal with candlestick charts, drawn pattern overlays, and ML predictions side-by-side.
  • 🧠 A production ML ensemble (67+ engineered features, validation-weighted stacking) achieving 1.6–2.4% MAPE on major pairs.
  • πŸ” 50+ classical patterns across 7 categories β€” all drawn as actual geometric shapes, not just markers.
  • πŸ€– Reinforcement-learning agents (DQN, PPO, Transformer) for trading research.
  • πŸ› οΈ A clean Python API, CLI, and portfolio tools.

✨ Highlights (v6.1.0)

Area What's new
CI/CD Ruff-first lint pipeline, zero-flake rules, faster parallel tests (pytest -n auto).
Code quality Fixed latent F821 / F402 bugs; project is now ruff-clean.
README & docs Scannable layout, badge row, pattern quick reference, one-page install.
Pattern rendering Double Top/Bottom, H&S, Triangles, Wedges drawn as lines/necklines on chart.
Desktop UX Analysis panel always visible; no stale tabs; cleaner indicator stack.

Full history: docs/CHANGELOG.md.


πŸš€ Quick Start

git clone https://github.com/MeridianAlgo/Cryptvault.git
cd Cryptvault
pip install -r requirements.txt

Verify:

python -c "import cryptvault; print(cryptvault.__version__)"

Run the desktop terminal:

python launch_desktop.py

πŸ–₯️ Desktop App

A dark-themed trading terminal with three synchronized surfaces β€” chart, patterns, and ML.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CryptVault 6.1   [BTC-USD]  [Analyze]   1D 5D 1M 3M 6M 1Y YTD  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚            β”‚                                  β”‚  ML PREDICTION β”‚
β”‚   Chart    β”‚    πŸ“ˆ Candlestick + Patterns     β”‚  ────────────  β”‚
β”‚            β”‚    πŸ“Š Bollinger Bands            β”‚                β”‚
β”‚  Analysis  β”‚    πŸ“‰ Volume  Β· RSI              β”‚  DETECTED      β”‚
β”‚            β”‚                                  β”‚  PATTERNS      β”‚
β”‚  History   β”‚    (pattern shapes drawn live)   β”‚  (scrollable)  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Status: connected Β· last fetch 2s Β· 120 candles Β· 12 patterns  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Patterns are drawn, not just labeled

Pattern Rendered as
Double Top / Bottom Peak-to-peak line + dashed neckline
Head & Shoulders LS β†’ Head β†’ RS connectors + neckline
Triple Top / Bottom Three-pivot polyline
Triangles (Sym/Asc/Desc) Fitted upper + lower trendlines
Rising / Falling Wedge Converging trendlines
Any pattern with target Dotted horizontal target line
Candlestick β–² bullish / β–Ό bearish marker

See docs/DESKTOP_APP.md.


⚑ CLI

# Analyze Bitcoin with chart
python cryptvault_cli.py BTC 60 1d

# Save chart to file
python cryptvault_cli.py ETH 120 1d --save-chart eth.png

# Text-only analysis
python cryptvault_cli.py SOL 90 1d --no-chart

# Portfolio
python cryptvault_cli.py --portfolio BTC:0.5 ETH:10 SOL:50

# Compare assets
python cryptvault_cli.py --compare BTC ETH SOL

# Interactive REPL
python cryptvault_cli.py --interactive

Command reference

python cryptvault_cli.py SYMBOL [DAYS] [INTERVAL] [OPTIONS]
Option Description
--no-chart Text-only output
--save-chart FILE Save chart as PNG
--verbose Detailed diagnostics
--desktop Launch desktop app
--portfolio A:X B:Y ... Portfolio analysis
--compare S1 S2 ... Side-by-side comparison
--interactive REPL mode
--status API & data source health
--demo Run demonstration dataset
--version / --help Info

πŸ” Pattern Library

50+ classical patterns across 7 categories. Full reference: docs/PATTERNS.md.

Reversal (8) β€” Head & Shoulders, Inverse H&S, Double/Triple Top & Bottom, Rising/Falling Wedge

Detected via local pivot extraction, neckline fitting, and symmetry scoring. Drawn with the actual peak/trough connectors plus a dashed neckline and projected target.

Continuation β€” Triangles (Sym/Asc/Desc), Bull/Bear Flag, Pennants, Cup & Handle

Trendline regression on swing highs and swing lows; convergence and slope tests determine the sub-type. Targets projected from breakout range.

Candlestick β€” Doji (3 variants), Hammer, Hanging Man, Inverted Hammer, Shooting Star, Engulfing, Harami, Piercing, Dark Cloud, Morning/Evening Star, Three Soldiers/Crows

Body/wick ratio analysis with trend-context filters. Rendered as β–² or β–Ό above/below the candle.

Harmonic β€” Gartley, Butterfly, Bat, Crab, Shark, Cypher

Fibonacci ratio validation between swing points (XABCD structure) with per-pattern tolerance bands.

Divergence β€” RSI & MACD Bullish/Bearish

Peak/trough alignment between price and oscillator detects hidden and regular divergence.


🧠 Machine Learning

Ensemble β€” each base learner weighted by rolling out-of-fold validation:

Model Role
Random Forest Non-linear baseline, robust to noise
Gradient Boosting Sequential residual refinement
SVR Small-sample non-linear regression
Ridge / Lasso / ElasticNet Stable linear anchors
ARIMA Explicit time-series baseline
XGBoost / LightGBM (optional) High-capacity boosting

Stacked via a meta-learner on validation residuals.

Measured performance (real market data)

Metric Range
Average MAPE 1.6 – 2.4 %
Direction accuracy 100 % on tested symbols
Predictions within Β±2 % 80 – 100 %
RΒ² 0.50 – 0.81

Tested on BTC, ETH, SOL, BNB β€” 120-day windows.

Reinforcement learning research

State-of-the-art RL agents for trading research (not for live trading):

  • DQN β€” dueling, noisy nets, prioritized replay
  • PPO β€” with GAE
  • Transformer β€” multi-head attention policy

See cryptvault/rl/README.md.


πŸ—‚οΈ Project Structure

Cryptvault/
β”œβ”€β”€ cryptvault/
β”‚   β”œβ”€β”€ desktop/         # Native Tk GUI (app, panels, theme)
β”‚   β”œβ”€β”€ patterns/        # 50+ pattern detectors (7 categories)
β”‚   β”œβ”€β”€ ml/              # Ensemble + feature engineering
β”‚   β”œβ”€β”€ rl/              # DQN / PPO / Transformer agents
β”‚   β”œβ”€β”€ data/            # Market data fetch & caching
β”‚   β”œβ”€β”€ visualization/   # Chart rendering
β”‚   β”œβ”€β”€ portfolio/       # Multi-asset analytics
β”‚   └── security/        # Input validation & sanitization
β”œβ”€β”€ docs/                # Full documentation
β”œβ”€β”€ tests/               # pytest suite (unit + integration)
β”œβ”€β”€ cryptvault_cli.py    # CLI entry point
β”œβ”€β”€ launch_desktop.py    # Desktop launcher
└── pyproject.toml       # Tooling config (ruff, bandit, pytest)

πŸ–₯️ System Requirements

Minimum Recommended
Python 3.9 3.11+
RAM 4 GB 8 GB
Disk 2 GB 5 GB
Network Required (data fetch) β€”

Platforms: Windows 10/11 Β· Ubuntu 20.04+ Β· macOS 10.15+ (including Apple Silicon).


πŸ§ͺ Development

# Install dev tooling
pip install -r requirements.txt
pip install ruff bandit pytest pytest-cov pytest-xdist

# Lint (same command CI uses)
ruff check cryptvault/ cryptvault_cli.py
ruff format cryptvault/ cryptvault_cli.py

# Security scan
bandit -c pyproject.toml -r cryptvault/ -ll

# Tests (parallel)
pytest tests/ -n auto --cov=cryptvault --cov-report=term

The project is ruff-clean as of v6.1.0 β€” CI blocks on ruff violations.


πŸ“š Documentation

Doc About
Desktop App Full GUI walkthrough
Patterns Every detector, how it works
Architecture System design & data flow
API Reference Python API
Performance Benchmarks & tuning
Deployment Packaging & distribution
Troubleshooting Common issues
Security Disclosure policy
Changelog Version history
Contributing How to contribute

🀝 Contributing

  1. Fork and branch from main.
  2. pip install -r requirements.txt
  3. Write tests first (pytest).
  4. ruff check must pass.
  5. Open a PR with a clear description.

See docs/CONTRIBUTING.md and CODE_OF_CONDUCT.md.


πŸ“ License

MIT β€” see LICENSE.


πŸ™ Credits

Built with: scikit-learn Β· yfinance Β· NumPy Β· pandas Β· SciPy Β· Matplotlib Β· XGBoost Β· LightGBM.

Maintained by MeridianAlgo β€” a research organization focused on open-source financial ML. Not a licensed broker or financial advisor.


Version 6.1.0 Β· Last updated April 2026 Β· Built for researchers, by researchers.

About

Professional-grade cryptocurrency analysis with advanced AI/ML predictions, 50+ pattern recognition, and MathPlotLib terminal charts. CryptVault is an informational tool for educational and research purposes only.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors

Languages