Metrics behind rules and targets
What metrics are, how scope works, and how to pick the right one.
What a metric is
A metric is a published expression that turns your trade data into a number. Rules and targets do not contain calculations themselves; they point at a metric and compare its result to a threshold.
That separation is what lets the same calculation power a rule, a target, and a dashboard card without being defined three times.
Metrics carry a role that says what they are suitable for:
| Role | Used by |
|---|---|
| Analytics | Dashboards, charts, reports |
| Target | Targets |
| Rule, trade | Rules evaluated once per trade |
| Rule, day | Rules evaluated once per calendar day |
| Rule, execution | Rules evaluated once per execution |
| Function | Building blocks reused by other expressions |
Some metrics offer variants, which are named segments of the same calculation. Where a variant exists, choose it deliberately rather than leaving the default.
The full catalog, and how to publish your own metrics, is covered in the Insights chapter under Custom metrics.
Evaluation units and scope
The most important choice when linking a metric is what the number is measured over. The app calls this the evaluation unit, and shows it in a readable sentence when you pick a metric.
There are two halves to it.
What is checked. Each trade, each execution, each day, or the entire loaded data set. This decides how often a verdict is produced. A rule checked for each trade produces one verdict per trade; a rule checked per day produces one verdict per day.
What the statistic covers. Per calendar day, per week, per month, per round trip, or the entire loaded data set. This decides the window the number is calculated over.
In the rule editor the choice appears as Metric scope with three options: Overall, Calendar day, and Trade.
Getting this wrong produces rules that look broken:
- A daily loss limit must be a day-scoped rule. As a trade-scoped rule it would ask whether each individual trade exceeded the daily limit, which is not the question.
- A maximum position size rule belongs at trade or execution scope. At day scope it would compare a whole day's aggregate to a per-trade ceiling.
When a rule reports odd verdicts, check the scope before you change the threshold.
Picking and previewing a metric
The metric picker lists the catalog, organized by namespace, with the evaluation unit shown for each entry so you can tell trade-level from day-level metrics before you commit.
Before saving a rule, use the preview. There is a day preview and a trade preview, each showing what the metric actually returns against real samples from your data. This is the fastest way to catch a mismatch between what you meant and what the metric measures.
A practical habit: after linking a metric, open the preview and look for values that are impossible. Empty results usually mean the scope is wrong or your data does not contain the field the metric needs. Values that look like the right shape but the wrong magnitude usually mean you picked a related metric rather than the one you wanted.
