Trade Collector

The Trade Collector rule gathers and combines trade IDs from multiple sources into a single unified list. It acts as a central collection point in your strategy, consolidating trades generated by different rules so they can be processed together by downstream rules.

How It Works

The Trade Collector rule functions as a consolidation mechanism that receives trade IDs from multiple input sources and merges them into one comprehensive list. When activated, it processes each input source containing trade IDs and systematically combines them into a single collection.

The rule maintains an internal map of all collected trade IDs to ensure no duplicates are included in the final output. As it processes each input source, it checks whether each trade ID has already been collected. New trade IDs are added to the internal collection, while IDs that are already present are ignored to prevent duplication.

The output list is sorted by the time the trades were originally created, maintaining chronological order. This is particularly useful in complex strategies where multiple rules generate different sets of trade IDs that need to be processed together. For example, one rule might identify trades with profitable conditions while another identifies trades matching specific technical criteria — the Trade Collector can combine both sets for further processing by a single downstream rule.

Inputs

Parameter Description Required Default
Trade Id(s) A list of trade ID sources from which to collect trade IDs. Each source can provide multiple trade IDs, and all will be combined into the final output. You can connect multiple upstream rules to this input. Yes

Outputs

Output Description
Combined Trade Id(s) A single, deduplicated list containing all trade IDs collected from every input source, sorted by the time each trade was created.
Count Trades The total number of unique trade IDs in the combined output list. Use this value to verify the expected number of trades were collected or to drive conditional logic downstream.

Tips

The Trade Collector automatically removes duplicate trade IDs, so you do not need to worry about the same trade appearing in multiple input sources. Use the Count Trades output to verify the expected number of trades have been gathered before passing them to rules such as Trade Filter or Close Positions.

Was this helpful? Let us know