Skip to main content

Bitcoin Dollar-Cost Averaging (DCA) Backtest Framework

Project description

Hypertrial: Bitcoin DCA Strategy Framework

A Bitcoin Dollar-Cost Averaging (DCA) framework for evaluating and comparing algorithmic trading strategies.

Installation

pip install hypertrial

Quick Start

import pandas as pd
from hypertrial import backtest_dynamic_dca, load_data, register_strategy

# Load Bitcoin data (included with the package)
btc_df = load_data()

# Create a simple custom strategy
@register_strategy("my_custom_strategy")
def custom_dca_strategy(df):
    # Strategy logic goes here
    # Return purchase weights for each day
    return weights_df

# Run backtest with your strategy
results = backtest_dynamic_dca(btc_df, strategy_name="my_custom_strategy")

Key Features

  • DCA Strategy Testing: Evaluate Bitcoin dollar-cost averaging strategies
  • Performance Metrics: Analyze strategies using Sats Per Dollar (SPD)
  • Cross-Cycle Analysis: Test strategies across multiple Bitcoin market cycles
  • Visualization Tools: Plot performance metrics and strategy behaviors
  • Security Verification: Security scanning for submitted strategies

Command Line Interface

Hypertrial comes with a built-in CLI:

# List available strategies
hypertrial --list

# Run backtest with a specific strategy
hypertrial --strategy dynamic_dca

# Run backtest for all strategies
hypertrial --backtest-all --output-dir results

Contributing

We welcome contributions! Please visit our GitHub repository for more information.

License

This project is available under the MIT License.

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

hypertrial-0.1.0.tar.gz (762.5 kB view details)

Uploaded Source

Built Distribution

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

hypertrial-0.1.0-py3-none-any.whl (163.6 kB view details)

Uploaded Python 3

File details

Details for the file hypertrial-0.1.0.tar.gz.

File metadata

  • Download URL: hypertrial-0.1.0.tar.gz
  • Upload date:
  • Size: 762.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for hypertrial-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3304f0df1257b3dc6fc007a38b6999c29f8e46746e24efc55d53260980c43740
MD5 f52788fc05590ee5e553550ff7762851
BLAKE2b-256 2b6b3d37eabc06a249d116d051f6f47b3aa637f7c0f8912339757ed07d7dc2a8

See more details on using hashes here.

File details

Details for the file hypertrial-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hypertrial-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 163.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for hypertrial-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8e693970c83202a5f6b555b2d0f6e860817aad1b6e0a5fdefa4cda243baeaef
MD5 db09c7ec1341e9deece422362c3d2a79
BLAKE2b-256 057cb9be102b36a451de0df85339add6636587de35f17fece039d0c084c470d6

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