Custom Ratio Functions

Open the Custom Ratios builder

EXCLUDE(base, member)

Insert

The index without one member. The remaining members are renormalized.

  • base The index to adjust: a saved weighted-sum ratio by its single-word link (like MAG7), or an ETF whose holdings Darwin has (like SPY).
  • member A single ticker that is one of the base's holdings. You can't exclude the last member.
  • Example: EXCLUDE(SPY, NVDA) is SPY as if NVDA had not been in it.
  • Example: EXCLUDE(MAG7, TSLA) is the Magnificent 7 without Tesla.

REWEIGHT(base, member, factor)

Insert

The index with one member's weight multiplied by a factor. The rest are renormalized.

  • base The index to adjust: a saved weighted-sum ratio by its single-word link (like MAG7), or an ETF whose holdings Darwin has (like SPY).
  • member A single ticker that is one of the base's holdings. You can't exclude the last member.
  • factor A plain non-negative number with no upper limit: 2 doubles the member's weight, 0.5 halves it, and 0 drops it (the same as EXCLUDE). No arithmetic or minus sign.
  • Example: REWEIGHT(MAG7, NVDA, 2) is the Magnificent 7 with NVIDIA at double weight.
  • Example: REWEIGHT(SPY, AAPL, 0.5) is SPY with Apple at half weight.

MCAP(ticker)

Insert

A ticker's market cap over time. Use it anywhere in a formula, like a ticker.

  • ticker One stock, ETF or crypto ticker (not a saved ratio or an expression). Its market cap at each point in time: price × shares outstanding then for a stock (a share class counts the whole company, so MCAP(GOOGL) is all of Alphabet), price × units, i.e. its assets, for an ETF, and price × circulating supply for a crypto token (its max or total supply only when it has no circulating-supply history).
  • Example: MCAP(NVDA) / MCAP(AMD) is NVIDIA's market cap as a multiple of AMD's.
  • Example: (MCAP(MARA) + MCAP(RIOT)) / MCAP(BTC) is two bitcoin miners' combined market cap against bitcoin's.

Rules

  • An EXCLUDE or REWEIGHT call must be the whole formula. It can't be combined with other terms, like EXCLUDE(SPY, NVDA) / BTC, or nested inside another function.
  • For a saved index like MAG7, the remaining members are renormalized so the basket keeps its original total weight.
  • For an ETF like SPY, the result is computed from the ETF's published holdings when the chart loads, rebased to the start of the chart window.
  • MCAP works anywhere in a formula, like a ticker: MCAP(NVDA) / MCAP(AMD), or (MCAP(CRWV) + MCAP(NBIS)) / MCAP(MSFT). Its value is in dollars.
  • A formula built with MCAP already charts market caps, so its chart shows that line only, with no Price / Mkt Cap switch. A single market cap or a sum of them reads in dollars, like $4.40T; a ratio of market caps is a plain number.
  • MCAP needs a market cap Darwin has. A ticker with no share count, like a depositary listing, or no supply, like a macro series, can't be used in MCAP.

Arithmetic

  • Operators: + - * / with normal precedence, and a leading minus. There is no ^.
  • Parentheses: Group terms: (NVDA + MU) / QQQ.
  • Numbers: Plain decimals like 3 or 0.5. Write 0.5, not .5; exponents like 1e5 aren't supported.
  • Tickers: Any case. Class shares use a dot (BRK.B), and tickers that start with a digit (1INCH) work. A saved ratio with a single-word link, like MAG7, works as a ticker.

Limits

  • Up to 200 characters and 10 different tickers.
  • Up to 5 saved ratios referenced in one formula.
  • Once saved ratios are expanded: up to 16 underlying assets and 64 terms.

Read the Full Guide to Custom Ratios