Filter Rules

Arconomy provides a set of trade filter rules that allow you to select, isolate and act on specific trades within your strategy. Unlike entry or exit rules that open and close positions, filter rules work with existing trades — narrowing down a list of trade IDs based on attributes, timing or state changes so that downstream rules only act on the trades that meet your criteria.

Trade Filter

The Trade Filter rule selects specific trades from a list based on a wide range of configurable criteria. It takes a collection of trade IDs as input and returns only those that match your specified conditions.

At the most basic level you can filter trades by whether they are open positions or pending orders, their direction (buy or sell), and for pending orders, the specific order type (limit, stop, market, stop limit or limit stop).

For more advanced filtering, enable the criteria option to apply conditions to specific trade attributes. For open positions you can filter based on profit (in currency or pips), entry price, stop loss price, take profit price, risk amount or risk pips. For pending orders you can filter by target entry price or the distance of the order from the current market price. The rule can find the single trade with the highest or lowest value for a given criterion, or find all trades that meet a condition using comparison operators.

The execution mode controls how many trades are output — a single match, exactly one or none, or all matching trades. The match type setting further controls whether a trade can be matched multiple times or only up to a specified count, preventing the same trade from being processed repeatedly.

Use Cases

  • Target the most profitable trade. Use the Highest filter on Profit to find the single most profitable open position, then pass it to a Stop Loss rule to tighten the trailing stop and lock in gains.
  • Isolate buy or sell positions. Filter by direction to separate long and short positions so you can manage each side independently — for example, applying different take profit logic to buy versus sell trades.
  • Find trades at risk. Use the Condition filter with a Less Than operator on Profit to isolate positions that have fallen below a certain loss threshold, then route them to a Close Positions rule.
  • Manage pending orders. Filter by order type to select only limit orders or stop orders, allowing you to cancel or modify specific order types without affecting others.

See the Trade Filter rule page for full details on all input parameters, output values and configuration tips.

Trade Filter by Time

The Trade Filter by Time rule filters trades based on specific time criteria. It supports strategies that depend on timing by enabling you to find the earliest or latest trades, or trades that occurred before or after specific time periods, with configurable time windows down to the second.

For positions you can filter based on entry time, when take profit or stop loss orders were placed, or when they were last modified. For orders you can filter based on when the order was placed.

The rule provides three filtering approaches:

  • First — selects the trade with the earliest time for the specified criterion.
  • Last — selects the trade with the latest time for the specified criterion.
  • Condition — selects trades based on a target date and time, with the option to match trades that occurred before or after that moment. You can also define a time window (for example, trades that occurred at least 5 minutes after the target time) using the period and period count settings.

Use Cases

  • FIFO exit strategies. Use the First filter on Entry Time to find the oldest open position, then route it to a Close Positions rule to close the earliest trade first.
  • Manage the most recent trade. Use the Last filter to isolate the most recently opened position and apply specific stop loss or take profit adjustments to it without affecting earlier trades.
  • Time-based position management. Use the Condition filter with an After operator and a period of Hours to identify positions that have been open for a minimum duration — useful for time-decay strategies or for tightening stops on trades that have been running for a set period.
  • Stale order cleanup. Filter for pending orders placed more than a certain number of minutes ago and cancel them to keep your order book clean.

See the Trade Filter by Time rule page for full details on all input parameters, output values and configuration tips.

Trade Filter by State

The Trade Filter by State rule filters trades based on changes in their state values compared to the previous state. Rather than looking at a static snapshot, this rule continuously compares each trade's current values against its previously recorded values to identify specific patterns of change.

You can monitor a range of trade attributes including current profit or loss (in currency or pips), stop loss price or distance in pips, take profit price or distance in pips, and the remaining open quantity. For each attribute the rule compares the current value to the previously recorded value using the comparison operator you specify (equal, less than, greater than and so on).

The rule also includes a consecutive match counter. You can require a specific number of consecutive matching states before a trade is included in the output. This helps avoid false triggers and ensures that only trades showing consistent state patterns are selected.

Use Cases

  • Detect rising profit. Monitor the Profit attribute with a Greater Than operator to identify trades whose profit is increasing on each evaluation. Once a trade shows consistent upward momentum you can tighten its trailing stop to protect gains.
  • Spot deteriorating trades. Use Less Than on Profit Pips to find trades where the profit in pips is falling on consecutive evaluations — an early warning that a trade may be reversing, allowing you to close or reduce the position before the stop loss is hit.
  • Monitor stop loss adjustments. Track the Stop Loss Price attribute to identify trades where the stop loss has been moved. This is useful in strategies where multiple rules may adjust the same trade's stop loss and you need to react to those changes.
  • Scale-out detection. Monitor Open Quantity with a Less Than operator to detect when a trade has been partially closed. You can then apply different management logic to the remaining position.

See the Trade Filter by State rule page for full details on all input parameters, output values and configuration tips.

Combining Filter Rules

Filter rules can be chained together to progressively narrow down a set of trades. The output trade IDs from one filter become the input for the next, allowing you to build precise selection criteria. For example:

  1. Start with all open trade IDs from the Trading Account rule.
  2. Use a Trade Filter to select only buy positions in profit.
  3. Pass the result to a Trade Filter by Time to find the oldest of those profitable buy positions.
  4. Route that trade to a Stop Loss rule to tighten its trailing stop.

This chaining approach keeps each filter focused on a single concern, making your strategy logic easier to understand and maintain. Each filter rule outputs both the filtered trade IDs and a count of matching trades, which can be used for conditional logic further down the chain.

Was this helpful? Let us know