whatisgithub

What is stock_strategy_lab?

adennng/stock_strategy_lab — explained in plain English

Analysis updated 2026-05-18

14PythonAudience · researcherComplexity · 4/5Setup · hard

In one sentence

A Python research workbench where layered AI agents write, backtest, and refine trading strategies for Chinese A-share stocks, ETFs, and indices.

Mindmap

mindmap
  root((stock_strategy_lab))
    What it does
      AI trading research
      Strategy backtesting
      Iterative refinement
    Tech stack
      Python
      MiniQMT
      xtquant
    Use cases
      Signal generation
      Portfolio allocation
      Strategy research
    Audience
      Quant researchers
      Traders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Have an AI agent research and backtest buy or sell timing signals for a single stock.

USE CASE 2

Let a budget-layer agent decide how to allocate capital across a pool of assets.

USE CASE 3

Chain signal, budget, and portfolio agents together into a complete automated research pipeline.

What is it built with?

PythonMiniQMTxtquant

How does it compare?

adennng/stock_strategy_lab0c33/agentic-aialbertusreza/pr-pilot
Stars141414
LanguagePythonPythonPython
Setup difficultyhardhardeasy
Complexity4/54/52/5
Audienceresearcherdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Data capabilities rely on MiniQMT and xtquant, which mainly run on Windows, plus an OpenAI-compatible API key.

So what is it?

Stock Strategy Lab is a Python-based research workbench for quantitative trading, designed for studying A-share stocks (Chinese domestic equity market), ETFs (exchange-traded funds, baskets of assets you can buy and sell like a stock), and market indices. Rather than offering fixed pre-built strategies, the tool lets AI agents explore, write, backtest (test against historical data), and iteratively refine trading strategies through a closed loop of trial and improvement. The system is organized into three layers of AI agents. The Signal Layer agent focuses on a single asset and tries to answer questions like: when should this asset be bought, in what quantity, and when should it be sold? The Budget Layer agent works at the portfolio level and determines how capital should be divided across a pool of assets. The Portfolio Layer agent fuses the two by combining signal-layer timing decisions with budget-layer allocation logic into a final tradeable strategy. Each layer can run independently or be chained together to form a complete research pipeline. All three agents keep session memory, they track which strategies have been tried and what to try next, and allow the user to intervene at any point to change preferences, adjust risk limits, or steer the direction of exploration. The command-line interface supports saving and resuming research sessions. The tool is written in Python and requires Python 3.11 or later. Data capabilities rely on MiniQMT and xtquant, which are mainly available in a Windows environment. It supports plugging in OpenAI-compatible language model APIs, with DeepSeek and Moonshot/Kimi listed as options in the configuration.

Copy-paste prompts

Prompt 1
Explain how the Signal Layer, Budget Layer, and Portfolio Layer agents work together in this tool.
Prompt 2
Help me configure this tool to research trading strategies for a specific A-share ETF.
Prompt 3
Walk me through saving and resuming a research session in this command-line tool.

Frequently asked questions

What is stock_strategy_lab?

A Python research workbench where layered AI agents write, backtest, and refine trading strategies for Chinese A-share stocks, ETFs, and indices.

What language is stock_strategy_lab written in?

Mainly Python. The stack also includes Python, MiniQMT, xtquant.

How hard is stock_strategy_lab to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is stock_strategy_lab for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.