{"owner":"ricequant","repo":"rqalpha","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["CLAUDE.md"],"skills":{"CLAUDE.md":"# CLAUDE.md\n\nRQAlpha is an algorithmic trading system for quantitative trading with backtesting and live trading capabilities.\n\n**License**: Non-commercial use only (Apache 2.0). Commercial use requires authorization from Ricequant.\n\n## Quick Commands\n\n```bash\n# Run backtest\nrqalpha run -f strategy.py -s 2014-01-01 -e 2016-01-01 --account stock 100000\n\n# With RQData connection\nrqalpha run --rqdatac-uri tcp://user:password@host:port -f strategy.py -s 2014-01-01 -e 2016-01-01 --account stock 100000\n\n# Download bundle data\nrqalpha download-bundle\n\n# Update bundle\nrqalpha update-bundle --rqdatac-uri tcp://user:password@host:port\n\n# Generate examples\nrqalpha examples -d ./examples\n\n# Run tests\npytest\npytest tests/unittest/\npytest tests/integration_tests/\n```\n\n## Project-Specific Rules\n\n### When Writing Strategies\n\n1. **Always consult documentation first**: Read `docs/source/intro/tutorial.rst` and `docs/source/api/base_api.rst` before writing strategies\n2. **Use correct API signatures**: Check `docs/source/api/base_api.rst` for function parameters and return types\n3. **Follow strategy lifecycle**: Implement `init()`, `before_trading()`, `handle_bar()`, `after_trading()` in correct order\n4. **Stock code format**: Always use format like \"000001.XSHE\" (code + exchange)\n5. **Date format**: Use 'YYYY-MM-DD' format for dates\n\n### When Debugging/Testing\n\n1. **Write minimal reproducible examples**: Create smallest possible strategy that reproduces the bug\n2. **Use logger, not print**: Use `logger.info()` instead of `print()` in strategies\n3. **Add assertions**: Verify expected behavior with assertions in test code\n4. **Short date ranges**: Use 1-3 month ranges for faster iteration during testing\n\n### Code Modifications\n\n1. **Chinese comments OK**: Domain-specific logic can use Chinese comments\n2. **Follow PEP 8**: Standard Python style guide\n3. **Test before commit**: Run pytest to ensure tests pass\n4. **If translatable strings change**: sync Babel artifacts using the commands in `babel.cfg`\n   `pybabel extract -F babel.cfg --input-dirs rqalpha/ -o messages.pot`\n   `pybabel update -i messages.pot -d rqalpha/utils/translations`\n   update `rqalpha/utils/translations/zh_Hans_CN/LC_MESSAGES/messages.po` as needed, then run\n   `pybabel compile -d rqalpha/utils/translations`\n\n## Key Architecture Points\n\n- **Environment singleton**: Access via `Environment.get_instance()` - central registry for all components\n- **Event-driven**: Mods subscribe to events (BAR, TICK, BEFORE_TRADING, etc.)\n- **Mod system**: Extensibility through `AbstractMod` interface\n- **Data bundle**: HDF5 format stored in `~/.rqalpha/bundle/`\n- **Config hierarchy**: CLI args > strategy `__config__` > config file > defaults\n\n## Detailed Documentation\n\nFor detailed information, see:\n- **Architecture**: `docs/claude/architecture.md` - Core components and system design\n- **Strategy Writing**: `docs/claude/strategy-guide.md` - How to write strategies with API reference\n- **Bug Reproduction**: `docs/claude/bug-reproduction.md` - Writing backtests to reproduce bugs\n- **Development**: `docs/claude/development.md` - Development guidelines and debugging\n\nOfficial documentation:\n- Tutorial: `docs/source/intro/tutorial.rst`\n- API Reference: `docs/source/api/base_api.rst`\n- Examples: `docs/source/intro/examples.rst`\n"},"files":{"CLAUDE.md":"# CLAUDE.md\n\nRQAlpha is an algorithmic trading system for quantitative trading with backtesting and live trading capabilities.\n\n**License**: Non-commercial use only (Apache 2.0). Commercial use requires authorization from Ricequant.\n\n## Quick Commands\n\n```bash\n# Run backtest\nrqalpha run -f strategy.py -s 2014-01-01 -e 2016-01-01 --account stock 100000\n\n# With RQData connection\nrqalpha run --rqdatac-uri tcp://user:password@host:port -f strategy.py -s 2014-01-01 -e 2016-01-01 --account stock 100000\n\n# Download bundle data\nrqalpha download-bundle\n\n# Update bundle\nrqalpha update-bundle --rqdatac-uri tcp://user:password@host:port\n\n# Generate examples\nrqalpha examples -d ./examples\n\n# Run tests\npytest\npytest tests/unittest/\npytest tests/integration_tests/\n```\n\n## Project-Specific Rules\n\n### When Writing Strategies\n\n1. **Always consult documentation first**: Read `docs/source/intro/tutorial.rst` and `docs/source/api/base_api.rst` before writing strategies\n2. **Use correct API signatures**: Check `docs/source/api/base_api.rst` for function parameters and return types\n3. **Follow strategy lifecycle**: Implement `init()`, `before_trading()`, `handle_bar()`, `after_trading()` in correct order\n4. **Stock code format**: Always use format like \"000001.XSHE\" (code + exchange)\n5. **Date format**: Use 'YYYY-MM-DD' format for dates\n\n### When Debugging/Testing\n\n1. **Write minimal reproducible examples**: Create smallest possible strategy that reproduces the bug\n2. **Use logger, not print**: Use `logger.info()` instead of `print()` in strategies\n3. **Add assertions**: Verify expected behavior with assertions in test code\n4. **Short date ranges**: Use 1-3 month ranges for faster iteration during testing\n\n### Code Modifications\n\n1. **Chinese comments OK**: Domain-specific logic can use Chinese comments\n2. **Follow PEP 8**: Standard Python style guide\n3. **Test before commit**: Run pytest to ensure tests pass\n4. **If translatable strings change**: sync Babel artifacts using the commands in `babel.cfg`\n   `pybabel extract -F babel.cfg --input-dirs rqalpha/ -o messages.pot`\n   `pybabel update -i messages.pot -d rqalpha/utils/translations`\n   update `rqalpha/utils/translations/zh_Hans_CN/LC_MESSAGES/messages.po` as needed, then run\n   `pybabel compile -d rqalpha/utils/translations`\n\n## Key Architecture Points\n\n- **Environment singleton**: Access via `Environment.get_instance()` - central registry for all components\n- **Event-driven**: Mods subscribe to events (BAR, TICK, BEFORE_TRADING, etc.)\n- **Mod system**: Extensibility through `AbstractMod` interface\n- **Data bundle**: HDF5 format stored in `~/.rqalpha/bundle/`\n- **Config hierarchy**: CLI args > strategy `__config__` > config file > defaults\n\n## Detailed Documentation\n\nFor detailed information, see:\n- **Architecture**: `docs/claude/architecture.md` - Core components and system design\n- **Strategy Writing**: `docs/claude/strategy-guide.md` - How to write strategies with API reference\n- **Bug Reproduction**: `docs/claude/bug-reproduction.md` - Writing backtests to reproduce bugs\n- **Development**: `docs/claude/development.md` - Development guidelines and debugging\n\nOfficial documentation:\n- Tutorial: `docs/source/intro/tutorial.rst`\n- API Reference: `docs/source/api/base_api.rst`\n- Examples: `docs/source/intro/examples.rst`\n"},"items":[{"name":"CLAUDE.md","path":"CLAUDE.md","title":"CLAUDE.md","content":"# CLAUDE.md\n\nRQAlpha is an algorithmic trading system for quantitative trading with backtesting and live trading capabilities.\n\n**License**: Non-commercial use only (Apache 2.0). Commercial use requires authorization from Ricequant.\n\n## Quick Commands\n\n```bash\n# Run backtest\nrqalpha run -f strategy.py -s 2014-01-01 -e 2016-01-01 --account stock 100000\n\n# With RQData connection\nrqalpha run --rqdatac-uri tcp://user:password@host:port -f strategy.py -s 2014-01-01 -e 2016-01-01 --account stock 100000\n\n# Download bundle data\nrqalpha download-bundle\n\n# Update bundle\nrqalpha update-bundle --rqdatac-uri tcp://user:password@host:port\n\n# Generate examples\nrqalpha examples -d ./examples\n\n# Run tests\npytest\npytest tests/unittest/\npytest tests/integration_tests/\n```\n\n## Project-Specific Rules\n\n### When Writing Strategies\n\n1. **Always consult documentation first**: Read `docs/source/intro/tutorial.rst` and `docs/source/api/base_api.rst` before writing strategies\n2. **Use correct API signatures**: Check `docs/source/api/base_api.rst` for function parameters and return types\n3. **Follow strategy lifecycle**: Implement `init()`, `before_trading()`, `handle_bar()`, `after_trading()` in correct order\n4. **Stock code format**: Always use format like \"000001.XSHE\" (code + exchange)\n5. **Date format**: Use 'YYYY-MM-DD' format for dates\n\n### When Debugging/Testing\n\n1. **Write minimal reproducible examples**: Create smallest possible strategy that reproduces the bug\n2. **Use logger, not print**: Use `logger.info()` instead of `print()` in strategies\n3. **Add assertions**: Verify expected behavior with assertions in test code\n4. **Short date ranges**: Use 1-3 month ranges for faster iteration during testing\n\n### Code Modifications\n\n1. **Chinese comments OK**: Domain-specific logic can use Chinese comments\n2. **Follow PEP 8**: Standard Python style guide\n3. **Test before commit**: Run pytest to ensure tests pass\n4. **If translatable strings change**: sync Babel artifacts using the commands in `babel.cfg`\n   `pybabel extract -F babel.cfg --input-dirs rqalpha/ -o messages.pot`\n   `pybabel update -i messages.pot -d rqalpha/utils/translations`\n   update `rqalpha/utils/translations/zh_Hans_CN/LC_MESSAGES/messages.po` as needed, then run\n   `pybabel compile -d rqalpha/utils/translations`\n\n## Key Architecture Points\n\n- **Environment singleton**: Access via `Environment.get_instance()` - central registry for all components\n- **Event-driven**: Mods subscribe to events (BAR, TICK, BEFORE_TRADING, etc.)\n- **Mod system**: Extensibility through `AbstractMod` interface\n- **Data bundle**: HDF5 format stored in `~/.rqalpha/bundle/`\n- **Config hierarchy**: CLI args > strategy `__config__` > config file > defaults\n\n## Detailed Documentation\n\nFor detailed information, see:\n- **Architecture**: `docs/claude/architecture.md` - Core components and system design\n- **Strategy Writing**: `docs/claude/strategy-guide.md` - How to write strategies with API reference\n- **Bug Reproduction**: `docs/claude/bug-reproduction.md` - Writing backtests to reproduce bugs\n- **Development**: `docs/claude/development.md` - Development guidelines and debugging\n\nOfficial documentation:\n- Tutorial: `docs/source/intro/tutorial.rst`\n- API Reference: `docs/source/api/base_api.rst`\n- Examples: `docs/source/intro/examples.rst`\n","category":"root","tokens":828}]}