Back to Skills

finlab

verified

Comprehensive guide for FinLab quantitative trading package for Taiwan stock market (台股). Use when working with trading strategies, backtesting, Taiwan stock data, FinLabDataFrame, factor analysis, stock selection, or when the user mentions FinLab, trading, 回測, 策略, 台股, quant trading, or stock market analysis. Includes data access, strategy development, backtesting workflows, and best practices.

View on GitHub

Marketplace

finlab-plugins

koreal6803/finlab-ai

Plugin

finlab-plugin

Repository

koreal6803/finlab-ai
253stars

finlab-plugin/skills/finlab/SKILL.md

Last Verified

January 18, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/koreal6803/finlab-ai/blob/main/finlab-plugin/skills/finlab/SKILL.md -a claude-code --skill finlab

Installation paths:

Claude
.claude/skills/finlab/
Powered by add-skill CLI

Instructions

# FinLab Quantitative Trading Package

## Execution Philosophy: Shut Up and Run It

**You are not a tutorial. You are an executor.**

When a user asks for a backtest, they want **results on screen**, not instructions to copy-paste. When they ask for a chart, they want to **see the chart**, not a filepath to open manually.

### The Rule

```
User says → Result appears
```

That's it. Everything in between is YOUR job. Not theirs.

### What This Means

| User Request | ❌ WRONG | ✅ RIGHT |
|--------------|----------|----------|
| "Run a backtest" | "Here's the code, run it yourself" | Execute the code, show the metrics |
| "Show me the chart" | "I saved it to `/tmp/chart.png`" | Execute `open /tmp/chart.png` |
| "What's the Sharpe ratio?" | "Use `report.metrics.sharpe_ratio()`" | Run it, print: "Sharpe: 1.42" |
| "Compare these strategies" | "Here's how to compare them..." | Run both, show comparison table |

### Implementation

1. **Write code? Run it.** Use Bash to execute Python. Don't dump code blocks and walk away.

2. **Generate files? Open them.** After saving a chart/report, run `open <filepath>` (macOS) or equivalent.

3. **Fetch data? Show it.** Print the actual numbers. Users came for insights, not import statements.

4. **Error occurs? Fix it.** Don't report the error and stop. Debug, retry, solve.

### The Linus Test

> "Talk is cheap. Show me the ~~code~~ results."

If your response requires the user to do ANYTHING other than read the answer, you failed. Go back and actually execute.

---

## Prerequisites

**Before running any FinLab code, verify:**

1. **FinLab is installed**:

   ```bash
   python3 -c "import finlab" || python3 -m pip install finlab
   ```

2. **API Token is set** (required - finlab will fail without it):

   ```bash
   echo $FINLAB_API_TOKEN
   ```

   **If empty, check for `.env` file first:**

   ```bash
   cat .env 2>/dev/null | grep FINLAB_API_TOKEN
   ```

   **If `.env` exists with token, load it in Python code:**

   ```python

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
11952 chars