Docs / Build a strategy

Bias generators

An optional directional filter you set once and reuse — plus the one thing everyone gets wrong about it.

A bias generator produces a directional lean — long, short or neutral — from its own rules. It is optional. Its whole purpose is to let you say "only take long entries while the bigger picture agrees" once, instead of writing that condition into every signal rule.

You build one on the Bias Generators tab.

Signals versus bias#

SignalsBias
ProducesAn action — enter or exitA directional state — long / short / neutral
TimingFires on the candle its conditions are metStays set until a different bias triggers
Used forOpening and closing positionsFiltering which direction may open

Building one#

Click Add Bias Generator and give it a name, e.g. trend_bias. Then add rules to it with Add Rule. A bias rule looks almost exactly like a signal rule — the same Condition builder, the same Line / Condition / Fixed value / Threshold line controls — except that instead of an Action you choose a Bias Direction: long, short or neutral.

Each rule says "when these conditions hold, set the bias to this direction".

A bias does nothing until you reference it#

WARNING

Setting up a bias generator does not filter your signals on its own. It just computes a line. To actually gate entries, you have to reference that bias line as a condition inside your signal rules. A bias you never reference is a number the strategy calculates and ignores.

This is the single most common misunderstanding about bias, so it is worth saying plainly: the bias generator and the signal rule are two separate things, and the second has to point at the first.

Referencing it is done with the ordinary Condition builder. A bias generator publishes a line named after the generator itself — a generator called trend_bias produces a line trend_bias, which you will find in the Line dropdown under Bias Generator Lines. That line holds 1 for long, -1 for short, or 0 for neutral. In a long entry rule, add a condition: Line trend_bias · Condition equals · Fixed value 1.

It stays set until something changes it#

A bias holds its last value until a different rule flips it. There is no automatic decay to neutral. So if you want full control, give it a rule for every state you care about — a long rule, a short rule, and if you want it to be able to stand aside, a neutral rule for when neither holds.

Worked example: a higher-timeframe trend filter#

Keep a 30-minute strategy from fighting the larger trend:

  1. Add an indicator — a 200-period EMA. On its panel, set the Timeframe (optional override) to 4h, so it measures the longer trend even though the strategy runs on 30m.
  2. Add a bias generator, trend_bias, with two rules:
    • Bias long when close is greater than the 4h EMA line.
    • Bias short when close is less than the 4h EMA line.
  3. In your signal rules, add one condition: the long entry also requires trend_bias equals 1; the short entry requires it to equal -1.

Your 30m entries now only fire in the direction of the 4h trend, and you wrote the EMA comparison once instead of pasting it into every rule.

A bias generator sets a direction, and a signal rule references it as a gate Bias generator trend_bias = 1 referenced by Signal rule condition trend_bias equals 1 Long OK
The generator sets the direction; the signal rule chooses to obey it. Remove that condition and the bias still computes — it just no longer has any effect.

Worked example: giving news a longer shelf life#

This is where bias earns its keep, and it is the difference between reacting to news and staying aware of it.

News is bursty. The NewsSentiment indicator reads net-bullish on the handful of candles where articles actually land, and reads 0 on every candle in between. So you have two ways to use it, and they behave very differently:

  • As a direct signal — enter long when NewsSentiment.sentiment_score goes above 0.2. This fires only on the candle the news hits. Precise, but it forces you to trade in the same instant the headline lands, and does nothing on the many quiet candles afterward.
  • As a bias — set the bias long when sentiment turns net-bullish. Because a bias persists until something flips it, the strategy now stays "aware" that recent news was bullish for candles after the burst. Your ordinary price signal can then fire on a later, calmer candle and still be gated to the direction the news pointed.
News sentiment spikes only on the candles news lands; stored in a bias it persists across the quiet candles until a bearish burst flips it candles over time → NewsSentiment.sentiment_score + 0 bullish burst bearish burst news_bias (stored, persists) bias stays long here — even with no news
The raw score (top) is silent between bursts. Stored in a bias (bottom) it becomes a state the strategy can read for as long as the mood lasts — until a bearish burst flips it. A direct signal could only ever act at the two spikes.

To build it:

  1. Add the NewsSentiment indicator (there is a one-click banner for it on the Indicators tab).
  2. Add a bias generator, news_bias, with two rules:
    • Bias long when NewsSentiment.sentiment_score is greater or equal to 0.2 AND NewsSentiment.article_count is greater or equal to 2 — the second condition stops one stray article swinging it.
    • Bias short when NewsSentiment.sentiment_score is less or equal to -0.2.
  3. Reference it in your entries: require news_bias equals 1 on a long, -1 on a short.

Your price signals now fire only in the direction of the most recent news mood, days after the headline if need be. The full worked strategy is Recipe 3. For what the sentiment lines mean and how they are scored, see news and sentiment.

TIP

This is the general rule for any sparse input — news, scheduled events, anything that happens on a few candles and not the rest. A direct signal catches the instant; a bias remembers it. Reach for a bias whenever "act while this recently happened" matters more than "act the moment it happens".

Was this page helpful?