Skip to main content

Framework for building trading strategies and technical indicators

Project description

SixtySix

Framework for building trading strategies and technical indicators.

Installation

pip install sixtysix

Quick Start — Strategy

from sixtysix import strategy, computed, param, Line

@strategy(name='sma_crossover', display_name='SMA Crossover')
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(df), color='#3b82f6'),
            Line(y=self.slow_sma(df), color='#f97316'),
        ]

    def on_bar(self, df):
        if self.ta.crossover(self.fast_sma(df), self.slow_sma(df)):
            return self.buy()

Quick Start — Indicator

from sixtysix import indicator, param, Line

@indicator(name='sma', display_name='SMA', type='overlay')
class SMA:
    period = param.number(default=20, min=1, max=500)
    color = param.color(default='#2962ff')

    def plot(self, df):
        sma = df['close'].rolling(self.period).mean()
        return [Line(y=sma, color=self.color, line_width=2)]

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.2.tar.gz (36.4 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.2-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sixtysix-0.0.2.tar.gz
  • Upload date:
  • Size: 36.4 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.2.tar.gz
Algorithm Hash digest
SHA256 ee23d668c59e0d879896056ff03106b1c99d1391c2a1681a805cde1c2ec81c33
MD5 7bc2b17fabed8a44f7412092130ea02b
BLAKE2b-256 1b6618fa38eb22589288ab7aaa085e2b38428cb59ca60fabd2228ff3955a9bf4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sixtysix-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 41.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e90dec2e02cef8ef5348f88293df92316dbcd1f6a8abd4398249ff8c1e26c284
MD5 5bb6b16190aabad663fe4dcce0fc5e00
BLAKE2b-256 5067fba0e157180b37f137526ae4f8b38b3d888d416a5da217b46e774b1641d7

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