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.3.tar.gz (39.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.3-py3-none-any.whl (45.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sixtysix-0.0.3.tar.gz
  • Upload date:
  • Size: 39.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.3.tar.gz
Algorithm Hash digest
SHA256 c41665fd8a9f731a87f95e515ff360057a9e8e559112999e340dfced26dbc84d
MD5 2724a1abac5cc583489fc08923670011
BLAKE2b-256 7ce130165cdb44f47e6955b4daf2452c35fdf2a9c7d5cd88054570aa4e65a5d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sixtysix-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 45.1 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 31de2196c3764d9869ee99425328c80d5ca5633f1dc777ab304557d0bd907cc0
MD5 0853f9d9011ae0d8c8cb09081ea223f6
BLAKE2b-256 dca35c0288f3a180d40e1fb2e2fa8770003b11359d37d88f6262e711a33bee7d

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