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.
| Word | What it means here |
|---|---|
| Workflow | The whole index definition — every box on the canvas plus the settings around it. |
| Node | One box. One step. It takes data in on the left, does one job, passes data out on the right. |
| Trigger | The node that decides when the rest runs. A rebalance is just the trigger firing. |
| Universe | The securities that are members of the index at a point in time. |
| Weighting | How 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
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
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
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
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
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 this | Do this |
|---|---|
| Add the first node | Click Add Node in the toolbar and pick an operation from the catalog. It lands unconnected. |
| Add the next node in the chain | Hover 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 one | The 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 two | Hover the wire connecting them and click the + that appears on it. |
| Edit a node | Click it, or hover it and click the pencil in the little toolbar above it. |
| Copy or delete a node | The same hover toolbar: the copy icon duplicates it, the ✕ removes it. |
| Straighten out the mess | Click Tidy layout at the bottom-left. Node positions are cosmetic — nothing about the index changes. |
Always build left to right with the dashed +
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
Add a Trigger
Click Add Node, search
trigger, and pick Trigger. It is the only node with nothing feeding it. - 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
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
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:
| Field | Operator | Value | What it removes |
|---|---|---|---|
mic | in | XNYS, XNAS | Everything not listed on the NYSE or Nasdaq. |
security_type | eq | Common Stock | Funds, ETFs, preferred lines, warrants, depositary receipts. |
exchange_country | eq | US | Foreign listings that slipped through. |
domicile_country | eq | US | Foreign 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
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
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
Point it at the securities
The Data field under Identifiers should already read
us_stocks.output#id— theidcolumn of the node before it. If it is empty, drag theidcolumn heading out of the Input pane and drop it there. - 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
Ask for the one column you need
In Attributes, select
marketCap.dateandidalways come back.
The mistake that quietly ruins a backtest
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
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
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
Set the ID attribute
ID Attribute is
id— the column holding the security identifier.
| To weight by | Set Scheme to | And |
|---|---|---|
| Equal amounts | equal | nothing else. |
| Market capitalisation | proportional | Value Column = marketCap. |
| The square root of market cap (a gentler tilt) | power | Value Column = marketCap, Power = 0.5. |
| The inverse of a risk measure | inverse | Value Column = your volatility column. |
| Position in a ranking, not the raw number | rank | Sort By = the column to rank on. |
| Weights you supply yourself | custom | Value Column = your weight column — used exactly as written, so it must add to 1. |
Caps and floors come later, and on purpose
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.
| Field | What to put |
|---|---|
| Index Name | Something you will recognise in a list later. |
| Start Time | When the history begins. 2019-12-31 00:00:00 gives you a run from the start of 2020. |
| Start Value | 1000 is the convention and makes the chart readable at a glance: 1250 means up 25%. |
| Currency | What the index is valued in. Holdings in other currencies are converted for you. |
| Exchange Calendar | Whose trading days it runs on — XNYS here. Match it to the trigger. |
| Timezone, EOD Time | When the daily close is taken. US/Eastern and 16:00:00 for a US index. |
| Dividend Policy | Leave 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
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
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
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
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
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
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
- The trigger fires once a year, aligned to the preceding New York session close. Everything downstream re-runs as of that moment.
- The securities register returns every US-listed, US-domiciled common stock that was listed on that date.
- The quote node attaches each one’s market capitalisation on that date.
- The filter keeps the fifty largest.
- The universe node records those fifty as the members of the index at that rebalance.
- The weighting node gives each of them 1/50th of the index.
- 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
Variations worth trying
Each of these is one change to the index you just built.
| Idea | The change |
|---|---|
| Market-cap weighted instead of equal | Weighting Scheme → proportional, Value Column → marketCap. |
| Rebalance quarterly | Trigger schedule → the 1st of January, April, July and October. |
| A sector index | One 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 50 | The filter’s top_n value → 100. |
| Exclude the very largest | Add a Rank node on marketCap after the quote node, then filter the rank column to between 11 and 60. |
| Screen out illiquid names | A filter on avg_total_volume in the securities node, before the selection. |
| Weight by something you calculated | Insert 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 list | Replace the securities node with a dataset — Build a basket index covers uploading one. |
When something looks wrong
| What you see | What it usually is |
|---|---|
| A node’s Output pane is empty | Its 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 selected | Securities 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 input | It 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 expected | Rebalance on start date is off in the index parameters, so the index waits for its first firing. |
| The index barely moves | Weights that do not add up — usually a custom scheme with a column that is not normalised. |
| Everything looks right but the returns look too good | Check 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.