TimeFrame.register_flag_system

TimeFrame.register_flag_system(name, flag_system=None, flag_type='bitwise')[source]

Register a named flag system with the internal flag manager.

Parameters:
  • name (str) – Short name for the flag system.

  • flag_system (Mapping[str, int | str] | list[str] | None) – The flag system definition. Accepted types are None (default bitwise system with a single FLAGGED flag at value 1), dict[str, int] (bitwise or categorical depending on flag_type - bitwise values must be powers of two), dict[str, str] (always categorical; flag_type is ignored), or list[str] (flag names are sorted; bitwise assigns powers of two, categorical uses each name as both key and value - an empty list produces the default FLAGGED flag).

  • flag_type (Literal['bitwise', 'categorical', 'categorical_list']) – Whether to create a "bitwise" or "categorical" flag system. Only relevant when flag_system is a dict[str, int] or list[str].

Return type:

None