Docs
Open Studio

FinLab Docs

Turn an investing idea into a tested strategy in a few lines of Python

Load US and Taiwan market data, write stock-selection rules, backtest, and trade daily. Every step comes with code you can run.

pip install finlab
Quickstart Install, load data, write a condition and run your first backtest in five minutes. No code needed Describe an idea in Studio; AI writes the code and backtests it for you. API reference Every function’s parameters, returns and examples, generated from the source.

How FinLab works

Every dataset is a table of dates by stocks. A condition works on the whole table at once; each True is a stock to hold. Hand it to sim() to backtest, then schedule it to run daily.

  1. 1 Get data
    data.get('price:adj_close')

    Dates down, stocks across

  2. 2 Write a condition
    close > close.average(60)

    True = hold that day

  3. 3 Backtest
    sim(position, resample='M')

    Returns, drawdown, trades

  4. 4 Go live
    PortfolioSyncManager

    Updates and orders every day

Walk through it in the quickstart

Guides by task

Strategy examples

See all

Need help?

↑↓ Move Enter Open Esc Close