βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β βββββββ βββ βββ ββββββ ββββ ββββββββββββββββββββββββββββ
β ββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββββββ
β βββ ββββββ βββββββββββββββββ βββ βββ ββββββββββββββββ
β βββββ ββββββ βββββββββββββββββββββ βββ ββββββββββββββββ
β βββββββββββββββββββββ ββββββ ββββββ βββ βββββββββββ β
β βββββββ βββββββ βββ ββββββ βββββ βββ βββββββββββ β
β EXPLOIT THE MARKET β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Quantitative Analysis Trading Framework with Interactive TUI
Quantsploit is a modular quantitative trading framework inspired by penetration testing tools like Metasploit. It provides an interactive command-line interface for running various financial analysis modules, algorithms, and trading strategies.
- π₯οΈ Interactive TUI - Metasploit-style command interface with auto-completion
- π§ Modular Architecture - Plugin system for easy extension
- π Technical Analysis - RSI, MACD, SMA, EMA, Bollinger Bands, and more
- π Market Scanners - Scan multiple stocks for momentum, volume, and patterns
- π Options Analysis - Analyze options chains, Greeks, and opportunities
- πΌ Strategy Backtesting - Test and validate trading strategies
- π Analytics Dashboard - Web-based visualization with interactive charts and comparisons
- πΎ Data Caching - SQLite database for efficient data management
- π Watchlist Management - Track your favorite symbols
- π¨ Rich Output - Beautiful tables and formatted results
- Python 3.8 or higher
- pip
- Clone the repository:
git clone https://github.com/yourusername/Quantsploit.git
cd Quantsploit- Install dependencies:
pip install -r requirements.txt- Install the package:
pip install -e .Run the framework:
python -m quantsploit.mainOr if installed:
quantsploit| Command | Description | Example |
|---|---|---|
help |
Show available commands | help |
show modules |
List all available modules | show modules |
search <query> |
Search for modules | search RSI |
use <module> |
Load a module | use analysis/technical_indicators |
show options |
Display module options | show options |
set <OPTION> <value> |
Set module option | set SYMBOL AAPL |
run |
Execute current module | run |
back |
Unload current module | back |
quote <SYMBOL> |
Get real-time quote | quote TSLA |
watchlist add <SYMBOL> |
Add to watchlist | watchlist add AAPL |
exit |
Exit Quantsploit | exit |
quantsploit > use analysis/technical_indicators
quantsploit (Technical Indicators) > set SYMBOL AAPL
quantsploit (Technical Indicators) > set PERIOD 6mo
quantsploit (Technical Indicators) > run
This will calculate RSI, MACD, SMA, EMA, and Bollinger Bands for Apple stock over the last 6 months.
quantsploit > use scanners/price_momentum
quantsploit (Price Momentum Scanner) > set SYMBOLS AAPL,MSFT,GOOGL,TSLA,NVDA
quantsploit (Price Momentum Scanner) > set MIN_GAIN_PCT 3.0
quantsploit (Price Momentum Scanner) > run
quantsploit > use options/options_analyzer
quantsploit (Options Analyzer) > set SYMBOL SPY
quantsploit (Options Analyzer) > set MIN_VOLUME 100
quantsploit (Options Analyzer) > run
quantsploit > use strategies/sma_crossover
quantsploit (SMA Crossover Strategy) > set SYMBOL AAPL
quantsploit (SMA Crossover Strategy) > set PERIOD 1y
quantsploit (SMA Crossover Strategy) > set FAST_PERIOD 10
quantsploit (SMA Crossover Strategy) > set SLOW_PERIOD 30
quantsploit (SMA Crossover Strategy) > set INITIAL_CAPITAL 10000
quantsploit (SMA Crossover Strategy) > run
- technical_indicators - Calculate technical indicators (RSI, MACD, SMA, EMA, Bollinger Bands)
- pattern_recognition - Detect candlestick and chart patterns with automated signals
- signal_aggregator - Aggregate multiple strategies for consensus buy/sell signals
- price_momentum - Scan multiple stocks for price momentum and volume patterns
- bulk_screener - High-performance parallel screening of large stock universes (SP500, NASDAQ100)
- top_movers - Identify top gainers, momentum leaders, and rank stocks by multiple criteria
- options_analyzer - Analyze options chain, calculate metrics, and identify opportunities
- sma_crossover - Simple Moving Average crossover backtesting strategy
- mean_reversion - Statistical mean reversion with z-score and Bollinger Bands analysis
- momentum_signals - Advanced momentum and trend following with multiple confirmations
- multifactor_scoring - Comprehensive multi-factor quantitative scoring system
Quantsploit includes cutting-edge quantitative algorithms for serious traders:
- Bulk Analysis - Analyze 100+ stocks in parallel with the Advanced Bulk Screener
- Pattern Recognition - Automated detection of 10+ candlestick and chart patterns
- Mean Reversion - Z-score analysis, percentile ranking, and reversion probability
- Momentum Strategies - Multi-period momentum, acceleration, and relative strength
- Multi-Factor Models - Combine momentum, technical, volatility, and volume factors
- Signal Aggregation - Consensus signals from 5+ strategies with confidence scoring
- Top Movers - Real-time rankings by gainers, momentum, breakouts, and quality
See ADVANCED_STRATEGIES.md for detailed usage guide.
Quantsploit includes a comprehensive web-based dashboard for visualizing and analyzing backtest results:
- Interactive Charts - Visualize performance metrics, returns, and risk across strategies
- Period Analysis - Compare performance across quarters and custom time periods
- Strategy Rankings - Identify top-performing strategies with detailed metrics
- Risk vs Return - Interactive scatter plots and heatmaps
- Multi-Run Comparison - Compare up to 5 different backtest runs
- Export Capabilities - Save charts and generate reports
- Run a comprehensive backtest:
python run_comprehensive_backtest.py --symbols AAPL,MSFT,GOOGL- Launch the dashboard:
./start_dashboard.sh # Linux/Mac
# or
start_dashboard.bat # Windows- Open your browser to
http://localhost:5000
See DASHBOARD.md for complete documentation and usage guide.
All modules inherit from BaseModule and implement the following structure:
from quantsploit.core.module import BaseModule
from typing import Dict, Any
class MyCustomModule(BaseModule):
@property
def name(self) -> str:
return "My Custom Module"
@property
def description(self) -> str:
return "Description of what this module does"
@property
def author(self) -> str:
return "Your Name"
@property
def category(self) -> str:
return "analysis" # or scanner, options, strategy
def _init_options(self):
super()._init_options()
self.options.update({
"MY_OPTION": {
"value": None,
"required": True,
"description": "My custom option"
}
})
def run(self) -> Dict[str, Any]:
# Your module logic here
symbol = self.get_option("SYMBOL")
# Return results
return {
"symbol": symbol,
"result": "some value"
}Save your module in the appropriate directory:
quantsploit/modules/analysis/- For analysis modulesquantsploit/modules/scanners/- For scanner modulesquantsploit/modules/options/- For options modulesquantsploit/modules/strategies/- For strategy modules
Edit config.yaml to customize:
- Database location
- Data caching settings
- Display preferences
- Module paths
quantsploit/
βββ core/
β βββ framework.py # Main framework engine
β βββ module.py # Base module class
β βββ session.py # Session management
β βββ database.py # SQLite database
βββ modules/
β βββ analysis/ # Technical analysis modules
β βββ scanners/ # Market scanner modules
β βββ options/ # Options analysis modules
β βββ strategies/ # Trading strategy modules
βββ ui/
β βββ console.py # Interactive TUI
β βββ commands.py # Command handlers
β βββ display.py # Display utilities
βββ utils/
βββ data_fetcher.py # Market data fetching
βββ helpers.py # Utility functions
Quantsploit uses:
- yfinance - Yahoo Finance API for market data
- pandas-ta - Technical analysis indicators
- py_vollib - Options pricing and Greeks
The framework uses SQLite to cache:
- Market data (price/volume)
- Analysis results
- Watchlist symbols
Database location: ./quantsploit.db (configurable)
- More technical indicators (Ichimoku, Fibonacci, etc.)
- Advanced options strategies (Iron Condor, Butterfly, etc.)
- Machine learning modules
- Real-time streaming data
- Visualization/charting
- Portfolio management
- Risk analysis modules
- Correlation analysis
- News sentiment analysis
- Backtesting framework enhancements
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add your module or enhancement
- Submit a pull request
This framework is for educational and research purposes only. It is not financial advice. Trading stocks and options carries risk. Always do your own research and consult with a financial advisor before making investment decisions.
MIT License - See LICENSE file for details
- Inspired by Metasploit's modular framework architecture
- Built with Python, pandas, yfinance, and other excellent open-source libraries
Happy Trading! π