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.1.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.1-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sixtysix-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 d7a2baef8858ad70c7b5cca88c8d739f6470b5f8bcba9e183b4caf693be5b937
MD5 b20d687ef90d1bc1b208a448e2001b4d
BLAKE2b-256 c617faa1e5121d37e501f9c670826ab70ee9ebbfe6a94554341feedf7f845f1b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sixtysix-0.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1b45e2a8f5358a7bfad4b13f7bf9062961192dd1fbd344d2e6110e5da5e7613
MD5 79da9fa11ff28bd832f0bdc2384fe33e
BLAKE2b-256 4bc6a33f955968ba199a57b7d3ccf3529d666e97418d58d0ca86503b510f04b4

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