Tally Node

The Tally node counts how many of its conditions are true, optionally weighted, and passes when the score is at least, exactly or between the numbers you set. Its pass rules, weights, the score as a number, and the traps.

NodeBy AlgoLiftUpdated 5 min read
On this page 9How it worksWeightsThe score as a numberExample: three of four on NQSettingsOutputsUse something else whenWhen it doesn't behaveGoing further

Discretionary traders rarely wait for every box to be ticked. They wait for enough of them. The Tally node works the same way: wire in up to twenty conditions, and it counts how many are true right now, giving more weight to the ones you trust more if you like. You decide what passes ("at least 3 of these 5"), and you also get the count itself as a number.

Takes
Two to twenty conditions
Gives
Pass or not, plus the score as a number
Reach for it
Enough of several conditions should agree, not necessarily all of them

How it works

Each condition wired in that's true adds a point. The node compares the total, its score, with the Pass Logic you choose:

Pass LogicPasses when the score is
At Least NN or more
Exactly NExactly N
BetweenFrom Min to Max, both included

Two settings of At Least are worth knowing by heart. At Least N with N equal to the number of conditions is an AND, and At Least 1 is an OR. That makes a Tally the way past the Logic node's limit of five inputs.

Only wired conditions count. An empty input is never true, so it can never add to the score. A condition that can't be judged yet, such as a comparison against an indicator still warming up, adds nothing either.

Weights

Switch on weighted mode with the toggle in the node's header, and each condition gets a weight beside its input: a whole number from −100 to 100, 1 to start with. A true condition now adds its weight instead of a point.

Weights let you say which conditions matter more. Give a trend filter a weight of 2, three confirmations a weight of 1 each, and At Least 3 reads as "the trend plus any one confirmation, or all three confirmations without it". The trend alone isn't enough.

A negative weight is a vote against. "RSI above 75" at −2 takes two points off when the market's stretched, which can sink a score that would otherwise pass without forbidding the trade outright.

The score as a number

The node's second output, beside Value Output, is the score itself, for a Comparison, a Math node or anything else that takes a number. Value Output decides its form:

  • Total Score is the score as counted.
  • Ratio (0-1) is the score divided by the total weight of the wired conditions. With every weight at 1, that's the share of conditions that hold: 3 of 4 reads 0.75.

Pass Logic always reads the score, whichever form the number output takes.

Example: three of four on NQ

You trade NQ 5m pullbacks long, and there are four things you like to see first: price above VWAP, EMA 20 above EMA 50, RSI(14) above 50, and ADX above 20. Requiring all four leaves almost no trades. Any one of them alone is noise.

Build the four as Comparisons. Add a Tally, press + twice so it has four inputs (C1 to C4), and wire one condition into each. Set Pass Logic to At Least N with N at 3, and wire the top output, the pass, into the Entry.

Then try the weighted version. Switch weighting on, give the EMA condition a 2, leave the others at 1, and keep N at 3. Now the trend has to be there unless all three of the others agree.

Settings

Inputs
Default 2
From 2 to 20, shown as C1, C2 and so on. Add and remove them with + and − on the node's left edge.
Weighted
Default Off
Off, each true condition adds 1. On, each adds its own weight. The toggle is in the node's header.
Weights
Default 1 each
A whole number from −100 to 100 for each condition, shown beside its input while weighting is on.
Pass Logic
Default At Least N
At Least N, Exactly N, or Between.
N, or Min
Default 1
The score to reach, or for Between, the lowest score that passes.
Max
Default The top score
Between only: the highest score that passes. The builder starts it at the most the Tally can score, which means no upper limit, and keeps it there as you add inputs or change weights. It has to be above Min.
Value Output
Default Total Score
Total Score, or Ratio (0-1).

Outputs

Pass
True or false
The top output, beside Pass Logic. True when the score meets it.
Score
Number
The bottom output, beside Value Output: the total score, or the ratio.

Use something else when

Every condition must hold, and there are five or fewer
An AND says it more plainly than At Least 5 of 5.
You want to count bars, not conditions
"RSI was under 30 on at least 3 of the last 10 bars" is a Since and its count over the last N bars. A Tally only counts what's true right now.
A number should change with a condition
If this, use one value; otherwise another.

When it doesn't behave

It never passes

It's asking for more than its wired conditions can score: At Least 5 with four wired, or a weighted score whose positive weights don't add up to N. The Inspector's checks catch this and, for an unweighted Tally, offers to ask for all of the conditions you've wired.

The builder won't accept my Between

Max has to be above Min. For one exact score, use Exactly N.

My ratio goes above 1

There's a negative weight in the mix. The ratio divides the score by the total of all the weights, negatives included, so a −2 shrinks that total and the ratio can run past 1. With negative weights, read the Total Score instead.

Going further

A Tally hides a lot of choices in a few numbers: which conditions go in, their weights, and N. Each one is a knob, and a score with five hand-tuned weights will fit one backtest beautifully and the next one badly. Set the weights from your reasons before you run anything, or leave them all at 1. Optimize can sweep N (it appears as Required True Count) but not the weights, which is a fair hint about where the tuning belongs.

The number output is handy on its own. Wire the score into a Comparison set above N and you have a second, stricter signal built from the same conditions, ready to drive a bigger size or a second entry.

Or ask the copilot