1. Using Trading Strategies

In qteasy, a trading strategy (Strategy) generates trading signals from historical data at each run step; Operator is the container and scheduler that runs strategies at configured frequencies and times and aggregates signals; multiple strategies form a Group, and signals within the same Group can be blended via a blender expression.

1.1. Overview

  • Strategy: Uses data from DataType and tunable parameters to compute and return signals in realize() (e.g., target positions or stock-selection lists).

  • Operator: Holds one or more Strategy instances, configures signal_type (PT/PS/VS), run_freq, and run_timing, and invokes strategies step by step in backtest or live trading to produce signals in a unified format.

  • Group: Strategies sharing the same run_freq and run_timing belong to one Group; each Group can configure a blender to merge multiple strategy signals.

1.2. Main Topics

  • Creating and configuring Operator: See 2. Operator: Creation and Basic Configuration.

  • Group and blender: See 3. Group and Strategy Signal Blending.

  • Finding and using built-in strategies: See 4. Finding and Using Built-in Strategies.

  • Three strategy base classes: RuleIterator, FactorSorter, GeneralStg — see 5. Three Strategy Base Classes.

  • Custom strategies: See 6. Custom Strategies: From Definition to Use.

1.3. Chapter Guide in This Section

  • 2. Operator: Creation and Basic Configuration — Create an Operator, add strategies, common attributes, set parameters, and pre-run checks.

  • 3. Group and Strategy Signal Blending — How Groups are formed, blender expressions, and multi-group merge modes.

  • 4. Finding and Using Built-in Strategies — Lookup APIs, use in Operator, and the full built-in strategy list.

  • 5. Three Strategy Base Classes — Use cases and usage of RuleIterator, FactorSorter, and GeneralStg.

  • 6. Custom Strategies: From Definition to Use — Tunable parameters, required data, realize() implementation, and a full example.