Skip to main content

SigTech SDK Banner

 

Docs

Contributors Forks Stargazers Issues MIT License

SigTech Python SDK

The SigTech Python SDK is designed to simplify the usage of the SigTech API for backtesting investment strategies by providing a higher-level, object-oriented method of interfacing with our API. With this SDK, you can easily test and view the performance of historical strategies.

Key Features

  • Provides a higher-level object-based interface for convenient interaction with the SigTech API.
  • Simplifies the creation of advanced trading strategies by providing methods which simulate rolling future strategies, basket strategies, and more.
  • Interfaces with SigTech's historical market data facilitating accurate backtesting. Explore the SigTech API data catalog to see the list of instruments available.

Installation

pip install sigtech

Requirements

  • Python 3.6+

Getting started

Authentication

  1. Generate an API key using our dashboard.
  2. Secure your API key and save it as a global environment variable by following our instructions here.

Creating your first strategy

Our SDK provides convenient wrappers for boilerplate functions that are required to interact with our API. Copy the following code into your IDE and run it to quickly create, backtest, and view the performance of a custom rolling futures strategy.

Note!
The example below will only work if you have saved your API key as the global environment variable SIGTECH_API_KEY.

# Import the SigTech API
import sigtech.api as sig

# Initialize your session
sig.init()

# Create a Rolling Future Strategy
es_future = sig.RollingFutureStrategy(
    currency="USD",
    start_date="2020-01-04",
    contract_code="ES",
    contract_sector="INDEX",
    rolling_rule="front",
    front_offset="-6,-5",
)

# Retrieve the strategy history
print(es_future.history())

Next steps

  1. Follow some of our examples to see how you can replicate and backtest more complex, real-world trading strategies.
  2. Explore the full range of available instruments in the API data catalog.
  3. Explore the full range of endpoints in the API reference.

Google Colab

We understand that getting started with backtesting and evaluating trading strategies can be a daunting task, especially for users new to financial data analysis and Python development. To make the process as seamless as possible, we've prepared a collection of real-world examples in Jupyter Notebook format (.ipynb). All you need to follow along is a SigTech API key.

Logging

Logs down to the debug log level are available for all API requests. They can be accessed using the Python logging library.

import logging
logging.basicConfig(level=logging.DEBUG)

For more information, please refer to the logging library's documentation.

Contributing

We appreciate and encourage your contributions to the SigTech Python SDK! If you are enjoying the SDK, please show your support by starring this repository and sharing it on social media channels.

To contribute an example, provide feedback, report a bug or otherwise bring an issue to our attention regarding this project, please follow the steps outlined in the Contribution guidelines.

Please remember that all contributors are expected to behave appropriately and abide by our Code of conduct.

Security issues

If you believe you have discovered a security vulnerability in our repository please report it to us immediately following the instructions here.

Attention!
Do not publicly disclose the vulnerability in a Github Issue or on a public forum such as X/Twitter.

Support

If you encounter any issues or have any questions regarding our API or SDK, you can reach out to us via email at support@sigtech.com.

License

The SigTech Python SDK is released under the MIT License.

Metadata

Release files for sigtech 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sigtech 0.8.0
File Size Uploaded Provenance Actions
sigtech-0.8.0.tar.gz 32.8 kB Without provenance Details for sigtech-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sigtech 0.8.0
File Interpreter ABI Platform Actions
sigtech-0.8.0-py3-none-any.whl Python 3 none any Details for sigtech-0.8.0-py3-none-any.whl

Total release size: 80.1 kB

Release files / sigtech-0.8.0.tar.gz

Download URL sigtech-0.8.0.tar.gz
Size 32.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9377f65c651c151508745e78c6796dfaea7bad7700e0db5f5baf49f4551513cd
BLAKE2b-256 checksum
How to use checksums
2b3083bfd97d65089410d82d9f832cab2502fb135526a77c10e13ef9005e4a2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.10

Release files / sigtech-0.8.0-py3-none-any.whl

Download URL sigtech-0.8.0-py3-none-any.whl
Size 47.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7afec324cf8ea102a96f10f869a441ba6cb98d2638545b6f7bd0534cbb6e3770
BLAKE2b-256 checksum
How to use checksums
a193209b1a39cc7f205ca61280d845fbb42d2151d31d4a137beaedf87eccecf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.10

Security for sigtech 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page