Content
# Tool List
<div align="center">
<!-- Keep these links. Translations will automatically update with the README. -->
<a href="README_EN.md">English</a> | <a href="README.md">中文</a>
</div>
## Project Introduction
AI-Kline is a Python-based A-share analysis tool that combines traditional technical analysis and artificial intelligence prediction functions. It uses K-line charts, technical indicators, financial data, and news data to conduct comprehensive analysis and prediction of stocks. The tool can:
1. Obtain historical trading data of A-share stocks and calculate various technical indicators
2. Generate professional K-line charts and technical indicator visualization charts
3. Obtain financial data and news information related to stocks
4. Use OpenAI API to analyze integrated data and predict future stock trends
## Features
- **Data Acquisition**: Use AKShare to obtain historical trading data, financial data, and news information of A-share stocks
- **Technical Analysis**: Calculate multiple technical indicators, including MA, MACD, KDJ, RSI, Bollinger Bands, etc.
- **Visualization**: Generate static and interactive K-line charts and technical indicator charts
- **AI Analysis**: Use multimodal AI to analyze stock data and predict future trends
- **Web Interface**: Provide a simple and beautiful web interface for users to input stock codes and view analysis results
- **MCP Server**: Provide MCP Server support, support interaction through LLM, and analyze stocks at any time
## Installation Instructions
### Environmental Requirements
- Python 3.8+
- Dependent packages: see `requirements.txt`
### Installation Steps
1. Clone or download this project to local
2. Install dependent packages
```bash
pip install -r requirements.txt
```
3. Create `.env` file and add API key
```
API_KEY=your_api_key_here
BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
MODEL_NAME=qwen-vl-max
```
> Note: Need to use multimodal model
## Usage
### Command Line Usage
```bash
python main.py --stock_code 000001 --period 1 year --save_path ./output
```
Parameter description:
- `--stock_code`: Stock code, required parameter
- `--period`: Analysis period, optional values: "1 year", "6 months", "3 months", "1 month", default is "1 year"
- `--save_path`: Result save path, default is "./output"
### Web Interface Usage
Start web service:
```bash
python web_app.py
```
Then access http://localhost:5000 in the browser:
1. Input stock code (e.g., 000001) in the form
2. Select analysis period
3. Click "Start Analysis" button
4. Wait for analysis completion and view results
Web interface includes:
- Stock basic information
- K-line chart and technical indicator chart
- AI analysis result text
Page screenshot:

### MCP Server Usage
Start mcp:
```bash
uv run mcp_server.py
```
Then configure in mcp client (streamable-http):
http://localhost:8000/mcp
Cherry-Studio page screenshot:


### Output Results
The program will generate:
1. K-line chart and technical indicator chart (static PNG image and interactive HTML chart)
2. AI analysis result text file
## Project Structure
```
AI-Kline/
├── main.py # Main program entrance
├── web_app.py # Web application entrance
├── requirements.txt # Dependent package list
├── .env # Environment variable configuration (need to create yourself)
├── modules/ # Functional module
│ ├── __init__.py
│ ├── data_fetcher.py # Data acquisition module
│ ├── technical_analyzer.py # Technical analysis module
│ ├── visualizer.py # Visualization module
│ └── ai_analyzer.py # AI analysis module
├── templates/ # Web template directory
│ └── index.html # Home page template
├── static/ # Static resource directory
│ ├── css/ # CSS style
│ │ └── style.css # Custom style
│ └── js/ # JavaScript script
│ └── main.js # Main script
└── output/ # Output result directory (automatically created during runtime)
├── charts/ # Chart directory
└── *_analysis_result.txt # Analysis result file
```
## Communication and Learning

## Precautions
- This tool is only for learning and research, not for any investment advice
- AI analysis results are based on historical data and current information, cannot guarantee the accuracy of future trends
- Please ensure that the Gemini API key is correctly configured before use
- Stock data acquisition depends on AKShare library, may be limited by network and data source
- This project is an open-source project of QuantML, please indicate the source if you reprint or use, commercial use please contact WeChat QuantML
## Disclaimer
The analysis and prediction provided by this tool are for reference only, not for any investment advice. Investment has risks, enter the market need to be cautious. Users are responsible for their own investment decisions.
Connection Info
You Might Also Like
valuecell
Valuecell is a Python project for efficient data management.
hexstrike-ai
HexStrike AI is an AI-powered MCP cybersecurity automation platform with 150+ tools.
Vibe-Trading
Vibe-Trading: Your Personal Trading Agent
bridle
Bridle is a unified config manager for AI coding assistants, allowing...
Baidu Map
Baidu Map MCP Server is an open-source LBS solution with geospatial APIs.
nexus
Govern & Secure your AI