AI-driven autonomous trading strategy discovery system for cryptocurrency markets
SLATE (Strategy Learning & Autonomous Trading Engine) is an intelligent system that automatically discovers, tests, and validates cryptocurrency trading strategies using machine learning and statistical analysis. It continuously explores diverse strategy templates to find profitable edges in market data.
SLATE uses ONLY real market data. NO synthetic, simulated, or artificial data is ever used.
- β Real Market Data: All discoveries tested on actual Binance SOLUSDT futures data
- β Brutally Realistic Costs: Real transaction fees, slippage, and fill rates applied
- β Genuine Market Conditions: Authentic volatility, regime changes, and price action
- β NO Synthetic Data: Absolutely no artificial price generation or market simulation
- β NO Optimistic Assumptions: 100% fill rates or zero slippage are forbidden
Transaction Costs (Always Applied):
- Maker Fee: 0.02%
- Taker Fee: 0.05%
- Slippage: 10-20 bps (volatility-adjusted)
- Fill Rate: 85% (not 100%)
- Partial Fills: 15% probability
This ensures SLATE discovers genuine market edges, not artifacts of synthetic data.
Current Status: Fresh start as of May 4, 2026
All previous discovery data has been purged due to synthetic data contamination. System has been reset and will only use authentic market data going forward.
- π€ Autonomous Discovery: Continuously tests 35+ diverse strategy templates
- π Modern Dashboard: Real-time web interface with charts and analytics
- π° Brutal Realism: Honest backtesting with realistic fees, slippage, and fill rates
- π― Diverse Strategies: Momentum, mean reversion, time patterns, microstructure, statistical arbitrage, and more
- π§ Monte Carlo Validation: 100+ path validation for robustness
- π Performance Metrics: Sharpe ratio, drawdown, win rate, profit factor analysis
- π Continuous Learning: Auto-runs discovery cycles every 5 seconds
- ποΈ Persistent Memory: Knowledge graph storage of discovered edges
- Python 3.8+
- Dependencies:
pip install -e ".[dev]
git clone https://github.com/Tilanthi/SLATE.git
cd SLATE
pip install -e .python -m slate_core.serverThe dashboard will be available at: http://127.0.0.1:8788
Main Dashboard (http://127.0.0.1:8788)
- Real-time Statistics: Live discovery metrics and performance
- Strategy Performance: Top strategies with detailed metrics
- Interactive Charts: Return distribution, win rates, performance over time
- Discovery Control: Start/stop discovery, manual refresh
- Strategy Filtering: Sort by return, profit, Sharpe ratio, win rate
- CSV Export: Export strategy data for further analysis
- Auto-refresh: Updates every 5 seconds
SLATE now includes a powerful natural language to strategy conversion feature inspired by Vibe-Trading. Simply describe a trading strategy in plain English, and SLATE will automatically convert it to a testable strategy template.
How it works:
- Enter a strategy description in the dashboard (e.g., "Test a mean reversion strategy when RSI is below 30")
- SLATE parses your description using rule-based patterns or LLM integration
- Click "Generate Strategy" to preview the strategy parameters
- Click "Generate & Test" to immediately backtest the strategy
- Results are automatically saved to the database
SLATE automatically compares all strategies against a buy-and-hold baseline to provide meaningful performance context.
Features:
- Beat Market Rate: Percentage of strategies that outperform buy-and-hold
- Cumulative Excess Return: Total profit over buy-and-hold baseline
- Information Ratio: Risk-adjusted excess return (excess return / tracking error)
- Strategy vs Buy & Hold Chart: Visual comparison of top and worst performers
API Endpoint:
GET /api/discovery/benchmarkAdvanced correlation analysis helps identify diversification opportunities and redundant strategies.
Features:
- Correlation Matrix: Heatmap showing correlations between strategy types
- Redundancy Detection: Identifies highly correlated strategies (>0.8) that may be redundant
- Diversification Opportunities: Highlights low-correlation pairs (<0.3) for optimal diversification
- Multi-Metric Correlation: Uses returns, Sharpe ratio, and win rate for comprehensive analysis
API Endpoint:
GET /api/discovery/correlationCombine multiple strategies optimally using modern portfolio theory.
Optimization Methods:
- Mean-Variance (Markowitz): Traditional mean-variance optimization
- Risk Parity: Equal risk contribution across strategies
- Maximize Sharpe Ratio: Weight strategies by their Sharpe ratios
- Equal Weight: Simple equal-weighted portfolio
Features:
- Optimal Allocations: Calculates optimal weight distribution across strategies
- Portfolio Metrics: Expected return, profit, Sharpe ratio, drawdown
- Diversification Ratio: Measures effective diversification benefit
- Visual Allocation Chart: Pie chart showing portfolio composition
API Endpoint:
GET /api/discovery/portfolio/optimize?method=mean_varianceExample descriptions:
- "Test a mean reversion strategy when RSI is below 30"
- "Create a momentum strategy with EMA 12/26 crossover"
- "Test a breakout strategy when volume is high"
- "Create a volatility squeeze play strategy"
- "Test a support bounce strategy with 20-period lookback"
Supported LLM providers:
- OpenAI: GPT-4o-mini for advanced strategy generation
- Anthropic: Claude 3.5 Haiku for fast, accurate conversion
- Google: Gemini 2.0 Flash Exp for multimodal understanding
- xAI: Grok Beta for alternative perspectives
- DeepSeek: DeepSeek Chat for cost-effective generation
- Qwen: Alibaba Qwen Turbo for Chinese language optimization
- GLM: Zhipu GLM-4 Flash for enterprise solutions
- OpenRouter: Access to 100+ models via single API
- Ollama: Local models for privacy-conscious users
- Azure OpenAI: Enterprise-grade OpenAI deployment
- Mock: Rule-based fallback (default, no API key required)
API Endpoints:
# Generate strategy from description
POST /api/discovery/nl/generate
{
"description": "Test a mean reversion strategy when RSI is below 30",
"provider": "openai" # or "anthropic", "google", "xai", "deepseek", etc.
}
# Generate and immediately test strategy
POST /api/discovery/nl/test
{
"description": "Test a breakout strategy when volume is high"
}SLATE now includes a robust checkpoint/recovery system inspired by TradingAgents:
Features:
- Automatic State Saving: Saves progress after each strategy tested
- Crash Recovery: Resume from last checkpoint if interrupted
- SQLite Storage: Per-cycle checkpoint databases at
~/.slate/cache/checkpoints/ - Progress Tracking: Monitor incomplete cycles and resume points
API Endpoints:
# Get checkpoint status
GET /api/discovery/checkpoint/status
# Resume from specific checkpoint
POST /api/discovery/checkpoint/resume
{
"cycle_id": "uuid-of-cycle-to-resume"
}
# Clear specific checkpoint or all
POST /api/discovery/checkpoint/clear
{
"cycle_id": "optional-uuid-or-omit-for-all"
}Usage:
from slate_core.discovery.edge_discovery_engine import EdgeDiscoveryEngine
# Enable checkpointing
engine = EdgeDiscoveryEngine(checkpoint_enabled=True)
# Run with checkpoint support
result = await engine.run_discovery_cycle_with_checkpoint()
# Resume from crashed cycle
result = await engine.run_discovery_cycle_with_checkpoint(
resume_cycle_id="previous-cycle-id"
)SLATE learns from past discoveries using a markdown-based reflection memory:
Features:
- Persistent Logging: Each cycle logged to
~/.slate/memory/discovery_memory.md - Automatic Reflection: Generates lessons learned from performance
- Cross-Cycle Learning: Past insights inform future cycles
- Pattern Recognition: Identifies what works/doesn't work
API Endpoints:
# Get full reflection memory
GET /api/memory/reflection
# Get recent lessons
GET /api/memory/lessons?limit=10
# Get context for new cycle
GET /api/memory/context
# Clear reflection memory
POST /api/memory/clearUsage:
from slate_core.discovery.edge_discovery_engine import EdgeDiscoveryEngine
# Enable reflection memory (default: enabled)
engine = EdgeDiscoveryEngine(reflection_enabled=True)
# Run discovery - automatically logs to memory
result = await engine.run_discovery_cycle()
# Get context for next cycle
from slate_core.discovery.reflection_memory import get_reflection_memory
memory = get_reflection_memory()
context = memory.get_context_for_new_cycle()- Swagger UI: http://127.0.0.1:8788/docs
- ReDoc: http://127.0.0.1:8788/redoc
- Statistics API:
/api/discovery/statistics - Top Strategies:
/api/discovery/top?limit=10&sort_by=total_profit_usdt - NL Strategy Generate:
/api/discovery/nl/generate - NL Strategy Test:
/api/discovery/nl/test - Benchmark Comparison:
/api/discovery/benchmark - Strategy Correlation:
/api/discovery/correlation - Portfolio Optimization:
/api/discovery/portfolio/optimize?method=mean_variance - Checkpoint Status:
/api/discovery/checkpoint/status - Checkpoint Resume:
/api/discovery/checkpoint/resume - Reflection Memory:
/api/memory/reflection
SLATE tests 35+ diverse strategy templates across 8 categories:
- EMA Crossover Momentum
- RSI Momentum Breakout
- MACD Histogram Momentum
- Breakout Pullback Entry
- Bollinger Band Mean Reversion
- RSI Extremes Reversal
- Support/Resistance Bounce
- Fibonacci Retracement Fade
- ATR Breakout Expansion
- Volatility Squeeze Play
- VIX Proxy Spike Fade
- Gamma Exposure Scalping
- Asian Session Range Fade
- London Open Volatility Breakout
- NY Open Momentum
- End-of-Day Reversal
- Weekend Gap Fade
- CPI/Pivot News Play
- Order Flow Imbalance
- Liquidity Sweep Reversal
- Iceberg Order Detection
- Tick Volume Anomaly
- Bid-Ask Spread Dynamics
- Pairs Trading Signal
- Statistical Mean Reversion
- Cointegration Breakdown
- Z-Score Extreme Entry
- Double Top/Bottom
- Head and Shoulders
- Triangle Breakout
- Flag Pattern Continuation
- Cup and Handle
- Multi-Timeframe Alignment
- Trend Strength Adaptive
- Regime Switching Model
- Momentum Decay Model
Create a .env file in the project root:
# API Keys (if using external data sources)
BINANCE_API_KEY=your_api_key
BINANCE_API_SECRET=your_api_secret
# Server Configuration
HOST=0.0.0.0
PORT=8788Located in slate_core/discovery/edge_discovery_engine.py:
@dataclass
class EdgeBacktestConfig:
# Transaction costs
maker_fee: float = 0.0002 # 0.02%
taker_fee: float = 0.0005 # 0.05%
base_slippage_bps: int = 10 # 10 bps
# Fill realism
base_fill_rate: float = 0.85 # 85% fill rate
partial_fill_probability: float = 0.15
partial_fill_min_size: float = 0.3 # 30% minimum fill
# Risk management
max_position_size: float = 0.05 # 5% max per position
stop_loss_atr_multiple: float = 2.0
take_profit_atr_multiple: float = 3.0
# Validation
monte_carlo_paths: int = 100 # 100 Monte Carlo paths
walk_forward_windows: int = 5Each strategy is evaluated using:
- USDT Profit: Primary metric (actual profit in USDT)
- Return Percentage: ROI on initial capital
- Sharpe Ratio: Risk-adjusted returns
- Sortino Ratio: Downside risk-adjusted returns
- Maximum Drawdown: Largest peak-to-trough decline
- Win Rate: Percentage of profitable trades
- Profit Factor: Gross profit / gross loss
- Beat Market: Performance vs buy-and-hold
SLATE/
βββ slate_core/
β βββ server.py # FastAPI server & dashboard
β βββ static/ # Web dashboard assets
β β βββ index.html # Main dashboard
β β βββ css/
β β β βββ dashboard.css # Dashboard styling
β β βββ js/
β β βββ api.js # API client with retry logic
β β βββ app.js # Dashboard application logic
β β βββ charts.js # Chart.js visualizations
β β βββ utils.js # Utility functions
β βββ discovery/
β β βββ edge_discovery_engine.py # Main discovery engine
β β βββ discovery_memory.py # Persistent memory system
β β βββ nl_strategy_generator.py # Natural language to strategy conversion
β βββ palace_data/ # Knowledge graph storage
βββ tests/ # Test suite
βββ requirements.txt # Python dependencies
Method 1: Using Natural Language (Recommended for quick testing)
Simply use the dashboard's Natural Language Strategy Generator:
- Enter a description like "Test a mean reversion strategy when RSI is below 30"
- Click "Generate & Test" to immediately backtest
- Results are saved automatically to the database
Method 2: Programming New Templates
To add a new strategy template programmatically:
- Add a new template method in
edge_discovery_engine.py - Implement the
_check_entry_signal()logic for your strategy - Add any required technical indicators to
_calculate_indicators() - The system will automatically test it with random variations
pytest tests/ -vGET /api/discovery/statisticsGET /api/discovery/top?limit=10&sort_by=total_profit_usdtPOST /api/discovery/start
POST /api/discovery/stop
GET /api/discovery/statusGET /healthTHIS IS PAPER TRADING ONLY
- No real money is ever risked
- All results are simulated
- Past performance does not guarantee future results
- Always do your own research before trading
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with FastAPI, Python, and JavaScript
- Uses Chart.js for visualizations
- Market data from Binance public API
- Inspired by quantitative trading research
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check the API documentation at
/docs - Review the test files for examples
Note: SLATE is actively developed. Features and APIs may change as the system evolves.
Status: β Active Development | π§ͺ Paper Trading Only