Skip to main content
Factors turn market or financial data into a numeric signal that you can analyze, backtest, or use in a strategy.

Choose a factor mode

Formula mode

Use one complete expression per line. Formula mode supports nested operators and arithmetic expressions.
Use lowercase names for fields and uppercase names for operators. Do not use assignments, imports, Python attributes, or FUTURE_RETURNS in a factor formula.

Python mode

Use Python when your factor needs logic that is not practical as one expression. Define one class that inherits from Factor and return a Series from calculate(self, factors).

Continue

FUTURE_RETURNS is listed in some legacy formula references, but TQX rejects it in factors because it uses future data.