Package: sigtech
SigTech Python SDKThe 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 FeaturesProvides 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 theSigTech API data catalogto see the library of instruments available.InstallationpipinstallsigtechRequirementsPython 3.6+Getting started with SigTech Python SDKAuthenticationSign-upfor our API.Generate an API key using ourdashboard.Secure your API key and save it as a global environment variable by following our instructionshere.Creating your first strategyOur 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 APIimportsigtech.apiassig# Initialize your sessionsig.init()# Create a Rolling Future Strategyes_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 historyprint(es_future.history())Next stepsLearn more about theRolling futures strategyendpoint in our API reference guide.Follow some of ourexamplesto see how you can replicate and backtest more complex, real-world trading strategies.Google ColabWe 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-worldexamplesin Jupyter Notebook format (.ipynb). All you need to follow along is a SigTech API key.LoggingLogs down to thedebuglog level are available for all API requests. They can be accessed using the Pythonlogginglibrary.importlogginglogging.basicConfig(level=logging.DEBUG)For more information, please refer to thelogginglibrary'sdocumentation. SeeLogging in Pythonfor a useful summary of thelogginglibrary's capabilities.API DocumentationFor detailed information about the SigTech API, please refer to our officialAPI user guideand our interactiveAPI reference guide.Contributing to the SigTech Python SDKWe 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 theContribution guidelines.Please remember that all contributors are expected to behave appropriately and abide by ourCode of conduct.Reporting security issuesIf you believe you have discovered a security vulnerability in our repository please report it to us immediately following the instructionshere.Attention!Please follow the instructions detailed.Do notpublicly disclose the vulnerability in a Github Issue or on a public forum such as Discord or Twitter.SupportIf you encounter any issues or have any questions regarding our API or SDK, you can reach out to us via ourDiscordorTwitter.LicenseThe SigTech Python SDK is released under theMIT License.