Builder guide

A strategy is a tree of blocks. Money flows from the top of the tree down to the tickers at its tips, and each block decides how its share is divided.

Blocks#

BlockWhat it does
TickerSomething to hold, such as SPY.
WeightSplits money between the blocks inside it.
If / ElseChecks conditions and sends money to one of two branches.
Enter / ExitHolds one branch from the day an entry rule fires until an exit rule fires.
RankScores its candidates by one reading and keeps the top or bottom few.
GroupA named part of the tree, to keep large strategies organized.
StrategyUses another of your saved strategies as a building block.

Weight#

A Weight block divides its money in one of three ways:

  • Equal: every block inside gets the same share.
  • Specified: you type the percentages. Anything under 100% stays in cash.
  • Inverse vol: calmer holdings get more. Each share is proportional to one over the holding's recent volatility.

An empty Weight means cash. Cash earns nothing in a backtest; to earn a short-term Treasury return, hold a fund such as BIL.

If / Else#

An If / Else block checks one or more conditions. When they hold, money goes to the first branch; otherwise it goes to the second. With several conditions you choose whether all, any, or at least a number of them must hold.

Each condition compares a reading with a number or with another reading:

  • The left side reads one ticker (for example, QQQ's 200-day moving average), a ratio of two tickers' prices, or the rolling correlation of a pair of tickers.
  • The comparison is is above, is below, is at least, or is at most.
  • The right side is a number or another reading. A reading can be scaled with a multiplier, for example price is above 1.05 × moving average.
  • Confirm for a number of days makes the condition hold only after it has been true that many days in a row.

Numbers follow the reading's own scale, and the editor shows a hint under each value. Returns and volatility are decimals (−0.05 means −5%, 0.20 means 20%); a VIX level is in percentage points (20 means 20%).

Enter / Exit#

An Enter / Exit block holds its active branch from the day its entry rule fires until its exit rule fires, then holds the inactive branch. If both fire on the same day, entry wins. It starts inactive. This suits rules such as "buy when RSI drops below 30 and hold until it rises above 70". It is available for strategies that rebalance daily.

Rank#

A Rank block scores every candidate by one reading over a lookback, such as three-month return, and keeps the top or bottom few. Candidates can be single tickers or whole Weight blocks, which are scored by their own simulated value over time. The kept candidates are weighted equally, by percentages, or by inverse volatility. If fewer candidates have a score than you asked for, the survivors share the money, or you can keep the missing share in cash.

Strategy#

A Strategy block reuses one of your saved strategies inside another. You can pin a specific version, so later edits don't change the result, or follow the latest version. The saved strategy must use the same rebalance schedule.

Indicators#

Every reading uses only prices up to the day it is read.

IndicatorWhat it measuresValues
Current priceThe latest adjusted closing price.price
Moving averageArithmetic mean of closing prices over the selected window.price
Exponential moving averageExponentially weighted closing-price average, seeded with an initial simple average.price
Ultimate SmootherEhlers two-pole price smoother using full causal history, seeded at the current close after missing observations.price
Cumulative returnCompounded close-to-close return over the selected horizon.decimal · −0.05 = −5%
RSIWilder relative strength index over the selected period, on a 0–100 scale.0–100
Trend ClarityRolling linear-trend R-squared of closing prices, on a 0–100 scale. Both rising and falling linear trends score highly; a constant window scores 100.0–100
VolatilityAnnualized population volatility of daily returns over the selected window.decimal · 0.20 = 20%
1/3/6/12-month weighted momentumWeighted average of 1-, 3-, 6-, and 12-month returns using 12/4/2/1 weights.decimal · −0.05 = −5%
1/3/6/12-month unweighted momentumEqual-weighted average of 1-, 3-, 6-, and 12-month returns.decimal · −0.05 = −5%
13-point relative SMA momentumCurrent close divided by the average of 13 monthly-spaced closes, minus one.decimal · −0.05 = −5%
30-month optimal trend scoreTrend score from thirty monthly returns with two-exponential weighting.decimal · −0.05 = −5%
Rolling-high ratioCurrent close divided by the highest close in the selected window.ratio
Maximum drawdownLargest peak-to-later-trough loss inside the selected window.percentage points · 5 = 5%
Mean daily returnArithmetic mean of daily returns over the selected window.decimal · −0.05 = −5%
Absolute changeCurrent close minus the close at the selected horizon.price
21-session change z-scoreCurrent 21-session price change divided by the trailing sample deviation of 21-session changes.standard deviations
Shock cooling (63-session baseline, 21-session cooling)Binary cooling flag after a two-standard-deviation loss versus its preceding 63 sessions.0 or 1
Internal bar strengthClose position within the completed daily high–low range: (close − low) / (high − low).ratio
Aroon-UpRecency of the latest highest high within the selected period, on a 0–100 scale.0–100

Rebalancing and costs#

Open the strategy settings to choose:

  • Rebalance schedule: how often the rules are checked and trades can happen.

Daily, Weekly, Monthly, Quarterly, Yearly.

  • Rebalance rule: Allocation changed trades only when the rules want different weights than last time. Always rebalance restores the target weights on every scheduled date. Drift threshold trades only when a holding has moved too far from its target.
  • Slippage: a cost charged on every trade, in basis points of the amount traded. The default is 5 (0.05%).
  • Benchmark: a ticker, SPY by default, or one of your saved strategies. The backtest compares against it over the same dates.

Saving and versions#

Save keeps a new version of your strategy. Earlier versions don't change, so a result can always be traced to the exact rules behind it. The workspace lists your strategies with their latest results.

Limits#

  • Lookback windows up to 1,250 trading days (RSI up to 252).
  • A condition can require up to 252 days in a row.
  • A Rank can choose from up to 80 candidates.
  • Up to 80 tickers can be held, and up to 120 referenced, across one strategy.
  • Up to 2,000 blocks, nested up to 64 levels deep.

Some things a strategy can't express today:

  • Selling short or borrowing. Leveraged funds are fine as ordinary holdings.
  • More than one rebalance schedule in one strategy.
  • Assets other than US-listed stocks and funds, such as futures.
  • Portfolio optimization beyond equal, specified, and inverse-volatility weights.