# AlphaBook Relative Value MCP (`neeenja/alphabook-relative-value`) Actor

Relative-value signal engine as a remote MCP server. Five tools: get_pairs_spread, get_sector_relative_strength, get_relative_momentum, get_valuation_relative, rank_relative_value.

- **URL**: https://apify.com/neeenja/alphabook-relative-value.md
- **Developed by:** [Neeen Ja](https://apify.com/neeenja) (community)
- **Categories:** MCP servers, AI
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 analysis calls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## AlphaBook Relative Value MCP

Relative-value signal engine as a remote MCP server. It gives your agent **relative-value verdicts (spread z-score, relative strength, peer valuation)** — not absolute prices. Five tools cover pairs spread, sector/relative strength, relative momentum, valuation relative and a basket relative-value ranking. Price metrics are pure price-derived; valuation relative uses a free A-share snapshot. No API key. **Not investment advice.**

> **Honest boundary:** the free source gives a valuation *snapshot* only, so valuation relative is a cross-sectional proxy, not a peer percentile. Pairs signals assume mean reversion; structural breaks break the relationship. All outputs carry `NOT_ADVICE`.

### Tools

| Tool | Event | Returns |
|------|-------|---------|
| `get_pairs_spread` | tool-call $0.02 | A/B ratio z-score + pair trade read |
| `get_sector_relative_strength` | tool-call $0.02 | Asset return minus benchmark return (pts) |
| `get_relative_momentum` | tool-call $0.02 | 6-month momentum minus benchmark momentum (pts) |
| `get_valuation_relative` | tool-call $0.02 | Which of two A-shares is cheaper on PE/PB/PS |
| `rank_relative_value` | **screen-call $0.05** | Basket ranked by relative strength vs benchmark |

### Connect (MCP client)

```
https://neeenja--alphabook-relative-value.apify.actor/mcp
Authorization: Bearer <APIFY_TOKEN>
```

POST JSON-RPC: `initialize`, `tools/list`, `tools/call`. Example:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": { "name": "get_pairs_spread", "arguments": { "codeA": "600519", "codeB": "000858" } }
}
```

### Pricing

Pay-per-event. `initialize` and `tools/list` are free. Each analysis call is **$0.02**; a basket relative-value ranking (`rank_relative_value`) is **$0.05** because it scores up to 10 symbols.

### Data sources & honest limits

- **Klines:** Tencent `gtimg.cn` (A/HK/US) and Yahoo (global). Free, no key.
- **Valuation:** East Money datacenter snapshot (A-shares only). Snapshot, no history.
- Missing data → `n/a`, never a fabricated `0`.
- Every output carries a `NOT_ADVICE` disclaimer.

***

## AlphaBook 相对价值 MCP

相对价值信号引擎，以远程 MCP 服务器形式提供。它给 agent 的是 **相对价值判定（价差 z / 相对强弱 / 估值相对）**，而非绝对价格。五个工具覆盖配对价差、相对强度、相对动量、估值相对与篮子相对价值排名。价格指标纯价格派生；估值相对用免费 A 股快照。免费公开数据，无需 API Key。**不构成投资建议。**

> **诚实边界：** 免费源只给估值「快照」，估值相对是横截面近似，非同行分位。配对信号依赖均值回归假设，结构性断裂会令历史关系失效。所有输出带 `NOT_ADVICE`。

### 工具

| 工具 | 计费事件 | 返回 |
|------|----------|------|
| `get_pairs_spread` | tool-call $0.02 | A/B 比价 z 分 + 配对交易判读 |
| `get_sector_relative_strength` | tool-call $0.02 | 资产收益 − 基准收益（百分点） |
| `get_relative_momentum` | tool-call $0.02 | 6 月动量 − 基准动量（百分点） |
| `get_valuation_relative` | tool-call $0.02 | 两只 A 股谁在 PE/PB/PS 上更便宜 |
| `rank_relative_value` | **screen-call $0.05** | 篮子按相对基准强度排名 |

### 连接（MCP 客户端）

```
https://neeenja--alphabook-relative-value.apify.actor/mcp
Authorization: Bearer <APIFY_TOKEN>
```

发送 JSON-RPC：`initialize`、`tools/list`、`tools/call`。示例：

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": { "name": "get_pairs_spread", "arguments": { "codeA": "600519", "codeB": "000858" } }
}
```

### 计费

按事件付费。`initialize` 与 `tools/list` 免费。每次分析调用 **$0.02**；篮子相对价值排名（`rank_relative_value`）为 **$0.05**，因其最多评分 10 只标的。

### 数据源与诚实边界

- **K 线：** 腾讯 `gtimg.cn`（A/港/美）与 Yahoo（全球），免费、无 Key。
- **估值：** 东方财富 datacenter 快照（仅 A 股）。仅快照，无历史。
- 数据缺失 → 返回 `n/a`，绝不编造 `0`。
- 所有输出均带 `NOT_ADVICE` 免责声明。

***

## AlphaBook 相對價值 MCP

相對價值訊號引擎，以遠端 MCP 伺服器形式提供。它給 agent 的是 **相對價值判定（價差 z / 相對強弱 / 估值相對）**，而非絕對價格。五個工具涵蓋配對價差、相對強度、相對動量、估值相對與籃子相對價值排名。價格指標純價格派生；估值相對用免費 A 股快照。免費公開資料，無需 API Key。**不構成投資建議。**

> **誠實邊界：** 免費源只給估值「快照」，估值相對是橫截面近似，非同行分位。配對訊號依賴均值回歸假設，結構性斷裂會令歷史關係失效。所有輸出附 `NOT_ADVICE`。

### 工具

| 工具 | 計費事件 | 回傳 |
|------|----------|------|
| `get_pairs_spread` | tool-call $0.02 | A/B 比價 z 分 + 配對交易判讀 |
| `get_sector_relative_strength` | tool-call $0.02 | 資產收益 − 基準收益（百分點） |
| `get_relative_momentum` | tool-call $0.02 | 6 月動量 − 基準動量（百分點） |
| `get_valuation_relative` | tool-call $0.02 | 兩檔 A 股誰在 PE/PB/PS 上更便宜 |
| `rank_relative_value` | **screen-call $0.05** | 籃子按相對基準強度排名 |

### 連線（MCP 用戶端）

```
https://neeenja--alphabook-relative-value.apify.actor/mcp
Authorization: Bearer <APIFY_TOKEN>
```

發送 JSON-RPC：`initialize`、`tools/list`、`tools/call`。範例：

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": { "name": "get_pairs_spread", "arguments": { "codeA": "600519", "codeB": "000858" } }
}
```

### 計費

按事件付費。`initialize` 與 `tools/list` 免費。每次分析呼叫 **$0.02**；籃子相對價值排名（`rank_relative_value`）為 **$0.05**，因其最多評分 10 檔標的。

### 資料來源與誠實邊界

- **K 線：** 騰訊 `gtimg.cn`（A/港/美）與 Yahoo（全球），免費、無需 Key。
- **估值：** 東方財富 datacenter 快照（僅 A 股）。僅快照，無歷史。
- 資料缺失 → 回傳 `n/a`，絕不編造 `0`。
- 所有輸出均附 `NOT_ADVICE` 免責聲明。

# Actor input Schema

## Actor input object example

```json
{}
```

# Actor output Schema

## `mcpEndpoint` (type: `string`):

Streamable HTTP MCP endpoint of this Actor run. Connect an MCP client here (Authorization: Bearer \<APIFY_TOKEN>). POST JSON-RPC messages: initialize, tools/list, tools/call.

## `tools` (type: `string`):

Comma-separated list of the 5 tools: get_pairs_spread, get_sector_relative_strength, get_relative_momentum, get_valuation_relative, rank_relative_value.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("neeenja/alphabook-relative-value").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("neeenja/alphabook-relative-value").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call neeenja/alphabook-relative-value --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,neeenja/alphabook-relative-value"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/XsK9alD3ufrkmJEJ8/builds/XeE1y7geX08SWgyUl/openapi.json
