Skip to content

FinLab Official Glossary

This page defines the standard terminology used in FinLab documentation to ensure consistency. Chinese equivalents are provided for reference.

Core Trading Concepts

English Chinese Code/API Definition Example
stop loss 停損 stop_loss Automatically close a position when losses reach a certain percentage to prevent further loss stop_loss=0.1 means exit at 10% loss
take profit 停利 take_profit Automatically close a position when profits reach a certain percentage to lock in gains take_profit=0.2 means exit at 20% gain
entry 進場 entry The point at which a strategy generates a buy signal entry_signal = close > ma20
exit 出場 exit The point at which a strategy generates a sell signal exit_signal = close < ma20
backtest 回測 sim() Evaluate strategy performance using historical data report = sim(position, resample='M')

Portfolio Concepts

English Chinese Code/API Definition Example
portfolio 投資組合 Portfolio A collection of multiple strategies used for risk diversification portfolio = Portfolio({'Strategy A': (report1, 0.5), ...})
position 持倉 position Currently held stocks and their weights position = close > ma20
rebalance 再平衡 resample Periodically adjust position weights to target allocation resample='M' means monthly rebalancing

Data Structures

English Chinese Class Name Definition Example
DataFrame 資料框架 DataFrame Tabular data structure from pandas (note: capital D and F) close = data.get('price:收盤價')
FinlabDataFrame FinLab 資料框架 FinlabDataFrame Custom class extending pandas DataFrame Auto-alignment, technical indicator methods

Performance Metrics

English Chinese API Field Definition
annual return 年化報酬率 annual_return Annualized rate of return for the strategy
Sharpe ratio 夏普率 daily_sharpe Risk-adjusted return; higher is better
maximum drawdown 最大回撤 max_drawdown Largest peak-to-trough decline in portfolio value

Terms to Avoid

Avoid Use Instead Reason
stop-loss, stop-profit (止損、止盈) stop loss, take profit (停損、停利) Avoids confusion; "stop loss / take profit" are the standard industry terms
dataframe DataFrame First letters should be capitalized (following pandas convention)
buy, sell (買入、賣出) entry, exit (進場、出場) "Entry/exit" are more professional and precise
re-balance, roll over (重新平衡、轉倉) rebalance (再平衡) Unified terminology
back test (two words) backtest (one word) Follow industry standard

Chinese-English Mixing Guidelines

These guidelines apply when writing FinLab documentation in Chinese:

  1. Use English for technical terms: DataFrame, stop_loss, backtest
  2. Use Chinese for explanatory text: When explaining concepts
  3. Annotate with English on first mention: e.g., "停損 (stop loss)"
  4. Keep code parameters in English: stop_loss=0.1 (not 停損=0.1)

References