> For the complete documentation index, see [llms.txt](https://docs.infoway.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infoway.io/en-docs/sdk-and-tools/quant-starter.md).

# Quant Starter Examples

### Overview

Educational quantitative trading examples for beginners, featuring 6 progressive Python examples and an interactive Jupyter Notebook tutorial. All examples are built on the Infoway Python SDK.

| Item         | Details                                                                                   |
| ------------ | ----------------------------------------------------------------------------------------- |
| Python       | 3.9+                                                                                      |
| Dependencies | `infoway-sdk`, `pandas`, `matplotlib`, `jupyter`                                          |
| GitHub       | [infoway-api/infoway-quant-starter](https://github.com/infoway-api/infoway-quant-starter) |

### Installation

```bash
git clone https://github.com/infoway-api/infoway-quant-starter.git
cd infoway-quant-starter
pip install -r requirements.txt
```

### Examples

#### 01 — Real-time Trade Monitor

```bash
python examples/01_realtime_monitor.py
```

Real-time trade data via WebSocket. Learn:

* WebSocket connection and event callbacks
* Real-time data stream processing
* Terminal live display

#### 02 — K-line Data Download

```bash
python examples/02_kline_download.py
```

Batch download K-line history to CSV. Learn:

* REST API batch requests
* Data cleaning and formatting
* CSV file export

#### 03 — Moving Average Crossover Strategy

```bash
python examples/03_moving_average.py
```

Classic dual MA crossover backtest. Learn:

* Moving average calculation
* Trade signal generation
* Return and max drawdown calculation
* matplotlib charting

#### 04 — Crypto Arbitrage Scanner

```bash
python examples/04_crypto_arbitrage.py
```

Cross-currency spread scanner. Learn:

* Multi-symbol monitoring
* Spread calculation and arbitrage detection
* Real-time data comparison

#### 05 — Market Heatmap

```bash
python examples/05_market_heatmap.py
```

Sector heatmap visualization. Learn:

* Sector data retrieval and processing
* Terminal color heatmap display
* matplotlib heatmap rendering

#### 06 — Multi-Market Scanner

```bash
python examples/06_multi_market_scanner.py
```

Multi-market temperature anomaly detection. Learn:

* Multi-market parallel data fetching
* Temperature / sentiment indicator analysis
* Anomaly signal identification

#### Jupyter Notebook Tutorial

```bash
jupyter notebook notebooks/getting_started.ipynb
```

Interactive tutorial covering:

* SDK installation and client creation
* Real-time trade data retrieval
* K-line queries and chart plotting
* Market temperature analysis

***
