feat: natural language to StrategyDNA seed generation#40
Merged
Conversation
- Add DNAGenerator class (stratevo/ai_strategy/dna_generator.py) that translates natural language descriptions into valid StrategyDNA JSON via LLM - Add comprehensive DNA schema prompt with all 74 fields, types, ranges, and descriptions for accurate LLM generation - Add --output-format (code|dna) to generate-strategy CLI command - Add --seed-dna to evolve CLI for starting evolution from custom DNA seed - Support seed_dna_path in AutoEvolver for file-based DNA initialization - 39 new tests covering prompts, JSON extraction, validation, generator, CLI args, seed loading, and edge cases (Chinese input, roundtrip, etc.) - Update evolve CLI snapshot Usage: stratevo generate-strategy 'momentum with tight stops' --output-format dna -o seed.json stratevo evolve --seed-dna seed.json --market crypto
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
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.
What
Adds a Natural Language → StrategyDNA Seed feature that lets users describe a trading strategy in plain English/Chinese and get a JSON DNA file to seed the genetic algorithm.
Why
Changes
New Files
Modified Files
Usage
\\�ash
Generate DNA seed from natural language
stratevo generate-strategy 'BTC恐惧时抄底,RSI超卖买入' --output-format dna -o btc_seed.json
Use it to seed evolution
stratevo evolve --seed-dna btc_seed.json --market crypto --generations 100
\\
Tests