Formula mode
Write one complete expression per non-empty line. Use lowercase field names and uppercase operator names.FUTURE_RETURNS; it reads future data and is rejected by the factor quality gate.
Python mode
Define one class that inherits fromFactor. Return a Series from calculate(self, factors) and preserve the symbol/date MultiIndex.
transform, pct_change, and rolling operations that preserve the input index. groupby(...).apply(...) causes a validation error when it adds another grouping level to the result.

