← Back to Documentation

Strategy Builder

Strategy Builder defines multiple allocation rules and switches between them when their signals change state. Use it when the question is about rule-driven portfolio changes over time.

Open Strategy Builder →

Use this when

Use Strategy Builder when the portfolio should hold different things in different market states. For example, equities while a trend signal is on, bonds otherwise. You define ordered rules and the engine switches between them.

Good for

  • Rule-based regime switching with one or two signals.
  • Ranked rotations across a small universe (top-N momentum, dual momentum, etc.).
  • Comparing how different signals would have changed when the strategy traded.

Reach for a different tool when

Strategy Builder walkthrough

Walkthrough
  1. Start with the market question and the signal that changes the allocation.

  2. Build rules in priority order, with a fallback rule at the bottom.

  3. Run the strategy, inspect state transitions, then validate the saved strategy in Portfolio Backtest.

First run

Quickstart
  1. Define the scenario

    Set date range, benchmark, trading frequency, and initial capital.

  2. Build rules

    Add the risk-on rule first and a fallback rule last.

  3. Review advanced settings

    Use cooldown, lag, and ranked rules only when the question requires them.

  4. Run and validate

    Inspect state changes before reusing the strategy in Portfolio Backtest.

Configuration Guide

Strategy Builder settings define when the portfolio is allowed to change state and what it holds in each state. The important question is whether each rule expresses a defensible decision, not whether the form is filled out.

Set the dollar scale and price mode

The scenario row anchors what every dollar figure in the result represents.

Strategy Builder scenario row with starting principal and price-mode fields highlighted
  1. Starting principal: The dollar amount the strategy starts with. Drives the scale of every value, drawdown, and cashflow chart.

  2. Price mode: Total return includes distributions; raw prices keep them separate. Most rule-driven strategies want total return.

Choose the backtest window

The window decides which market regimes your rules get tested against.

Strategy Builder date-range row with start and end pickers highlighted
  1. Backtest window: Span at least one major drawdown when you can. A calm window flatters rule-based strategies.

Order the rules from most specific to fallback

Rules evaluate top-to-bottom, and the first match wins.

Strategy Builder rule cards showing ordered conditions and per-rule allocations
  1. Risk-on rule: The condition you most want to hold under. Put narrower conditions higher in the list.

  2. Fallback: The last rule has no condition. It catches every state none of the earlier rules described.

Make execution explicit

The defaults are reasonable, but a high-frequency strategy needs costs set realistically.

Strategy Builder trading settings panel with cadence, transaction cost, and slippage fields
  1. Cadence and cost: Evaluation frequency, per-trade cost, slippage, and the inflation lens applied to charts.

Validate parameters out-of-sample

Walk-forward retrains on rolling train windows and evaluates on the next test window.

Strategy Builder walk-forward validation fields including train, test, and step size
  1. Train / test windows: Lengths of the rolling fit window and the unseen evaluation window.

  2. Step and handling: How far to roll between iterations and what to do when a window has too little data.

ConfigurationWhat It MeansWhy It Matters
ScenarioDate range, benchmark, principal, and shared execution assumptions for the strategy run.These settings define the historical test bed used to judge every rule transition.
Rule orderRules are evaluated from top to bottom; the first active rule wins.Ordering is part of the strategy logic. A broad rule above a specific rule can prevent the specific rule from ever firing.
Fallback ruleThe allocation used when no earlier signal is active.Without a fallback, the strategy can have undefined behavior during regimes that do not match the signal set.
Signal definitionThe condition that turns a rule on, such as trend, momentum, volatility, macro, calendar, or composite logic.Signal design determines when trades happen. Small threshold or lookback changes can materially alter state history.
Trading frequencyHow often the strategy can evaluate and switch rules.Higher frequency reacts faster but can increase whipsaw, turnover, taxes, and slippage.
Lag and cooldownControls that delay execution or prevent rapid repeat switching.These settings make the test more implementable, but they also change the timing of every transition.
Ranked allocationA dynamic rule that selects assets from a universe by a ranking metric.Ranking adds another model layer: universe, metric, lookback, selection count, and fallback all affect holdings.

Common pitfalls

  1. Forgetting a fallback rule

    Without a fallback, the strategy has undefined behavior in regimes none of your conditions describe. Always end the rule list with a fallback.

  2. A broad rule above a specific rule

    Rules evaluate top to bottom; the first match wins. Order from most specific to fallback, otherwise narrower rules never fire.

  3. High trading frequency without realistic costs

    A daily-evaluation strategy that turns over weekly looks great until you set transaction cost and slippage. Set both before drawing conclusions.

  4. Tuning thresholds until in-sample looks good

    Run the in-sample / out-of-sample holdout. If the OOS table is much worse, you've overfit the threshold to a single regime.

What you'll see in the result

  • Equity curve: Strategy and benchmark value through time. Look at recoveries, not just endpoints.
  • Rule timeline: Which rule was active each day. Frequent flipping suggests a noisy signal or a threshold near the boundary.
  • Trading stats: Transition count, time in each rule, and aggregate trading cost. High cost can quietly erase a strategy's edge.
  • Rule attribution: How much each rule contributed to total return. If one rule dominates, the others may not be earning their place.
  • Signal history: The numeric indicator value, threshold lines, and boolean state for each atomic signal. Match the chart to the rule timeline to verify decisions.

Features

  • Composite signals with AND/OR/NOT logic
  • Regime-based allocation switching
  • rules that pick the top or bottom N tickers from a universe by a ranking metric
  • Trading frequency and cooldown controls to reduce
  • Signal state timeline visualization
  • In-sample / out-of-sample holdout split with per-slice metric tables
  • Save and share tactical configurations

When To Use It

  • Use Strategy Builder when you want to switch between different holdings based on a signal or rule set.
  • Use Signal Analyzer first if you still need to test whether an indicator has a relationship with a later outcome.
  • Use Portfolio Backtest when the portfolio does not change state based on signals.

Core Concepts

  • Allocation rule: a named asset mix whose weights sum to 100%.
  • Signal: a boolean condition that determines whether a rule is active.
  • Rule order: rules are checked from top to bottom. The first rule whose signal is true becomes active.
  • Fallback rule: the last rule should have no condition. It is used when no earlier rule is active.
  • Trading frequency: how often the engine can switch between rules.
  • Execution lag: rule changes trade no earlier than the next trading day. Same-day execution is not modeled in Strategy Builder backtests.
  • Ranked rule: an allocation rule that, instead of fixed weights, picks the top or bottom N tickers from a universe by a ranking metric every rerank row.

Ranked Allocation

Any rule can pick tickers dynamically instead of using fixed weights. Change the rule's allocation type to ranked and configure the universe, the ranking metric, the lookback, and how selected tickers are weighted. On every rerank row the engine scores the universe, drops any ticker that fails optional score thresholds or has insufficient price history, takes the top or bottom N, and forward-fills the selection until the next rerank.

  • Universe: 2 to 29 plain tickers to rank. The fallback is separate, so the total pool is up to 30.
  • Metric: total return, volatility, price-over-SMA ratio, or RSI. The same metric applies to every ticker in the universe.
  • Lookback: primary window in trading rows, with up to three optional secondary lookbacks. Scores are averaged across lookbacks, or combined with per-lookback weights when specified (for example the 12/4/2/1 weighting used by VAA, BAA, and HAA strategies).
  • Select and N: hold the top or bottom N tickers after sorting by score.
  • Weighting: equal weight across the selected tickers, or inverse-volatility weighting proportional to 1 / annualized volatility over the primary lookback.
  • Score thresholds: optional min and max scores that exclude tickers before selection. Useful for absolute-momentum filters that fall to cash when nothing passes.
  • Fallback ticker: held 100% whenever zero tickers survive filtering.
  • Rerank cadence: follows the strategy's trading frequency (monthly reranks every 21 trading rows, quarterly every 63, etc.). Between reranks the selection is forward-filled.

Ranked rotations count as rebalance events, so trading-cost and slippage haircuts apply on the decision row the same way they do for fixed-weight rule transitions. What-if price overrides cannot target ranked universe or fallback tickers.

Build A First Rule Set

  1. Add a Risk-On rule with the assets you want to hold when the signal is true.
  2. Add a fallback rule with the assets you want to hold when the signal is false.
  3. Choose one signal, such as price above or below a moving average.
  4. Set the date range, principal, benchmark, and trading frequency.
  5. Run the analysis and review the equity curve, transition count, drawdowns, and rule timeline.

A good first build is one risk-on rule, one fallback rule, and one signal. Add more conditions only when the research question requires them.

Main Inputs

  • Date range: historical sample used in the run.
  • Principal: starting portfolio value.
  • Benchmark: reference series used for comparison.
  • Trading frequency: daily, weekly, biweekly, monthly, quarterly, or annual switching cadence.
  • Trading costs and slippage: implementation costs applied to rule transitions.
  • Cashflows: recurring or one-time contributions and withdrawals.
  • In-sample / out-of-sample holdout: optional split date used to show separate metric tables for the in-sample window and the later out-of-sample window of the same realized strategy run.

Signal Types

Strategy Builder supports atomic signals and composite operators:

  • Trend: moving average and related price-based rules, including dual-moving-average hysteresis
  • Momentum: return momentum, composite momentum, and relative strength
  • Volatility and risk: VIX, volatility, RSI, drawdown, and correlation rules
  • Macro and calendar: yield curve and date-based filters
  • Composites: AND, OR, and NOT over other signals

Results Panels

  • Equity Curve: portfolio and benchmark value through time.
  • Trading Stats: transition count, time in each rule, and trading costs.
  • Metrics: return and risk summary statistics.
  • Monthly Returns Heatmap: monthly and annual return breakdowns.
  • Rule Attribution: return contribution by rule.
  • Condition Stability: signal and rule behavior through time.
  • Signal History: historical time-series of each atomic signal's numeric indicator value and boolean state. Threshold lines and transition markers show how signal evaluations align with rule changes. Uses the same evaluation path as the backtest, so charted values match the decisions the engine made.
  • Ranking: appears when any rule uses ranked allocation. Shows the latest selection and per-ticker scores, when the fallback ticker fired, and the realized rerank history.
  • Current Status: latest fully-observed rule, signal state, and active weights. Use this to confirm the strategy is doing what you expect on the latest data.
  • In-Sample / Out-Of-Sample: paired metric tables for the in-sample window and the later out-of-sample window when a holdout split is enabled.

For a step-by-step debugging workflow, see Debug A Tactical Strategy below.

In-Sample / Out-Of-Sample Holdout

Strategy Builder supports an in-sample / out-of-sample holdout overlay. Choose a split date to compare the strategy's metric table before and after that date on the same realized backtest path.

  • The split does not refit signal thresholds or change rule order, ranked selections, transition timing, costs, or cashflows.
  • The requested date snaps to the nearest trading day on or before the selected date. Both sides need enough trading history; otherwise the result shows a warning instead of partial metrics.
  • For rolling or expanding train/test schedules, use Walk-Forward Validation in the Strategy Builder configuration section.

Debug A Tactical Strategy

When a tactical strategy produces unexpected results, work through these steps:

  1. Open the Strategy Builder with the strategy loaded.
  2. Check the Condition Stability panel. Frequent switching may indicate a noisy signal or a threshold set too close to the boundary.
  3. Check the Rule Attribution panel. If one rule contributes most of the return, the other rules may not be firing at useful times.
  4. Check the Trading Stats panel. High transition counts combined with trading costs may erode performance.
  5. Open Signal Analyzer and test the signal in isolation to see whether it has forward predictive value for the target asset.

Signal Research To Strategy

The typical signal-to-strategy workflow moves through three tools:

  1. Signal Analyzer: test whether an indicator predicts a later outcome. Evaluate hit rate, return spread, and forward-return distributions by signal regime.
  2. Strategy Builder: if the signal shows predictive value, build a tactical strategy that switches allocations based on that signal. Review transition behavior and rule attribution.
  3. Portfolio Backtest: load the tactical strategy into a portfolio allocation and run a full historical backtest with cash flows, rebalancing, and optional tax-aware accounting.

See Signal Analyzer and Portfolio Backtest for the individual tool references.

Glossary

Glossary

Allocation rule
A named asset mix whose weights sum to 100%, evaluated against a condition.
Signal
A boolean condition (trend, momentum, volatility, calendar, etc.) that turns a rule on or off.
Fallback rule
A rule with no condition, placed last. The strategy holds it whenever every earlier rule's signal is false.
First-match-wins
Rules evaluate top-to-bottom; the first rule whose condition is true determines the active allocation.
Whipsaw
Rapid switching between rules driven by a noisy signal. Often costs more than the signal earns.
Cooldown / lag
Controls that delay execution or block repeat switches. Make backtests more implementable but change every transition's timing.
Ranked rule
An allocation that picks the top or bottom N tickers from a universe by a metric, instead of holding fixed weights.
Walk-forward validation
Refit on a rolling train window, evaluate on the next test window. Surfaces whether parameter choices generalize.