DocsGuidesBuild a rules-based index

Build a rules-based index

Wire up the canvas node by node: universe, screen, selection, weights.

A basket index holds the list you gave it. A rules-based index works the other way round: you describe the rule — the fifty largest US companies, equally weighted, refreshed every January — and the platform works out the list for you, at every rebalance, using the data as it stood on that day.

This guide builds one of those from an empty canvas, one box at a time. No code, no API keys, no spreadsheet. Budget about forty minutes the first time; the second one takes ten.

If you would rather describe the index in a sentence and have it assembled for you, Build an index by chat does exactly that — and it is worth reading this page first anyway, because it is what the chat produces and what you will be checking.

What you will build

US Top 50 Equal Weight. Every January it takes every US-listed, US-domiciled common stock, looks up what each was worth on that day, keeps the fifty largest, and holds them in equal proportion until the following January. Between rebalances the weights drift with prices, which is what an index does.

It is the simplest honest rules-based index there is, and almost every real methodology is this shape with more steps in the middle.

The vocabulary you need

Five words. Everything on the canvas is one of them, and the guide uses them from here on.

WordWhat it means here
WorkflowThe whole index definition — every box on the canvas plus the settings around it.
NodeOne box. One step. It takes data in on the left, does one job, passes data out on the right.
TriggerThe node that decides when the rest runs. A rebalance is just the trigger firing.
UniverseThe securities that are members of the index at a point in time.
WeightingHow much of each member, as a fraction of the index. Holdings are the same thing turned into share counts at that day’s prices.

Read the flow right to left when you are stuck

An index is ultimately a set of holdings. Holdings come from weights, weights come from a list of securities, and that list comes from a screen applied to some data on some date. Every node you add exists to get one step closer to that. If you cannot see why a node is there, you probably do not need it.

Before you start

  • An Index One account — registration is self-serve at indexone.io/register.
  • Nothing else. The market data this index runs on comes with the platform.
  • Optional but useful: Core concepts open in a second tab.

Step 1 — Open a blank canvas

  1. 1

    Go to Index Studio

    In the left-hand navigation rail, click Index Studio. The page is titled Index Builder: a canvas on top, and a results area below that fills in once you have run something.

  2. 2

    Choose Start from Scratch

    The template picker opens by itself. Take the Start from Scratch card — the one tagged Blank. You get an empty canvas. (If the picker is already closed, the round + button in the toolbar has Load Example, which reopens it.)

  3. 3

    Find the four controls you will actually use

    The round + in the toolbar holds Load Example, Index Params, Request Context, JSON Editor, Settings, Run Backtest and Create Live Index. Next to it is the Add Node button. Bottom-left of the canvas are zoom controls plus Tidy layout and Describe workflow.

Turn on Describe workflow now, not later

The lightbulb button at the bottom-left of the canvas writes a one-line caption under every node saying what that node does in plain English. Leave it on while you build: it is the fastest way to catch a node that is not doing what you assumed.

How to add and wire a node

Learn this once and the rest of the page is just a list of nodes to add.

To do thisDo this
Add the first nodeClick Add Node in the toolbar and pick an operation from the catalog. It lands unconnected.
Add the next node in the chainHover the node you want it to follow and click the dashed + floating off its right edge. The new node arrives already wired and with its main data input already pointing at that node.
Add a second node fed by the same oneThe dashed + disappears once a node’s output is wired. Drag from the small dot on its right edge onto the left edge of the new node instead.
Insert a node between twoHover the wire connecting them and click the + that appears on it.
Edit a nodeClick it, or hover it and click the pencil in the little toolbar above it.
Copy or delete a nodeThe same hover toolbar: the copy icon duplicates it, the ✕ removes it.
Straighten out the messClick Tidy layout at the bottom-left. Node positions are cosmetic — nothing about the index changes.

Always build left to right with the dashed +

Adding a node that way fills in its main data input for you. Adding one from the toolbar and wiring it afterwards connects the boxes visually but leaves that input empty — and a node with an empty data input either fails or, worse, quietly computes on nothing. If you wire by dragging, open the node afterwards and check its Data field actually names the node upstream.

Opening a node gives you three columns. Input on the left is what arrived from upstream. Parameters in the middle is what you set. Output on the right is what this node produced — real rows, from a real run. You can drag a column heading out of Input or Output and drop it into a parameter field to point at it.

Output fills in because the editor keeps a live preview running as you build: every change re-runs the graph for a single date. That date is Request Context → time, which starts at yesterday. Everything you see while building is one snapshot — one rebalance — not the whole history.

Step 2 — The trigger: when it rebalances

  1. 1

    Add a Trigger

    Click Add Node, search trigger, and pick Trigger. It is the only node with nothing feeding it.

  2. 2

    Set the schedule

    Open it. The Custom Schedule builder at the bottom is the plain-English way in: set it to fire once a year, on 1 January. Preset Schedules at the top covers the common cadences in one click, and Active Schedule shows you what the current setting means in words plus the next few dates it would fire.

  3. 3

    Leave the trading-day alignment alone

    Below the schedule are the alignment settings, already set to the New York calendar, the preceding trading day, at the close. That is what turns "1 January" — a market holiday — into the last session that actually traded. Change the calendar if your index is not American.

Why a rebalance date is never quite the date you asked for

Markets are shut on 1 January, and on plenty of other days you might pick. Alignment moves each firing to the nearest real session and stamps it at that session’s close, so the index is always priced on a day that has prices. See Dates & calendars for the full rules.

Step 3 — The universe: which securities are in scope

Click the dashed + on the trigger and add Core Securities Reference Data. This is the platform’s register of instruments — around 250,000 of them — and it is where every rules-based index starts. On its own it returns far too much, so you narrow it with filters.

Open the node and add four filters in the Filters section. Each one is a field, an operator and a value:

FieldOperatorValueWhat it removes
micinXNYS, XNASEverything not listed on the NYSE or Nasdaq.
security_typeeqCommon StockFunds, ETFs, preferred lines, warrants, depositary receipts.
exchange_countryeqUSForeign listings that slipped through.
domicile_countryeqUSForeign companies with a US listing — the difference between a US market index and a US companies index.

In Attributes, ask for id, symbol, name and sector. id is the platform’s own identifier and the one everything downstream matches on; the other three are there so you can read the preview and recognise what you are looking at. Leaving Attributes empty returns every column, which is slower and no more useful.

The Output column should now show a few thousand rows. If it shows none, one of the filter values is wrong — fix it here before you build anything on top.

Discovering the values a column actually takes

Do not guess. Add the column to Attributes, let the preview run, and read the real values in the Output pane — sector and industry especially. A filter on a value that does not exist matches nothing and fails silently until you notice the index is empty.

Survivorship bias, in one paragraph

This node knows which securities were listed on the date being calculated, so a backtest of 2020 sees the companies that existed in 2020, including ones that have since been taken over or delisted. That is the point. An index built from today’s list of companies and run backwards only ever holds the survivors, and it will look far better than it had any right to.

Step 4 — The data the rule needs

The rule is "the fifty largest", so the index needs a market capitalisation for each of those thousands of companies, as it stood on the rebalance date. Click the dashed + on the securities node and add i1 Core Realtime Quote.

  1. 1

    Point it at the securities

    The Data field under Identifiers should already read us_stocks.output#id — the id column of the node before it. If it is empty, drag the id column heading out of the Input pane and drop it there.

  2. 2

    Set the date to the run date

    Put {"$ref": "context.request_context.time"} in the Date field. That is the one piece of punctuation in this guide, and it means whatever date this rebalance is for rather than a fixed day.

  3. 3

    Ask for the one column you need

    In Attributes, select marketCap. date and id always come back.

The mistake that quietly ruins a backtest

The securities register also carries a market_cap column, and it is tempting to filter on that directly and skip this node. Do not. That column is today’s market cap — the current state of the company — so using it would select the companies that are large now for a rebalance in 2020. This node, with its date set to the run date, gives you the market cap as it stood on that day. Point-in-time data is the entire difference between a backtest and a fantasy.

Step 5 — The selection: keep the biggest fifty

Dashed + on the quote node, add Filter Dataset. One filter: field marketCap, operator top_n, value 50.

top_n sorts by that column and keeps the top however-many — the whole of "the fifty largest", in one row of a form. The Output pane should now show exactly fifty rows. Scroll it: those are your index members, and you should recognise most of the names.

Rules that need an ordering, not a cut-off

top_n and bottom_n cover most selections. When you need the rank itself — to weight by it, to apply a buffer, or to combine several factors — add a Rank node before the filter and cut on the rank column instead. Run a systematic strategy is that pattern in full.

Step 6 — Record the membership

Dashed + on the filter, add Create Index Universe. Set Universe to top_50.output#id (again, the id column of the node before it) and Identifier to id.

This node stores who was a member at this rebalance. It is not strictly required to get a value series, but it is what makes "what did this index hold in January 2022, and what changed in January 2023" a question the platform can answer.

Step 7 — The weights

The weighting node needs the fifty selected rows, so it hangs off the filter, not off the universe node. The filter’s dashed + is gone now that its output is wired — so drag a wire from the dot on the filter’s right edge onto the left edge of a new node instead, then choose Create Index Weighting.

  1. 1

    Check the Data field

    Under Input, Data must name the filter node. This is the wiring that the dashed + would normally have done for you — with a dragged connection, set it yourself.

  2. 2

    Set the scheme

    Under 1 · Weighting, set Scheme to equal. That is 1/N: fifty names, 2% each. Nothing else in that section applies to equal weighting.

  3. 3

    Set the ID attribute

    ID Attribute is id — the column holding the security identifier.

To weight bySet Scheme toAnd
Equal amountsequalnothing else.
Market capitalisationproportionalValue Column = marketCap.
The square root of market cap (a gentler tilt)powerValue Column = marketCap, Power = 0.5.
The inverse of a risk measureinverseValue Column = your volatility column.
Position in a ranking, not the raw numberrankSort By = the column to rank on.
Weights you supply yourselfcustomValue Column = your weight column — used exactly as written, so it must add to 1.

Caps and floors come later, and on purpose

The scheme produces raw weights; caps, floors and leverage are applied afterwards as constraints, in the same node. Leave them off for now — a 20% cap on an equal-weighted fifty-stock index does nothing anyway.

Step 8 — The holdings

Dashed + on the weighting node, add Create Index Holdings. Its Weighting field should already point at the weighting node. There is nothing else to set.

This is the node that turns 2% of the index into so many shares of Apple, at that day’s prices. Those share counts are what the index is actually made of: they are what gets valued at every session close until the next rebalance, and they are what makes splits and dividends work properly. Without this node you have a set of percentages and no index.

Step 9 — The index settings

Open the round + and choose Index Params. These belong to the index as a whole rather than to any node.

FieldWhat to put
Index NameSomething you will recognise in a list later.
Start TimeWhen the history begins. 2019-12-31 00:00:00 gives you a run from the start of 2020.
Start Value1000 is the convention and makes the chart readable at a glance: 1250 means up 25%.
CurrencyWhat the index is valued in. Holdings in other currencies are converted for you.
Exchange CalendarWhose trading days it runs on — XNYS here. Match it to the trigger.
Timezone, EOD TimeWhen the daily close is taken. US/Eastern and 16:00:00 for a US index.
Dividend PolicyLeave the defaults and you get both a price-return and a total-return series, which is what you usually want to report.

Start Time on a rebalance date

A new index also rebalances on its start date (Rebalance on start date, beside Start date), so it begins on its Start Time. Put the start on a date the trigger fires anyway — the close an annual January trigger fires on, 31 December here — so the start and that rebalance are one. With the switch off, the index waits for the first firing: an annual January trigger and a start time in March lose most of a year.

Step 10 — Run the backtest

Open the round + and choose Run Backtest. Progress streams into the top-right of the canvas while it works through the history — firing the trigger at each rebalance, re-running your whole graph as of that date, then valuing the resulting holdings at every session close in between.

A few years of fifty US names takes well under a minute. If it fails, the message names the node that failed and what was wrong with it; the table at the end of this page covers the common ones.

What the preview was, and was not, telling you

Everything you watched in the Output panes was one date. The backtest is the first time the graph runs at every rebalance in turn, so it is also the first time a date-specific problem can show up — a screen that matched nothing in 2020, say, on data that looks fine today. A green preview is necessary, not sufficient.

Step 11 — Read the results

The results area below the canvas fills in: the value series charted from your start date to today, the usual return and risk statistics, and the holdings behind it — at every past rebalance, not just the latest one.

  1. 1

    Count the holdings first

    Open the first rebalance and count. Fifty rows means the rule did what you think it did. Anything less means securities dropped out somewhere upstream, and a chart drawn from a partly-invested index is wrong in a way that is invisible.

  2. 2

    Check the rebalance dates

    They should be the first trading session of each January and nothing else. An unexpected date means the trigger is not saying what you thought.

  3. 3

    Add a comparison

    Click Compare and search for an index or an ETF — SPY for this one. It is drawn on the same axes and folded into the statistics. This is usually the point of the exercise, so do it before you write anything up.

  4. 4

    Download the data

    Download gives you three CSVs: Values (the index level per day, plus anything you compared against), Current Holdings (the book as held now), and Holdings History — every stored book stacked into one table, which is what you want for turnover and attribution.

Optional — make it live

A backtest is a one-off simulation that ends when you close the page. Create Live Index, from the same + menu, stores the workflow and keeps it calculating: the trigger fires on its schedule from here on, the index gets an id, and its values are readable over the API, chartable on a page, and publishable in the public directory.

The finished graph

rebalance
us_stocks
market_caps
top_50
universe
weights
holdings
US Top 50 Equal Weight — seven nodes, left to right.
Drag to pan, and select a node to see its configuration.
  1. The trigger fires once a year, aligned to the preceding New York session close. Everything downstream re-runs as of that moment.
  2. The securities register returns every US-listed, US-domiciled common stock that was listed on that date.
  3. The quote node attaches each one’s market capitalisation on that date.
  4. The filter keeps the fifty largest.
  5. The universe node records those fifty as the members of the index at that rebalance.
  6. The weighting node gives each of them 1/50th of the index.
  7. The holdings node converts those weights into share counts at that day’s prices — and those share counts are what the platform values at every session close until the next rebalance.

The same graph as text

The JSON Editor in the + menu shows the whole workflow as structured text. You never have to touch it, but it is the quickest way to copy an index to a colleague, to diff two versions, or to paste a methodology into a document. It is also exactly what the API and the MCP server accept — see Build and backtest an index.

Variations worth trying

Each of these is one change to the index you just built.

IdeaThe change
Market-cap weighted instead of equalWeighting Scheme → proportional, Value Column → marketCap.
Rebalance quarterlyTrigger schedule → the 1st of January, April, July and October.
A sector indexOne more filter on the securities node: sector eq the sector you want. Read the exact spelling off the Output pane first.
Top 100 rather than 50The filter’s top_n value → 100.
Exclude the very largestAdd a Rank node on marketCap after the quote node, then filter the rank column to between 11 and 60.
Screen out illiquid namesA filter on avg_total_volume in the securities node, before the selection.
Weight by something you calculatedInsert a node that produces the column — Return Calculator, Volatility, Z-Score — between the quote node and the filter, then point the weighting’s Value Column at it.
Drive the universe from your own listReplace the securities node with a dataset — Build a basket index covers uploading one.

When something looks wrong

What you seeWhat it usually is
A node’s Output pane is emptyIts filters match nothing, or the node above it produced nothing. Work upstream until you find the first empty one — that is the broken one, not the one that reported the error.
Fewer holdings than you selectedSecurities with no price on the rebalance date. Check the quote node’s output for blanks before blaming the weighting.
“Universe resolved to 0 ids”The selection produced no rows at that run date. The wiring is fine; the screen is too tight, or a filter value does not exist in the data.
A node fails with an empty data inputIt was wired by dragging and its Data parameter was never set. Open it and point Data at the node upstream.
The backtest starts later than you expectedRebalance on start date is off in the index parameters, so the index waits for its first firing.
The index barely movesWeights that do not add up — usually a custom scheme with a column that is not normalised.
Everything looks right but the returns look too goodCheck you are not screening on a current-state column such as market_cap from the securities register instead of the point-in-time quote.

Still stuck: Support in the left-hand rail, or contact@indexone.io.

Where to go next