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
Release history Release notifications | RSS feed
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.4.tar.gz
(41.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
sixtysix-0.0.4-py3-none-any.whl
(47.3 kB
view details)
File details
Details for the file sixtysix-0.0.4.tar.gz.
File metadata
- Download URL: sixtysix-0.0.4.tar.gz
- Upload date:
- Size: 41.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6af0262d31443f2fc3cebffee62d5cf7852e14f60cfe235ece7c374eefa92874
|
|
| MD5 |
c6f20c1e87d79de58d9d058f251287ba
|
|
| BLAKE2b-256 |
c771169d4afe47e9c3b8ba2a873bc85c6f75b45a7f8f4499999b5ed18f533d03
|
File details
Details for the file sixtysix-0.0.4-py3-none-any.whl.
File metadata
- Download URL: sixtysix-0.0.4-py3-none-any.whl
- Upload date:
- Size: 47.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22a89f2607c8ecf29dfdc614dd30f7587eec595292440f38e1b9fe438cadc727
|
|
| MD5 |
117a16f7cb754ac1a66c96b0d73032ab
|
|
| BLAKE2b-256 |
9ecc0a986775536153d9c8dfd1d0090a978fbd18b884a638f4ffac08723f0463
|