Build and verify A-share strategies on a local quant workbench
Imagine checking A-share market prices and financial data in your browser, validating past returns with your own strategies, and receiving immediate alerts when anomalies appear. TSP bundles this process into a single local application. It does not rely on external cloud services, stores data on your computer, and uses AI to handle complex data queries and strategy generation interactively.
Local-first data processing structure
TSP stores all data in the user's local environment in Parquet file format. There is no need to install an external database server, and it runs with a single Docker container. Data sources are designed as plugins, allowing you to freely switch between various providers such as TickFlow or fuyao. The internal logic is separated so that indicator calculations and backtesting criteria remain consistent even if the data source changes. This is a core design feature that ensures existing analysis results do not fluctuate when the data provider is changed.
Flow from strategy creation to backtesting
Users can create strategies by writing Python code directly or by instructing the AI. Generated strategies scan the entire market's stocks at millisecond intervals to filter stocks that meet specific conditions. Backtesting is designed to follow the same path as actual trading, reflecting the T+1 system, fees, and slippage. Specifically, it restricts usage to data based on the current day to prevent the 'look-ahead bias' problem. It also automates the process of validating with out-of-sample data to prevent parameter overfitting.
AI assistant and open API
The built-in AI chat assistant answers questions by calling 21 query tools and 5 execution tools. The data query process is displayed transparently so users can verify what data was retrieved. Write operations, such as strategy creation or backtesting execution, are designed to require user confirmation. Additionally, it provides 65 API endpoints and an MCP server, allowing external programs or other AI clients to directly call TSP's functions. It uses token-based permission management to finely control data access.
Execution environment and considerations
If Docker is installed, it can be run immediately with a one-line command, and desktop clients for Windows and macOS are also provided. Memory usage is a major constraint, occupying approximately 1.3GB of RAM in the default configuration. On low-spec servers with 2GB or less, memory shortages may occur during backtesting or complex optimization tasks, so setting adjustments such as reducing the number of parallel threads are necessary. This tool does not provide investment advice or trading signals and is explicitly stated to be for learning and research purposes only. Some real-time data features may be limited if data source API keys are missing.