Custom indicators

A custom indicator is a Python class that follows the Investfly Indicator SDK contract and returns a time-aligned numeric series.

Use one when the standard indicator catalog does not provide the calculation you need. Custom indicators can be selected in supported charts, screeners, Market Automations, and strategy expressions after they validate successfully.

Required contract

Your class subclasses the SDK Indicator base class and implements:

  • getIndicatorSpec, which describes the indicator name, parameters, and outputs shown to users; and
  • computeSeries, which uses the injected data service and returns the computed series in the required shape.

Use the Python API reference for the exact current signatures, types, and examples. That reference is generated from the SDK and is more precise than copying a long sample into this guide.

Develop and validate

  1. Open Indicators and create a custom indicator, or develop with the SDK locally for a faster edit/test loop.
  2. Define clear parameters and output names in the spec.
  3. Request required bars or data through the injected service; do not make arbitrary network or filesystem calls.
  4. Return values aligned to the requested timestamps and handle warm-up or missing input explicitly.
  5. Run the platform validation, then test the indicator on a chart and with known input cases.

The execution environment permits the documented SDK modules and a restricted scientific-Python set, including supported uses of math, statistics, pandas, numpy, talib, and typing helpers. Consult the API reference for the current allowlist.

Use it in product workflows

After validation, select the custom indicator just like a standard indicator and provide its declared parameters. Each host still controls the evaluation model: a screener checks current truth, a Market Automation watches for a false-to-true transition, and a strategy uses its configured Signal Mode.

Test across the intended assets and intervals. A calculation that works for daily equity bars may not have the same data coverage or meaning for intraday, forex, futures, options, or crypto inputs.

Edit or delete safely

Desktop users can edit code in the in-product editor; smaller-screen workflows can be read-only or management-focused. Before changing outputs or parameter names, identify every dependent expression.

Deletion is blocked when the indicator is still used by a strategy, screener, or Market Automation. Remove or replace those uses first, then delete the indicator.

For the broader developer workflow, see the Python algorithmic trading platform and hosted Python strategy guide.