# 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

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.infoway.io/en-docs/sdk-and-tools/quant-starter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
