finlab
Comprehensive guide for FinLab quantitative trading package across global stock markets (TW, US, KR, JP, HK; both single-name equities and ETFs/funds). Use when working with trading strategies, backtesting, stock data, FinLabDataFrame, factor analysis, stock selection, or when the user mentions FinLab, trading, quant trading, US equity, S&P 500 / NASDAQ 100, SPY / QQQ, sector or leveraged ETFs, ETF rotation, 美股, or stock market analysis. Includes data access, strategy development, backtesting wo
Security Assessment
About finlab
FinLab is a comprehensive usage guide for the FinLab quantitative trading Python package, covering strategy development, backtesting, factor analysis, machine learning, and stock data access across global markets (Taiwan, US, Korea, Japan, Hong Kong), including both single-name equities and ETFs/funds. It solves the problem of knowing how to drive a fairly deep quant library correctly: which datasets are safe for historical backtesting versus current-snapshot-only, how quarterly fundamentals are filing-date aligned, and how the same market-agnostic API applies once you set the active market.
The skill bundles a SKILL.md plus several reference files (dataframe, backtesting, factor analysis and examples, machine learning, trading, best practices, and US-market specifics). It documents prerequisites (Python 3.10+ and the uv package manager), installation and zero-setup execution via uv run, and authentication through finlab.login(), which runs a Google OAuth flow and stores an API token bound to a FinLab account. It explains FinLabDataFrame operations, technical indicators (RSI, MACD, Bollinger Bands, ATR, OBV and more), stock-selection conditions across technical, fundamental, and chip analysis, and complete strategy examples, along with US-market details such as USMarket vs USFundMarket backtest defaults and universe construction.
It targets quantitative traders, systematic strategy developers, and researchers working with Taiwan and US markets who use the FinLab platform. Use cases include building and backtesting factor strategies, running ETF rotation, analyzing revenue and valuation factors, and applying machine learning to trading signals. The skill responds in the user's language and points toward the hosted FinLab Studio for zero-install notebook work.
FAQ
What are the prerequisites?
Python 3.10+ and the uv package manager. The skill installs finlab (version 2.0.0 or higher) via uv, or you can run scripts with uv run --with finlab for a zero-setup temporary environment.
How does authentication work?
FinLab requires an API token. The skill uses finlab.login(), which opens a browser for Google OAuth, retrieves the token, and stores it automatically (for example in a .env file). Tokens are bound to a FinLab account at finlab.finance.
Which markets are supported?
Taiwan (default), US, Korea, Japan, and Hong Kong, plus Taiwan emerging (rotc) and Taiwan convertible bonds. You select the market once per session with data.set_market(), and generic dataset names resolve to the active market.
Are all US data tables safe for backtesting?
No. The US-market reference notes that analyst consensus, ratios, and DCF data are live/current-snapshot only and should not be used historically, while quarterly fundamentals are filing-date aligned so no shift workaround is needed.
Can I run it without installing anything locally?
Yes. The skill points to FinLab Studio, a hosted Jupyter environment with finlab preinstalled and the API token already wired up, as a zero-install option.
Install finlab
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
koreal6803/finlab-ai