SigTech Python SDK
Project description
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 collection of historical performance data facilitating accurate backtesting. Explore the SigTech API data catalog to see the library of instruments available.
Installation
pip install sigtech
Requirements
- Python 3.6+
Getting started with SigTech Python SDK
Authentication
Note!
We are currently performing closed beta testing. Sign up to our waitlist to be notified of the public release and for a chance to use all API functionality for free as one of our beta users! When we're ready to welcome you, we'll send an email with instructions for creating your SigTech account.
- Create a SigTech account following the instructions in your welcome email.
- Generate an API key using our dashboard.
- 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 variableSIGTECH_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:-4",
)
# Retrieve the strategy history
print(es_future.history())
Next steps
- Learn more about the parameters used in the above strategy and how you can tailor them for you own use by reading the documentation for our Rolling futures strategy endpoint.
- See how our Python SDK can help you quickly create and backtest more complex, real-world trading strategies by folowing the detailed walkthroughs in the Examples folder.
Tip!
If you require more low level access to the API, our SDK also offers a Client based method of interaction. See Client based interaction for more information.
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. See Logging in Python for a useful summary of the logging
library's capabilities.
API Documentation
For detailed information about the SigTech API, please refer to our official API user guide and our interactive API reference guide.
Contributing to the SigTech Python SDK
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.
Support
If you encounter any issues or have any questions regarding our API or SDK, you can reach out to us via our Discord channel or Twitter.
License
The SigTech Python SDK is released under the MIT License.
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.