TrueData TrueData Sheets
search
Searching...
functions Formulas
menu_book Pages
manage_search Content Match
search_off

No results for ""

Loading Content
insights

Analytics, UI & Logging

Use TD.Analytics inside TD.onStart. Always await. One-shot REST — never loop or poll (Rule 17).

warning Most Analytics functions use segment "EQ" — note this is different from the "NSEEQ" / "BSEEQ" used by Historical top gainer/loser calls. The two OI functions take no segment parameter at all. records[0] is always the header row.

1–2. getIndexGainers / getIndexLosers

const gainers = await TD.Analytics.getIndexGainers({
  indexName: "NIFTY 50",
  segment: "EQ",
  top: 10,
});

const losers = await TD.Analytics.getIndexLosers({
  indexName: "NIFTY 50",
  segment: "EQ",
  top: 10,
});
Response header (same for both)
["Symbol","Series","Timestamp","LTP","PClose","Tick Vol","Tot Vol",
 "Bid","Bid Qty","Ask","Ask Qty","TTO"]

3–4. getIndustryGainers / getIndustryLosers

Available industries: Diversified, Consumer Durables, Healthcare, Textiles, Information Technology, Telecommunication, Financial Services, Automobile and Auto Components, Oil Gas & Consumable Fuels, Capital Goods, Construction, Metals & Mining, Consumer Services, Forest Materials, Media Entertainment & Publication, Chamicals, Services, Power, Fast Moving Consumer Goods, Realty.

const gainers = await TD.Analytics.getIndustryGainers({
  industry: "Healthcare",
  segment: "EQ",
  top: 10,
});

const losers = await TD.Analytics.getIndustryLosers({
  industry: "Healthcare",
  segment: "EQ",
  top: 10,
});
// Response header same as getIndexGainers

5–6. getMostActiveByTurnover / getMostActiveByVolume

const byTurnover = await TD.Analytics.getMostActiveByTurnover({
  indexName: "NIFTY 50",
  segment: "EQ",
  top: 10,
});

const byVolume = await TD.Analytics.getMostActiveByVolume({
  indexName: "NIFTY 50",
  segment: "EQ",
  top: 10,
});

7–8. getOIGainers / getOILosers

warning No segment parameter on these two. Use series: "CE" or "PE".
const gainers = await TD.Analytics.getOIGainers({
  series: "CE",
  top: 10,
});

const losers = await TD.Analytics.getOILosers({
  series: "PE",
  top: 10,
});
Response header (same for both)
["Symbol","Expiry","Strike","Series","TD Symbol","Timestamp","Open","High",
 "Low","LTP","PClose","OI","POI","Tick Vol","Tot Vol","TTO","Bid","Bid Qty",
 "Ask","Ask Qty","Delta","Gamma","Theta","Vega","Rho","IV","OI Chg %"]

UI Utilities — TD.UI

Show a toast alert to surface success or failure to the user.

await TD.UI.showAlert("Your message here", "success");

Alert types: "success", "error", "info", "warning".

Logging — TD.log

Use TD.log() for all debug output instead of console.log(). It appears in the built-in console panel and is preserved in the session log.

TD.log("Any value:", someVariable);
Truedata Icon Sheets by Truedata

Empowering traders and analysts with high-performance real-time market data directly within their spreadsheets.

© 2026 TrueData Market Data Services LLP. All rights reserved.