-
Notifications
You must be signed in to change notification settings - Fork 22
Add automated backtest workflow with Notion integration #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add a new scheduler module for fully automated strategy generation: - NotionClient: Publish strategy articles to Notion databases - ArticleGenerator: Generate formatted reports from backtest results - ScheduledRunner: APScheduler-based job runner with persistence - AutomatedBacktestPipeline: End-to-end workflow orchestration New CLI commands: - quantcoder schedule start: Start scheduled automation - quantcoder schedule run: Run pipeline once manually - quantcoder schedule status: View run statistics - quantcoder schedule config: Configure Notion credentials Features: - Papers -> Backtest -> Best Strategy -> Notion workflow - Algorithms kept in QuantConnect, articles published to Notion - Configurable schedules (hourly, daily, weekly) - Tracks processed papers to avoid duplicates - Persistent state across restarts - Min Sharpe thresholds for generation and publishing https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
- Set default max_strategies_per_run (batch limit) to 10 - Align notion_min_sharpe with min_sharpe_ratio by default - Clarify in help text: algos meeting acceptance criteria stay in QC - Notion article published only for successful algos https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
New spot generation workflow: - `quantcoder download 1 2 3` - Download multiple articles - `quantcoder summarize 1 2 3` - Creates individual summaries + consolidated - `quantcoder summaries` - List all available summaries with IDs - `quantcoder generate 6` - Generate code from consolidated summary #6 Storage model: - Individual summaries stored in ~/.quantcoder/summaries/ - Consolidated summaries auto-created when summarizing multiple articles - Consolidated gets next available ID, stores references to sources - Same `generate` command works for both individual and consolidated Implementation: - SummaryStore: Manages summary storage with index - IndividualSummary/ConsolidatedSummary: Data models - LLM consolidation: Merges multiple summaries into coherent strategy - Updated CLI commands to accept multiple IDs https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
- Add --backtest flag to generate command to run QuantConnect backtest - Add --min-sharpe option (default 0.5) for acceptance threshold - Add --start-date and --end-date options for backtest period - Auto-publish to Notion when Sharpe meets threshold - Add _publish_to_notion helper for article creation - Export StrategyArticle, ScheduleConfig, ScheduleInterval, PipelineConfig from scheduler This enables the spot generation workflow to optionally backtest generated code and publish successful strategies to Notion, matching the batch workflow behavior. https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
- Add TavilyClient for Tavily Search API integration - Add DeepSearchTool with LLM-based relevance filtering - Add --deep flag to search command for semantic search - Add --no-filter flag to skip LLM filtering - Add --tavily-key option to schedule config command - Add has_tavily_api_key() and get_tavily_api_key() to Config - Export DeepSearchTool and TavilyClient from tools module - Add 19 tests for deep search functionality Usage: quantcoder search "momentum strategy" --deep quantcoder schedule config --tavily-key tvly-xxx The deep search uses Tavily's semantic search with academic domain filtering (arXiv, SSRN, etc.) and optional LLM filtering to identify papers with implementable quantitative trading strategies. https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
Spot workflow (generate command): - Add --evolve flag to run evolution after backtest passes - Add --gens option (default 5) for evolution generations - Add --variants option (default 3) for variants per generation - Add _run_evolution() helper function for evolution execution Batch workflow (schedule run/start commands): - Add --evolve, --gens, --variants options to schedule run - Add same options to schedule start for scheduled runs - Add evolve_strategies, evolution_generations, evolution_variants to PipelineConfig Usage: # Spot workflow quantcoder generate 1 --backtest --evolve --gens 5 # Batch workflow quantcoder schedule run --evolve --gens 5 quantcoder schedule start --interval daily --evolve https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
- Create logging_config.py with log rotation, JSON structured logging, and webhook alerting - Add LoggingConfigSettings to config.toml for configurable log levels, rotation size/count - Update CLI with `logs` command group: show, list, clear, config subcommands - Add AutoStats persistence to disk (session history, load_latest, list_sessions) - Integrate new logging system into CLI setup with Rich console handler https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
Complete guide covering all QuantCoder features: - Two workflows (Spot and Batch) - All CLI commands - Configuration options - Logging and monitoring - Deep search with Tavily - Strategy evolution - Notion integration https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a new scheduler module for fully automated strategy generation:
New CLI commands:
Features:
https://claude.ai/code/session_01SwNvxUMWNQ3RYpdCNg38xY