ctpbee  by ctpbee

Python framework for futures trading and backtesting

Created 6 years ago
996 stars

Top 36.9% on SourcePulse

GitHubView on GitHub
Project Summary

A lightweight, yet powerful, futures trading framework designed for developers. CTPbee simplifies the integration and use of the CTP API, enabling rapid development of trading strategies, backtesting, and live trading. It targets individual traders and developers looking for a streamlined, extensible platform to build and deploy quantitative trading systems.

How It Works

CTPbee provides a micro-core trading engine with encapsulated APIs, drawing inspiration from vnpy's trading interfaces. It focuses on simplifying installation and offering a quick path to implementing trading functionalities. The framework supports a plugin system (ToolRegister) for data access and trigger mechanisms, allowing for customization and extension. It handles core trading operations, position management, P/L calculations, and integrates with multiple trading interfaces like CTP, CTP Mini, Rohon, and OpenCTP.

Quick Start & Requirements

  • Primary install: pip3 install ctpbee
  • Prerequisites: Python 3.6+. For Linux, bee init-locale --password xxxxx is required (needs sudo). macOS users may need to install ctpbee_api from source.
  • Supported Systems: Linux, Windows, MacOS.
  • Documentation: Links to official documentation and a forum are mentioned but not provided. Example backtesting and OpenCTP integration tutorials are available within the repository.

Highlighted Details

  • Simplified order placement, position, and P/L calculation.
  • Supports multi-period and multi-contract backtesting with report generation.
  • Real-time market data and K-line generation capabilities.
  • Extensible plugin system for custom functionalities.
  • Compatibility with multiple trading interfaces including CTP, CTP Mini, Rohon, and OpenCTP.
  • Automatic operation/maintenance features.

Maintenance & Community

Project maintenance is irregular, as it is primarily a hobby project. Users encountering issues are directed to submit issues on GitHub or search existing ones. Technical support can be sought via email at somewheve@gmail.com. Contributions from developers are welcomed.

Licensing & Compatibility

Licensed under the MIT License. This permissive license generally allows for commercial use and integration into closed-source projects without significant restrictions.

Limitations & Caveats

The project does not provide direct historical data access services. Maintenance is irregular, and users are advised to use the code with caution, as the author disclaims responsibility for any usage consequences. macOS users require manual installation of ctpbee_api from source.

Health Check
Last Commit

2 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
3
Issues (30d)
0
Star History
9 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.