Skip to main content

'Trade Rule' Block - An Introduction

Define trade entry logic by comparing market values and indicators.

Updated over 4 months ago

Purpose
The Trade Rule block is one of the most powerful and important blocks in Profectus. It checks whether a specific condition is true by comparing one value against another. This is the foundation for most trading logic — if the rule is true, the connected block will run; if it’s false, the “no” path will run.


How It Works

The block benchmarks Value A against Value B. The value can be e.g., from...

  • Indicators such as the moving average

  • Candles meaning e.g, the price level of a candlestick from its highest height

  • Market Properties such as the current ask or bid price

  • Account information such as the current balance of the trading account

  • Trade Info such as the current open price of a trade or

  • Values which is an advanced feature and requires the understanding of variables and constants.

Example

Let’s say we’re trading on the daily timeframe.
We want to check if yesterday’s high (Candle ID 1) is at least as high as the high from two days ago (Candle ID 2). In technical terms:

Candle High – Candle ID 1 ≥ Candle High – Candle ID 2

Operators

An operator is that symbol between the values. Check the definitions below:

  • >: Greater than/higher than/above

  • <: Smaller than/lower than/below

  • X>: Crossing above

  • X<: Crossing below

  • >=: Equal to or greater than/higher than/above

  • <=: Equal to or Smaller than/lower than/below

  • =: Equal to

  • !=: Not equal to

Types of Values to Benchmark with

Both Value A and Value B can be set from a wide range of sources:

  1. Indicator – Compare readings from built-in indicators (e.g., Moving Average vs. Bollinger Band).

  2. Value – Use fixed numbers you define.

  3. Candle – Use specific candle data (open, high, low, close, size, body size, wicks, etc.).

  4. Market Property – Reference market data such as bid/ask prices or spread.

  5. Account – Pull values like account balance, equity, or free margin.

  6. Trade Info – Check existing trades for details such as profit, loss, or open price.


Use Case

  • Build trade entries by checking if price breaks a moving average.

  • Filter trades by market conditions such as spread or session.

  • Trigger actions based on account-level metrics (e.g., stop trading if drawdown exceeds a limit).

Did this answer your question?