Skip to main content

Framework for building trading strategies and technical indicators

Project description

SixtySix

Python SDK and CLI for building and deploying automated trading strategies on sixtysix.pro.

The SDK lets you write strategies and indicators in Python — they are picked up automatically by the backend, which handles data feeds, backtesting, live execution, and the charting UI.

The CLI manages the backend: pull the Docker image, authenticate, run backtests from the terminal, or deploy to a cloud VPS with one command.

Full documentation: sixtysix.pro/docs


Install

pip install "sixtysix[cli]"

Quick Start — Strategy

from sixtysix import strategy, computed, param, persistent, Line

@strategy(name='sma_crossover', display_name='SMA Crossover', category='Trend Following')
class SMACrossover:
    fast = param.number(default=20, min=5, max=100)
    slow = param.number(default=50, min=10, max=200)

    @computed
    def fast_sma(self, df):
        return df['close'].rolling(self.fast).mean()

    @computed
    def slow_sma(self, df):
        return df['close'].rolling(self.slow).mean()

    def plot(self, df):
        return [
            Line(y=self.fast_sma, color='#3b82f6', legend='Fast'),
            Line(y=self.slow_sma, color='#f97316', legend='Slow'),
        ]

    def on_bar(self, df):
        if self.position.is_flat and self.ta.crossover(self.fast_sma, self.slow_sma):
            return self.buy(reason='Golden cross')
        if self.position.is_long and self.ta.crossunder(self.fast_sma, self.slow_sma):
            return self.close(reason='Death cross')

Quick Start — Indicator

from sixtysix import indicator, param, Line, Fill

@indicator(name='bollinger_bands', display_name='Bollinger Bands', type='overlay')
class BollingerBands:
    period = param.number(default=20, min=2, max=500)
    std    = param.number(default=2.0, min=0.1, max=5.0, step=0.1)
    color  = param.color(default='#3b82f6')

    def plot(self, df):
        mid   = df['close'].rolling(self.period).mean()
        sigma = df['close'].rolling(self.period).std()
        upper = mid + self.std * sigma
        lower = mid - self.std * sigma
        return [
            Line(y=upper, color=self.color, line_dash='dashed'),
            Line(y=mid,   color=self.color),
            Line(y=lower, color=self.color, line_dash='dashed'),
            Fill(y1=upper, y2=lower, color=self.color, alpha=0.05),
        ]

For the full SDK reference — parameters, @computed, multi-timeframe, persistent(), plot components, signals — see sixtysix.pro/docs.


CLI

Authentication

sixtysix login

Opens a browser window. After sign-in the refresh token is stored at ~/.sixtysix/config.json.

Local Docker backend

sixtysix start          # Pull latest image and start container
sixtysix stop           # Stop and remove container (data preserved)
sixtysix restart        # Restart container
sixtysix status         # Show container status and uptime
sixtysix logs           # Tail logs  (-n 100  --follow / -f)
sixtysix update         # Pull latest image and replace container

Backtesting

sixtysix backtest accounts                            # List your broker accounts and their aliases
sixtysix backtest strategies                          # List available strategies
sixtysix backtest params sma_crossover                # Show configurable params

sixtysix backtest run -s sma_crossover -S AAPL,TSLA -t 1h -a "My IBKR"
sixtysix backtest run -s sma_crossover -S SPY -t 1d -d 730 --capital 50000 -a "Alpaca Paper"
sixtysix backtest run -s ha_pullback -S AAPL -t 1h --params '{"atr_mult": 2.0}' -a 3
Flag Default Description
-s required Strategy name
-S required Comma-separated symbols
-a / --account required Account alias or numeric account ID (see backtest accounts)
-t 1h Timeframe (1m 5m 15m 30m 1h 4h 1d 1w)
-d 365 Days of historical data
--capital 10000 Initial capital
--position-size 0.95 Fraction of equity per trade
--no-save Don't persist results to database
--json Output results as JSON

Results are saved to the database and visible in the UI at /backtest.

Cloud deployment (Hetzner)

sixtysix cloud deploy   # Interactive wizard: creates VPS, installs Docker, starts backend
sixtysix cloud status   # Show server IP, type, and running status
sixtysix cloud logs     # Stream logs from the remote container  (-f to follow)
sixtysix cloud restart  # Restart container on remote server
sixtysix cloud update   # Pull latest image on remote server
sixtysix cloud ssh      # Open SSH session
sixtysix cloud destroy  # Delete the server (irreversible)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sixtysix-0.0.6.tar.gz (55.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sixtysix-0.0.6-py3-none-any.whl (64.7 kB view details)

Uploaded Python 3

File details

Details for the file sixtysix-0.0.6.tar.gz.

File metadata

  • Download URL: sixtysix-0.0.6.tar.gz
  • Upload date:
  • Size: 55.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for sixtysix-0.0.6.tar.gz
Algorithm Hash digest
SHA256 89c3d6fe89168554f5eb0d195f7684ea64f5f8c5c5ae9c671def8adbe21a6b15
MD5 a12ce7d38d77b7ab68dcd370bb090fcc
BLAKE2b-256 2ff909a26df1187680afaf7708093c97c6230881f36b98f9b2d0fb36f276e05c

See more details on using hashes here.

File details

Details for the file sixtysix-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: sixtysix-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 64.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for sixtysix-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 574fb033dfda40622f4f7b2800c1b5f32308496f4181219d77e7358fbc563b9b
MD5 bbacc17a9733063c9ac2deb2fccead6c
BLAKE2b-256 6e3e5109a7e3a0c6987ef0007c3d2a8fb1cbbf9e20dfc106e570534d9db19e92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page