Skip to content

Strategy Repository Guide

The proprietary trading strategies are maintained in a separate repository for IP protection.

Repository Location

# GitHub
git@github.com:tradai-bot/tradai-strategies.git

# Clone as sibling to tradai-uv
cd ..
git clone git@github.com:tradai-bot/tradai-strategies.git

Why Separate?

  1. IP Protection: Strategy code is proprietary and access-controlled
  2. Independent Versioning: Each strategy has its own version lifecycle
  3. Deployment Isolation: Strategies are deployed as Docker containers
  4. Security: Platform team doesn't need access to strategy internals

Relationship with tradai-uv

flowchart LR
    subgraph platform ["tradai-uv (Platform)"]
        lib["libs/tradai-strategy"]
        svc["services/strategy-service"]
        cli["cli/tradai"]
    end
    subgraph strategies ["tradai-strategies (Strategies)"]
        strat["Strategy implementations"]
    end
    lib -->|Published to CodeArtifact| strat
    svc -->|Executes strategy containers| strat
    cli -->|CLI commands work with both| strat

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

  1. Create: just new-interactive
  2. Develop: Edit src/<strategyname>/strategy.py
  3. Test: just test my-strategy
  4. Backtest: just backtest-full my-strategy
  5. Release: just release my-strategy 1.0.0
  6. Register: Tag triggers CI → Docker → ECR → MLflow
  7. Stage: tradai strategy stage MyStrategy --version 1
  8. 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):

Stage Trigger Actions
PR Pull Request Lint, Test, Smoke Backtest
Main Merge Same as PR
Release Tag *-v* Full Backtest, Docker, ECR, MLflow

Note: GitHub Actions handles all CI/CD for this repository.

See Also