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#
| Signals | Bias | |
|---|---|---|
| Produces | An action — enter or exit | A directional state — long / short / neutral |
| Timing | Fires on the candle its conditions are met | Stays set until a different bias triggers |
| Used for | Opening and closing positions | Filtering 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#
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:
- 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. - Add a bias generator,
trend_bias, with two rules:- Bias long when
closeis greater than the 4h EMA line. - Bias short when
closeis less than the 4h EMA line.
- Bias long when
- In your signal rules, add one condition: the long entry also requires
trend_biasequals1; 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.
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_scoregoes above0.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.
To build it:
- Add the
NewsSentimentindicator (there is a one-click banner for it on the Indicators tab). - Add a bias generator,
news_bias, with two rules:- Bias long when
NewsSentiment.sentiment_scoreis greater or equal to0.2ANDNewsSentiment.article_countis greater or equal to2— the second condition stops one stray article swinging it. - Bias short when
NewsSentiment.sentiment_scoreis less or equal to-0.2.
- Bias long when
- Reference it in your entries: require
news_biasequals1on a long,-1on 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.
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".