A comprehensive tool for analyzing FreqTrade trading strategies, detecting issues, and generating detailed reports in multiple formats.
- π Comprehensive Analysis: Detects lookahead bias, global variables, memory leaks, and more
- π Multiple Output Formats: Text, CSV, JSON, Markdown, and HTML reports
- π¨ Visual Dashboard: Beautiful HTML reports with color-coded ratings
- β‘ Bulk Processing: Analyze hundreds of strategies recursively
- π§ Hyperopt Detection: Identifies optimization capabilities
- π Statistics & Insights: Common issues and feature adoption metrics
- Lookahead Bias:
dataframe.iloc[-1]usage and similar patterns - Global Variables: Dangerous global state that can cause issues
- Dangerous Operations: Risky code patterns like
exec(),eval()
- Hardcoded Values: Non-parameterized constants that should be optimizable
- Memory Leaks: Growing data structures without cleanup
- Missing Error Handling: Risky operations without try/catch blocks
- Strategy Structure: Required/optional methods validation
- Optimization Capability: Hyperopt parameter detection
- Indicators Used: Technical analysis indicators catalog
git clone https://github.com/Facepipe/Freqtrade-Strategy-Analyser.git
cd Freqtrade-Strategy-Analyser
pip install -r requirements.txtwget https://raw.githubusercontent.com/Facepipe/Freqtrade-Strategy-Analyser/main/src/strategy_analyzer.py
chmod +x strategy_analyzer.py# Analyze all strategies in a directory
python src/strategy_analyzer.py /path/to/strategies/
# Generate all output formats
python src/strategy_analyzer.py /path/to/strategies/ --all-formats
# Specific format outputs
python src/strategy_analyzer.py /path/to/strategies/ --csv summary.csv
python src/strategy_analyzer.py /path/to/strategies/ --html report.html| Format | Best For | Description |
|---|---|---|
| Text | Detailed analysis | Traditional comprehensive report |
| CSV | Excel analysis | Sortable data for spreadsheets |
| HTML | Visual overview | Interactive dashboard with charts |
| Markdown | Documentation | GitHub-friendly formatted report |
| JSON | Integration | Raw data for other tools |
python src/strategy_analyzer.py [directory] [options]
Arguments:
directory Directory to analyze recursively
Options:
-o, --output FILE Output file for report
-f, --format FORMAT Output format: text, csv, json, markdown, html
--csv FILE Export summary as CSV
--json FILE Export detailed results as JSON
--markdown FILE Export as Markdown
--html FILE Export as HTML
--all-formats Generate all formats with auto-naming
-h, --help Show help messageπ Total strategies: 465
β
Valid: 421 (90.5%)
π’ Excellent: 23
π΅ Good: 186
π‘ Poor: 212
π΄ Broken: 44
- π’ Excellent: Well-structured, hyperoptable, no major issues
- π΅ Good: Minor issues, functional, ready for use
- π‘ Poor: Multiple warnings, needs improvement
- π΄ Broken: Critical issues, should not be used
- Code Quality: Identify and fix issues in your strategies
- Best Practices: Learn from analysis recommendations
- Optimization: Ensure strategies are hyperopt-ready
- Bulk Analysis: Analyze entire strategy repositories
- Quality Assessment: Find the best strategies quickly
- Issue Tracking: Identify common problems across strategies
- Due Diligence: Vet strategies before deployment
- Performance: Ensure strategies meet quality standards
- Documentation: Generate reports for strategy reviews
The analyzer uses pattern matching to detect issues. You can customize detection patterns by modifying the StrategyAnalyzer class:
# Example: Add custom pattern detection
self.critical_patterns['custom_issue'] = [
r'your_custom_pattern_here'
]# Clone the community strategies
git clone https://github.com/freqtrade/freqtrade-strategies.git
# Analyze all strategies
python src/strategy_analyzer.py freqtrade-strategies/user_data/strategies/ --all-formats
# Results in:
# - strategy_analysis.txt (detailed report)
# - strategy_analysis.csv (Excel-ready data)
# - strategy_analysis.html (visual dashboard)
# - strategy_analysis.md (GitHub documentation)
# - strategy_analysis.json (raw data)# Generate CSV and open in Excel/LibreOffice
python src/strategy_analyzer.py strategies/ --csv results.csv
# Filter by rating="excellent" and critical_issues=0
# Sort by parameter_count (desc) for most optimizable strategiesContributions are welcome! Please feel free to submit a Pull Request.
git clone https://github.com/facepipe/Freqtrade-Strategy-Analyser.git
cd Freqtrade-Strategy-Analyser
pip install -r requirements-dev.txt
python -m pytest tests/- Add patterns to
StrategyAnalyzer.__init__() - Create detection method following
_check_*pattern - Add tests in
tests/test_detectors.py - Update documentation
This project is licensed under the MIT License - see the LICENSE file for details.
- FreqTrade Community: For the amazing trading framework
- Strategy Authors: For sharing their strategies
- Contributors: Everyone who helps improve this tool
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- FreqTrade Discord: General FreqTrade support
Made with β€οΈ for the FreqTrade community