Strategy Repository Guide¶
The proprietary trading strategies are maintained in a separate repository for IP protection.
Repository Location¶
# GitHub (primary)
git@github.com:tradai-bot/tradai-strategies.git
# Bitbucket (mirror)
git@bitbucket.org:tradai/tradai-strategies.git
# Clone as sibling to tradai-uv
cd ..
git clone git@github.com:tradai-bot/tradai-strategies.git
Why Separate?¶
- IP Protection: Strategy code is proprietary and access-controlled
- Independent Versioning: Each strategy has its own version lifecycle
- Deployment Isolation: Strategies are deployed as Docker containers
- Security: Platform team doesn't need access to strategy internals
Relationship with tradai-uv¶
tradai-uv (Platform) tradai-strategies (Strategies)
├── libs/tradai-strategy/ --> Dependencies from CodeArtifact
├── services/strategy-service --> Executes strategy containers
└── cli/tradai --> CLI commands work with both
Quick Start¶
# Clone the strategies repo (requires access)
git clone git@github.com:tradai-bot/tradai-strategies.git
cd tradai-strategies
# Setup
just setup
# Create new strategy
just new-interactive
# Test strategy
just test my-strategy
# Full release
just release my-strategy 1.0.0
Available Commands¶
| Command | Description |
|---|---|
just new-interactive | Create strategy (interactive) |
just new Name | Create strategy (quick) |
just new-ml Name | Create ML-enabled strategy |
just test strategy | Run tests |
just lint strategy | Lint + typecheck |
just backtest-smoke strategy | 30-day backtest |
just release strategy version | Full release pipeline |
Strategy Lifecycle¶
- Create:
just new-interactive - Develop: Edit
src/<strategyname>/strategy.py - Test:
just test my-strategy - Backtest:
just backtest-full my-strategy - Release:
just release my-strategy 1.0.0 - Register: Tag triggers CI → Docker → ECR → MLflow
- Stage:
tradai strategy stage MyStrategy --version 1 - Promote:
tradai strategy promote MyStrategy --version 1
Dependencies¶
Strategies depend on tradai-strategy from AWS CodeArtifact:
# strategies/my-strategy/pyproject.toml
dependencies = [
"tradai-strategy>=1.0.0", # From CodeArtifact
"freqtrade>=2025.6",
"ta-lib>=0.4.0",
]
Never import directly from tradai-uv. Always use the published package.
CI/CD Pipeline¶
The strategies repo has its own CI/CD pipeline (GitHub Actions + Bitbucket Pipelines):
| Stage | Trigger | Actions |
|---|---|---|
| PR | Pull Request | Lint, Test, Smoke Backtest |
| Main | Merge | Same as PR |
| Release | Tag *-v* | Full Backtest, Docker, ECR, MLflow |
Note: Both GitHub Actions and Bitbucket Pipelines are configured for redundancy.