Skip to content

FinLab Official Glossary

This page defines the standard terminology used in FinLab documentation.

Core Trading Concepts

Term Code/API Definition Example
stop loss stop_loss Automatically close a position when losses reach a certain percentage stop_loss=0.1 means exit at 10% loss
take profit take_profit Automatically close a position when profits reach a certain percentage 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

Term Code/API Definition Example
portfolio Portfolio A collection of multiple strategies 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

Term Class Name Definition Example
DataFrame DataFrame Tabular data structure from pandas close = data.get('price:adj_close') after data.set_market('us')
FinlabDataFrame FinlabDataFrame Custom class extending pandas DataFrame Auto-alignment, technical indicator methods

Performance Metrics

Term 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-profit take profit Industry-standard term
dataframe DataFrame First letters should be capitalized (following pandas convention)
buy, sell (for signals) entry, exit "Entry/exit" are more precise
re-balance, roll over rebalance Unified terminology
back test backtest Follow industry standard

Writing Guidelines

  1. Use the terms above consistently in prose: stop loss, take profit, entry, exit, rebalance, backtest.
  2. Keep code parameters exactly as the API spells them: stop_loss=0.1, take_profit=0.2, resample='M'.
  3. Format code identifiers as code on every mention: sim(), FinlabDataFrame, position.

References