Fundamentals 2 min read

How to Use Python to Retrieve A‑Share Market Data and Control Positions for Quantitative Trading

This article explains four practical Python methods—Pandas_datareader, yfinance, Tushare, and JoinQuant—to fetch A‑share market data and manage trading positions, while also providing QR‑code links to free Python learning resources.

Python Programming Learning Circle
Python Programming Learning Circle
Python Programming Learning Circle
How to Use Python to Retrieve A‑Share Market Data and Control Positions for Quantitative Trading

Python is widely used for quantitative trading, and this article introduces four ways to obtain A‑share market data using Python.

Pandas_datareader

The simplest method uses Pandas_datareader to fetch data such as Yahoo finance (note that Yahoo services are unavailable in mainland China after 2021‑11‑01).

yfinance

Another option is the yfinance library, which provides similar functionality with an easy‑to‑use interface.

Tushare

For more comprehensive Chinese market data, the Tushare API can be used, though full features may require a paid token.

JoinQuant

The final approach leverages the JoinQuant platform, allowing data retrieval via the get_price function without installing additional packages.

The article also includes QR codes and links to a free Python public course and additional learning resources.

Data Retrievalquantitative-tradingpandas_datareaderyfinanceJoinQuanttushare
Python Programming Learning Circle
Written by

Python Programming Learning Circle

A global community of Chinese Python developers offering technical articles, columns, original video tutorials, and problem sets. Topics include web full‑stack development, web scraping, data analysis, natural language processing, image processing, machine learning, automated testing, DevOps automation, and big data.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.