oakscriptjs 0.11.4 → 0.11.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/cjs/index.d.ts +2 -2
  2. package/dist/cjs/index.d.ts.map +1 -1
  3. package/dist/cjs/index.js +2 -1
  4. package/dist/cjs/index.js.map +2 -2
  5. package/dist/cjs/input.d.ts +19 -3
  6. package/dist/cjs/input.d.ts.map +1 -1
  7. package/dist/cjs/input.js +24 -1
  8. package/dist/cjs/input.js.map +2 -2
  9. package/dist/cjs/lib/zigzag/zigzag.d.ts +8 -3
  10. package/dist/cjs/lib/zigzag/zigzag.d.ts.map +1 -1
  11. package/dist/cjs/lib/zigzag/zigzag.js +16 -3
  12. package/dist/cjs/lib/zigzag/zigzag.js.map +2 -2
  13. package/dist/cjs/runtime/index.d.ts +1 -1
  14. package/dist/cjs/runtime/index.d.ts.map +1 -1
  15. package/dist/cjs/runtime/index.js +1 -0
  16. package/dist/cjs/runtime/index.js.map +2 -2
  17. package/dist/cjs/runtime/inputs.d.ts +9 -0
  18. package/dist/cjs/runtime/inputs.d.ts.map +1 -1
  19. package/dist/cjs/runtime/inputs.js +8 -0
  20. package/dist/cjs/runtime/inputs.js.map +2 -2
  21. package/dist/cjs/runtime/types.d.ts +4 -3
  22. package/dist/cjs/runtime/types.d.ts.map +1 -1
  23. package/dist/cjs/runtime/types.js.map +1 -1
  24. package/dist/cjs/script/index.d.ts +35 -3
  25. package/dist/cjs/script/index.d.ts.map +1 -1
  26. package/dist/cjs/script/index.js +40 -4
  27. package/dist/cjs/script/index.js.map +3 -3
  28. package/dist/cjs/security/other.d.ts +2 -1
  29. package/dist/cjs/security/other.d.ts.map +1 -1
  30. package/dist/cjs/security/other.js +1 -1
  31. package/dist/cjs/security/other.js.map +2 -2
  32. package/dist/cjs/ta/index.d.ts +1 -0
  33. package/dist/cjs/ta/index.d.ts.map +1 -1
  34. package/dist/cjs/ta/index.js +1 -1
  35. package/dist/cjs/ta/index.js.map +2 -2
  36. package/dist/cjs/time/index.d.ts +2 -0
  37. package/dist/cjs/time/index.d.ts.map +1 -1
  38. package/dist/cjs/time/index.js +1 -1
  39. package/dist/cjs/time/index.js.map +2 -2
  40. package/dist/cjs/types/index.d.ts +1 -0
  41. package/dist/cjs/types/index.d.ts.map +1 -1
  42. package/dist/cjs/types/index.js.map +2 -2
  43. package/dist/cjs/utils/index.d.ts +5 -3
  44. package/dist/cjs/utils/index.d.ts.map +1 -1
  45. package/dist/cjs/utils/index.js +6 -0
  46. package/dist/cjs/utils/index.js.map +2 -2
  47. package/dist/esm/index.d.ts +2 -2
  48. package/dist/esm/index.d.ts.map +1 -1
  49. package/dist/esm/index.js +2 -2
  50. package/dist/esm/index.js.map +1 -1
  51. package/dist/esm/input.d.ts +19 -3
  52. package/dist/esm/input.d.ts.map +1 -1
  53. package/dist/esm/input.js +24 -1
  54. package/dist/esm/input.js.map +1 -1
  55. package/dist/esm/lib/zigzag/zigzag.d.ts +8 -3
  56. package/dist/esm/lib/zigzag/zigzag.d.ts.map +1 -1
  57. package/dist/esm/lib/zigzag/zigzag.js +19 -4
  58. package/dist/esm/lib/zigzag/zigzag.js.map +1 -1
  59. package/dist/esm/runtime/index.d.ts +1 -1
  60. package/dist/esm/runtime/index.d.ts.map +1 -1
  61. package/dist/esm/runtime/index.js +1 -1
  62. package/dist/esm/runtime/index.js.map +1 -1
  63. package/dist/esm/runtime/inputs.d.ts +9 -0
  64. package/dist/esm/runtime/inputs.d.ts.map +1 -1
  65. package/dist/esm/runtime/inputs.js +15 -0
  66. package/dist/esm/runtime/inputs.js.map +1 -1
  67. package/dist/esm/runtime/types.d.ts +4 -3
  68. package/dist/esm/runtime/types.d.ts.map +1 -1
  69. package/dist/esm/script/index.d.ts +35 -3
  70. package/dist/esm/script/index.d.ts.map +1 -1
  71. package/dist/esm/script/index.js +49 -2
  72. package/dist/esm/script/index.js.map +1 -1
  73. package/dist/esm/security/other.d.ts +2 -1
  74. package/dist/esm/security/other.d.ts.map +1 -1
  75. package/dist/esm/security/other.js +4 -2
  76. package/dist/esm/security/other.js.map +1 -1
  77. package/dist/esm/ta/index.d.ts +1 -0
  78. package/dist/esm/ta/index.d.ts.map +1 -1
  79. package/dist/esm/ta/index.js +3 -1
  80. package/dist/esm/ta/index.js.map +1 -1
  81. package/dist/esm/time/index.d.ts +2 -0
  82. package/dist/esm/time/index.d.ts.map +1 -1
  83. package/dist/esm/time/index.js +4 -1
  84. package/dist/esm/time/index.js.map +1 -1
  85. package/dist/esm/types/index.d.ts +1 -0
  86. package/dist/esm/types/index.d.ts.map +1 -1
  87. package/dist/esm/types/index.js.map +1 -1
  88. package/dist/esm/utils/index.d.ts +5 -3
  89. package/dist/esm/utils/index.d.ts.map +1 -1
  90. package/dist/esm/utils/index.js +5 -1
  91. package/dist/esm/utils/index.js.map +1 -1
  92. package/package.json +1 -1
  93. package/src/index.ts +2 -1
  94. package/src/input.ts +28 -4
  95. package/src/lib/zigzag/zigzag.ts +20 -6
  96. package/src/runtime/index.ts +1 -0
  97. package/src/runtime/inputs.ts +16 -0
  98. package/src/runtime/types.ts +4 -3
  99. package/src/script/index.ts +71 -4
  100. package/src/security/other.ts +5 -2
  101. package/src/ta/index.ts +3 -1
  102. package/src/time/index.ts +4 -1
  103. package/src/types/index.ts +1 -0
  104. package/src/utils/index.ts +8 -3
@@ -18,7 +18,8 @@
18
18
  * holidays, closed hours), gaps off repeats the last value
19
19
  * - gaps on: a value only on the chart bar where the shown bar changes (and on the first chart bar), na on the others
20
20
  * - the last bar while it is open (`lastBarConfirmed` false) with gaps off: the realtime update shows the bar given by
21
- * lookahead on (the open bar of a higher timeframe), with lookahead off as well
21
+ * lookahead on (the open bar of a higher timeframe), with lookahead off as well; a lower timeframe keeps the rules
22
+ * above (the last lower bar so far with lookahead off, the first one of the chart bar with lookahead on)
22
23
  *
23
24
  * Close times, trading days and time zones come from the exchange calendars of the chart and of the other symbol
24
25
  * (time zone and session, read by the session functions). Without them:
@@ -1 +1 @@
1
- {"version":3,"file":"other.d.ts","sourceRoot":"","sources":["../../../src/security/other.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1D,2FAA2F;AAC3F,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;CAChC;AAED,wCAAwC;AACxC,MAAM,WAAW,kBAAkB;IACjC,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,0EAA0E;IAC1E,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,wFAAwF;AACxF,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IACtB,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AA4HD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1C,SAAS,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1C,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE,kBAAuB,GAC/B,MAAM,EAAE,CA2BV;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1C,SAAS,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1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;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1C,SAAS,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1C,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE,kBAAuB,GAC/B,MAAM,EAAE,CA6BV;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1C,SAAS,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1C,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAM,GAC9C,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CASzB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1C,SAAS,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1C,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,EACzB,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE,kBAAuB,GAC/B,MAAM,EAAE,CAEV"}
@@ -132,7 +132,7 @@ function securityOther(chartBars, otherBars, tf, chart, options = {}) {
132
132
  const { chartTf, otherTf, chartZone, otherZone } = setup(ct, ot, tf, chart, options);
133
133
  if (ot.length === 0) return new Array(n).fill(-1);
134
134
  const daily = timeframe.info(chartTf).isdwm && timeframe.info(otherTf).isdwm;
135
- const realtime = chart.lastBarConfirmed === false && !options.gaps;
135
+ const realtime = chart.lastBarConfirmed === false && !options.gaps && timeframe.in_seconds(otherTf) >= timeframe.in_seconds(chartTf);
136
136
  let on = [];
137
137
  if (options.lookahead || realtime) {
138
138
  if (daily) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/security/other.ts"],
4
- "sourcesContent": ["/**\n * PineScript `request.security(symbol, timeframe, expression, gaps, lookahead)` of another symbol: which bar of the\n * other symbol each chart bar shows (#179). The bars of the other symbol are given by the caller, already on the\n * requested timeframe; the expression is computed on them and its values are mapped to the chart bars with the index\n * given here. The script API does this with the `bars` accessor of its chart context.\n *\n * PineScript rules (measured on stocks, crypto and an exchange whose trading day starts on the previous UTC day; the\n * chart timeframe, D, W and M on intraday and daily charts; the four gaps / lookahead combinations):\n * - lookahead off: the last bar of the other symbol whose close time is at or before the close time of the chart bar\n * (a daily stock bar closes at the session end, a crypto daily bar at 00:00 UTC: a stock chart shows the crypto\n * bar of the day before, a crypto chart the stock bar of the same day)\n * - lookahead on, intraday chart or intraday request: the last bar of the other symbol that opened at or before the\n * open of the chart bar\n * - lookahead on, D / W / M chart and request: the last bar of the other symbol whose period starts at or before the trading day\n * of the chart bar: the trading day of a D bar, the Monday of a W bar, the first day of the month of an M bar, each\n * in the exchange time zone of its symbol (a week that opens on a Tuesday after a holiday still starts on Monday)\n * - before the first bar of the other symbol: na; on chart bars where the other symbol has no bar (weekends,\n * holidays, closed hours), gaps off repeats the last value\n * - gaps on: a value only on the chart bar where the shown bar changes (and on the first chart bar), na on the others\n * - the last bar while it is open (`lastBarConfirmed` false) with gaps off: the realtime update shows the bar given by\n * lookahead on (the open bar of a higher timeframe), with lookahead off as well\n *\n * Close times, trading days and time zones come from the exchange calendars of the chart and of the other symbol\n * (time zone and session, read by the session functions). Without them:\n * - a symbol that trades every day (bars on Saturdays or Sundays; W bars at Monday 00:00 UTC; M bars on the first day\n * at 00:00 UTC) is on the \"24x7\" UTC calendar\n * - another symbol whose bars open where the chart calendar starts its periods is on the calendar of the chart\n * - else the UTC rule: an intraday bar closes one bar interval after its open (or at the next bar), a D / W / M bar at\n * the end of the last weekday (UTC) of its day / week / month; the trading day is the UTC date of the bar\n * The fallback is exact between symbols of the same calendar and with 24x7 symbols; between a stock and a 24x7 symbol,\n * or an exchange whose trading day starts on the previous UTC day, it needs the session of the stock.\n *\n * @module security/other\n */\n\nimport * as timeframe from '../timeframe/index.js';\nimport { chartSessions, periodClose, periodTime, tradingDayTime, type SessionContext } from '../session/context.js';\nimport type { SessionSpec } from '../session/calendar.js';\n\nconst DAY = 86_400_000;\n\n/** Exchange calendar of a symbol: time zone and session (hours, corrections, holidays). */\nexport interface SymbolCalendar {\n timezone?: string;\n session?: SessionSpec | string;\n}\n\n/** Options of {@link securityOther}. */\nexport interface OtherSymbolOptions {\n /** PineScript `barmerge.lookahead_on`; default false */\n lookahead?: boolean;\n /** PineScript `barmerge.gaps_on`; default false */\n gaps?: boolean;\n /** Calendar of the other symbol; see the module notes for the fallback */\n other?: SymbolCalendar;\n}\n\n/** The chart: its timeframe, calendar, time unit and whether its last bar is closed. */\nexport interface OtherSymbolChart extends SymbolCalendar {\n /** Chart timeframe (\"60\", \"1D\"...) */\n timeframe: string;\n /** Unit of the bar times: 's' (default) or 'ms' */\n timeUnit?: 's' | 'ms';\n /** false: the last chart bar is still open (realtime rule) */\n lastBarConfirmed?: boolean;\n}\n\ninterface Zone {\n timezone: string;\n session: SessionSpec | string;\n}\n\nconst calendars = new Map<string, SessionContext | null>();\n\n/** The session context of a zone and a timeframe (bar times in ms); null when the session cannot be read. */\nfunction calendarOf(zone: Zone | null, tf: string): SessionContext | null {\n if (!zone) return null;\n const key = `${zone.timezone}|${typeof zone.session === 'string' ? zone.session : JSON.stringify(zone.session)}|${tf}`;\n let context = calendars.get(key);\n if (context === undefined) {\n context = { timeframe: tf, timezone: zone.timezone, session: zone.session, timeUnit: 'ms' };\n try {\n chartSessions(context);\n } catch {\n context = null;\n }\n if (calendars.size > 64) calendars.clear();\n calendars.set(key, context);\n }\n return context;\n}\n\nconst UTC_24X7: Zone = { timezone: 'Etc/UTC', session: '24x7' };\n\n/** True when bars of timeframe `tf` opening at `times` (ms) are those of a symbol that trades every day in UTC. */\nfunction tradesEveryDay(times: number[], tf: string): boolean {\n if (times.length === 0) return false;\n const info = timeframe.info(tf);\n if (info.isweekly) return times.every((t) => t % DAY === 0 && new Date(t).getUTCDay() === 1);\n if (info.ismonthly) return times.every((t) => t % DAY === 0 && new Date(t).getUTCDate() === 1);\n return times.some((t) => {\n const wd = new Date(t).getUTCDay();\n return wd === 0 || wd === 6;\n });\n}\n\n/** True when most of the last bars open at the start of a period of `tf` on the calendar `zone`. */\nfunction onCalendar(times: number[], tf: string, zone: Zone | null): boolean {\n const calendar = calendarOf(zone, tf);\n if (!calendar || times.length === 0) return false;\n const last = times.slice(-50);\n return last.filter((t) => periodTime(t, tf, calendar) === t).length >= 0.9 * last.length;\n}\n\nconst utcDay = (t: number): number => Math.floor(t / DAY) * DAY;\n/** Monday 00:00 UTC of the week of the day `day` (00:00 UTC, ms). */\nconst weekStart = (day: number): number => day - ((new Date(day).getUTCDay() + 6) % 7) * DAY;\nconst monthStart = (day: number): number => {\n const d = new Date(day);\n return Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), 1);\n};\n\n/** 00:00 UTC after the last weekday before `end` (00:00 UTC, ms): the end of a period of a Monday-to-Friday symbol. */\nfunction afterLastWeekday(end: number): number {\n let day = end - DAY;\n while (new Date(day).getUTCDay() % 6 === 0) day -= DAY;\n return day + DAY;\n}\n\n/** Close time (ms) of each bar of timeframe `tf` opening at `times` (ms). */\nfunction closeTimes(times: number[], tf: string, zone: Zone | null): number[] {\n const calendar = calendarOf(zone, tf);\n const info = timeframe.info(tf);\n const len = timeframe.in_seconds(tf) * 1000;\n return times.map((t, i) => {\n if (calendar) {\n const c = periodClose(t, tf, calendar);\n if (!Number.isNaN(c)) return c;\n }\n if (info.isintraday) return i + 1 < times.length ? Math.min(t + len, times[i + 1]!) : t + len;\n const day = utcDay(t);\n if (info.isweekly) return afterLastWeekday(weekStart(day) + 7 * DAY * info.multiplier);\n if (info.ismonthly) {\n const d = new Date(day);\n return afterLastWeekday(Date.UTC(d.getUTCFullYear(), d.getUTCMonth() + info.multiplier, 1));\n }\n return day + DAY * info.multiplier;\n });\n}\n\n/** Trading day (00:00 UTC, ms) of each bar opening at `times` (ms): its date in the exchange time zone. */\nfunction tradingDays(times: number[], zone: Zone | null): number[] {\n const calendar = calendarOf(zone, '1D');\n return times.map((t) => {\n const d = calendar ? tradingDayTime(t, calendar) : NaN;\n return Number.isNaN(d) ? utcDay(t) : d;\n });\n}\n\n/** For each element of `at` (non-decreasing), the index of the last element of `keys` (non-decreasing) <= it; -1: none. */\nfunction latestAtOrBefore(keys: number[], at: number[]): number[] {\n let j = -1;\n return at.map((x) => {\n while (j + 1 < keys.length && keys[j + 1]! <= x) j++;\n return j;\n });\n}\n\nconst zoneOf = (c: SymbolCalendar | undefined): Zone | null =>\n c?.timezone && c.session ? { timezone: c.timezone, session: c.session } : null;\n\n/** Timeframes and exchange calendars of a merge: given, 24x7, the chart's, else the UTC rule. */\nfunction setup(\n ct: number[],\n ot: number[],\n tf: string,\n chart: OtherSymbolChart,\n options: OtherSymbolOptions\n): { chartTf: string; otherTf: string; chartZone: Zone | null; otherZone: Zone | null } {\n const chartTf = timeframe.info(chart.timeframe).period;\n const otherTf = tf.trim() === '' ? chartTf : timeframe.info(tf).period;\n if (timeframe.info(otherTf).isticks) throw new RangeError(`request.security: tick timeframe \"${tf}\" is not supported.`);\n const chartZone = zoneOf(chart) ?? (tradesEveryDay(ct, chartTf) ? UTC_24X7 : null);\n const otherZone =\n zoneOf(options.other) ??\n (tradesEveryDay(ot, otherTf) ? UTC_24X7 : chartZone && onCalendar(ot, otherTf, chartZone) ? chartZone : null);\n return { chartTf, otherTf, chartZone, otherZone };\n}\n\n/**\n * PineScript `request.security` of another symbol: the index in `otherBars` of the bar shown on each chart bar, -1\n * for na (#179). `otherBars` are the bars of the other symbol on `tf` (\"\" for the chart timeframe, or a higher\n * or a lower one), with times in the unit of the chart bars. Rules in the module notes; the same rules hold for a\n * lower timeframe (#181): lookahead off shows the last lower bar that closes by the close of the chart bar, lookahead\n * on the last one that opened by its open. It also serves the chart symbol on a lower timeframe.\n * @throws RangeError for a tick timeframe\n */\nexport function securityOther(\n chartBars: ReadonlyArray<{ time: number }>,\n otherBars: ReadonlyArray<{ time: number }>,\n tf: string,\n chart: OtherSymbolChart,\n options: OtherSymbolOptions = {}\n): number[] {\n const n = chartBars.length;\n if (n === 0) return [];\n const unit = chart.timeUnit === 'ms' ? 1 : 1000;\n const ct = chartBars.map((b) => b.time * unit);\n const ot = otherBars.map((b) => b.time * unit);\n const { chartTf, otherTf, chartZone, otherZone } = setup(ct, ot, tf, chart, options);\n if (ot.length === 0) return new Array<number>(n).fill(-1);\n\n // by trading day when both timeframes are D / W / M; by open time with an intraday side (#181)\n const daily = timeframe.info(chartTf).isdwm && timeframe.info(otherTf).isdwm;\n const realtime = chart.lastBarConfirmed === false && !options.gaps;\n let on: number[] = [];\n if (options.lookahead || realtime) {\n if (daily) {\n const info = timeframe.info(otherTf);\n const starts = tradingDays(ot, otherZone).map((d) => (info.isweekly ? weekStart(d) : info.ismonthly ? monthStart(d) : d));\n on = latestAtOrBefore(starts, tradingDays(ct, chartZone));\n } else {\n on = latestAtOrBefore(ot, ct);\n }\n }\n const index = options.lookahead ? on : latestAtOrBefore(closeTimes(ot, otherTf, otherZone), closeTimes(ct, chartTf, chartZone));\n // realtime updates of the open last bar: lookahead off shows the bar of lookahead on\n if (realtime) index[n - 1] = on[n - 1]!;\n if (!options.gaps) return index;\n return index.map((j, i) => (i === 0 || j !== index[i - 1] ? j : -1));\n}\n\n/**\n * PineScript `request.security_lower_tf` (#181): for each chart bar, the range `[from, to)` of the bars of\n * `otherBars` (a lower timeframe, the chart symbol or another one) that it contains: the bars whose close time is\n * after the open of the chart bar and at or before its close (a 13:00 hourly bar of a 24x7 symbol is in a 13:30 stock\n * day, which closes at 20:00). An empty range for a chart bar without such bars.\n */\nexport function securityLowerTf(\n chartBars: ReadonlyArray<{ time: number }>,\n otherBars: ReadonlyArray<{ time: number }>,\n tf: string,\n chart: OtherSymbolChart,\n options: Pick<OtherSymbolOptions, 'other'> = {}\n): Array<[number, number]> {\n const unit = chart.timeUnit === 'ms' ? 1 : 1000;\n const ct = chartBars.map((b) => b.time * unit);\n const ot = otherBars.map((b) => b.time * unit);\n const { chartTf, otherTf, chartZone, otherZone } = setup(ct, ot, tf, chart, options);\n const oc = closeTimes(ot, otherTf, otherZone);\n const from = latestAtOrBefore(oc, ct);\n const to = latestAtOrBefore(oc, closeTimes(ct, chartTf, chartZone));\n return ct.map((_, i) => [from[i]! + 1, Math.max(from[i]! + 1, to[i]! + 1)]);\n}\n\n/**\n * {@link securityOther} with the values of an expression: `values` has one value per bar of the other symbol; the\n * result has one value per chart bar, NaN for na.\n */\nexport function securityOtherValues(\n chartBars: ReadonlyArray<{ time: number }>,\n otherBars: ReadonlyArray<{ time: number }>,\n tf: string,\n values: ArrayLike<number>,\n chart: OtherSymbolChart,\n options: OtherSymbolOptions = {}\n): number[] {\n return securityOther(chartBars, otherBars, tf, chart, options).map((j) => (j < 0 ? NaN : (values[j] ?? NaN)));\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCA,gBAA2B;AAC3B,qBAA4F;AAG5F,MAAM,MAAM;AAiCZ,MAAM,YAAY,oBAAI,IAAmC;AAGzD,SAAS,WAAW,MAAmB,IAAmC;AACxE,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,MAAM,GAAG,KAAK,QAAQ,IAAI,OAAO,KAAK,YAAY,WAAW,KAAK,UAAU,KAAK,UAAU,KAAK,OAAO,CAAC,IAAI,EAAE;AACpH,MAAI,UAAU,UAAU,IAAI,GAAG;AAC/B,MAAI,YAAY,QAAW;AACzB,cAAU,EAAE,WAAW,IAAI,U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AC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAK,GAAG,KAAK,IAAI,KAAK,CAAC,IAAK,GAAG,GAAG,CAAC,IAAK,CAAC,CAAC,CAAC;AAC5E;AAMO,SAAS,oBACd,WACA,WACA,IACA,QACA,OACA,UAA8B,CAAC,GACrB;AACV,SAAO,cAAc,WAAW,WAAW,IAAI,OAAO,OAAO,EAAE,IAAI,CAAC,MAAO,IAAI,IAAI,MAAO,OAAO,CAAC,KAAK,GAAK;AAC9G;",
4
+ "sourcesContent": ["/**\n * PineScript `request.security(symbol, timeframe, expression, gaps, lookahead)` of another symbol: which bar of the\n * other symbol each chart bar shows (#179). The bars of the other symbol are given by the caller, already on the\n * requested timeframe; the expression is computed on them and its values are mapped to the chart bars with the index\n * given here. The script API does this with the `bars` accessor of its chart context.\n *\n * PineScript rules (measured on stocks, crypto and an exchange whose trading day starts on the previous UTC day; the\n * chart timeframe, D, W and M on intraday and daily charts; the four gaps / lookahead combinations):\n * - lookahead off: the last bar of the other symbol whose close time is at or before the close time of the chart bar\n * (a daily stock bar closes at the session end, a crypto daily bar at 00:00 UTC: a stock chart shows the crypto\n * bar of the day before, a crypto chart the stock bar of the same day)\n * - lookahead on, intraday chart or intraday request: the last bar of the other symbol that opened at or before the\n * open of the chart bar\n * - lookahead on, D / W / M chart and request: the last bar of the other symbol whose period starts at or before the trading day\n * of the chart bar: the trading day of a D bar, the Monday of a W bar, the first day of the month of an M bar, each\n * in the exchange time zone of its symbol (a week that opens on a Tuesday after a holiday still starts on Monday)\n * - before the first bar of the other symbol: na; on chart bars where the other symbol has no bar (weekends,\n * holidays, closed hours), gaps off repeats the last value\n * - gaps on: a value only on the chart bar where the shown bar changes (and on the first chart bar), na on the others\n * - the last bar while it is open (`lastBarConfirmed` false) with gaps off: the realtime update shows the bar given by\n * lookahead on (the open bar of a higher timeframe), with lookahead off as well; a lower timeframe keeps the rules\n * above (the last lower bar so far with lookahead off, the first one of the chart bar with lookahead on)\n *\n * Close times, trading days and time zones come from the exchange calendars of the chart and of the other symbol\n * (time zone and session, read by the session functions). Without them:\n * - a symbol that trades every day (bars on Saturdays or Sundays; W bars at Monday 00:00 UTC; M bars on the first day\n * at 00:00 UTC) is on the \"24x7\" UTC calendar\n * - another symbol whose bars open where the chart calendar starts its periods is on the calendar of the chart\n * - else the UTC rule: an intraday bar closes one bar interval after its open (or at the next bar), a D / W / M bar at\n * the end of the last weekday (UTC) of its day / week / month; the trading day is the UTC date of the bar\n * The fallback is exact between symbols of the same calendar and with 24x7 symbols; between a stock and a 24x7 symbol,\n * or an exchange whose trading day starts on the previous UTC day, it needs the session of the stock.\n *\n * @module security/other\n */\n\nimport * as timeframe from '../timeframe/index.js';\nimport { chartSessions, periodClose, periodTime, tradingDayTime, type SessionContext } from '../session/context.js';\nimport type { SessionSpec } from '../session/calendar.js';\n\nconst DAY = 86_400_000;\n\n/** Exchange calendar of a symbol: time zone and session (hours, corrections, holidays). */\nexport interface SymbolCalendar {\n timezone?: string;\n session?: SessionSpec | string;\n}\n\n/** Options of {@link securityOther}. */\nexport interface OtherSymbolOptions {\n /** PineScript `barmerge.lookahead_on`; default false */\n lookahead?: boolean;\n /** PineScript `barmerge.gaps_on`; default false */\n gaps?: boolean;\n /** Calendar of the other symbol; see the module notes for the fallback */\n other?: SymbolCalendar;\n}\n\n/** The chart: its timeframe, calendar, time unit and whether its last bar is closed. */\nexport interface OtherSymbolChart extends SymbolCalendar {\n /** Chart timeframe (\"60\", \"1D\"...) */\n timeframe: string;\n /** Unit of the bar times: 's' (default) or 'ms' */\n timeUnit?: 's' | 'ms';\n /** false: the last chart bar is still open (realtime rule) */\n lastBarConfirmed?: boolean;\n}\n\ninterface Zone {\n timezone: string;\n session: SessionSpec | string;\n}\n\nconst calendars = new Map<string, SessionContext | null>();\n\n/** The session context of a zone and a timeframe (bar times in ms); null when the session cannot be read. */\nfunction calendarOf(zone: Zone | null, tf: string): SessionContext | null {\n if (!zone) return null;\n const key = `${zone.timezone}|${typeof zone.session === 'string' ? zone.session : JSON.stringify(zone.session)}|${tf}`;\n let context = calendars.get(key);\n if (context === undefined) {\n context = { timeframe: tf, timezone: zone.timezone, session: zone.session, timeUnit: 'ms' };\n try {\n chartSessions(context);\n } catch {\n context = null;\n }\n if (calendars.size > 64) calendars.clear();\n calendars.set(key, context);\n }\n return context;\n}\n\nconst UTC_24X7: Zone = { timezone: 'Etc/UTC', session: '24x7' };\n\n/** True when bars of timeframe `tf` opening at `times` (ms) are those of a symbol that trades every day in UTC. */\nfunction tradesEveryDay(times: number[], tf: string): boolean {\n if (times.length === 0) return false;\n const info = timeframe.info(tf);\n if (info.isweekly) return times.every((t) => t % DAY === 0 && new Date(t).getUTCDay() === 1);\n if (info.ismonthly) return times.every((t) => t % DAY === 0 && new Date(t).getUTCDate() === 1);\n return times.some((t) => {\n const wd = new Date(t).getUTCDay();\n return wd === 0 || wd === 6;\n });\n}\n\n/** True when most of the last bars open at the start of a period of `tf` on the calendar `zone`. */\nfunction onCalendar(times: number[], tf: string, zone: Zone | null): boolean {\n const calendar = calendarOf(zone, tf);\n if (!calendar || times.length === 0) return false;\n const last = times.slice(-50);\n return last.filter((t) => periodTime(t, tf, calendar) === t).length >= 0.9 * last.length;\n}\n\nconst utcDay = (t: number): number => Math.floor(t / DAY) * DAY;\n/** Monday 00:00 UTC of the week of the day `day` (00:00 UTC, ms). */\nconst weekStart = (day: number): number => day - ((new Date(day).getUTCDay() + 6) % 7) * DAY;\nconst monthStart = (day: number): number => {\n const d = new Date(day);\n return Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), 1);\n};\n\n/** 00:00 UTC after the last weekday before `end` (00:00 UTC, ms): the end of a period of a Monday-to-Friday symbol. */\nfunction afterLastWeekday(end: number): number {\n let day = end - DAY;\n while (new Date(day).getUTCDay() % 6 === 0) day -= DAY;\n return day + DAY;\n}\n\n/** Close time (ms) of each bar of timeframe `tf` opening at `times` (ms). */\nfunction closeTimes(times: number[], tf: string, zone: Zone | null): number[] {\n const calendar = calendarOf(zone, tf);\n const info = timeframe.info(tf);\n const len = timeframe.in_seconds(tf) * 1000;\n return times.map((t, i) => {\n if (calendar) {\n const c = periodClose(t, tf, calendar);\n if (!Number.isNaN(c)) return c;\n }\n if (info.isintraday) return i + 1 < times.length ? Math.min(t + len, times[i + 1]!) : t + len;\n const day = utcDay(t);\n if (info.isweekly) return afterLastWeekday(weekStart(day) + 7 * DAY * info.multiplier);\n if (info.ismonthly) {\n const d = new Date(day);\n return afterLastWeekday(Date.UTC(d.getUTCFullYear(), d.getUTCMonth() + info.multiplier, 1));\n }\n return day + DAY * info.multiplier;\n });\n}\n\n/** Trading day (00:00 UTC, ms) of each bar opening at `times` (ms): its date in the exchange time zone. */\nfunction tradingDays(times: number[], zone: Zone | null): number[] {\n const calendar = calendarOf(zone, '1D');\n return times.map((t) => {\n const d = calendar ? tradingDayTime(t, calendar) : NaN;\n return Number.isNaN(d) ? utcDay(t) : d;\n });\n}\n\n/** For each element of `at` (non-decreasing), the index of the last element of `keys` (non-decreasing) <= it; -1: none. */\nfunction latestAtOrBefore(keys: number[], at: number[]): number[] {\n let j = -1;\n return at.map((x) => {\n while (j + 1 < keys.length && keys[j + 1]! <= x) j++;\n return j;\n });\n}\n\nconst zoneOf = (c: SymbolCalendar | undefined): Zone | null =>\n c?.timezone && c.session ? { timezone: c.timezone, session: c.session } : null;\n\n/** Timeframes and exchange calendars of a merge: given, 24x7, the chart's, else the UTC rule. */\nfunction setup(\n ct: number[],\n ot: number[],\n tf: string,\n chart: OtherSymbolChart,\n options: OtherSymbolOptions\n): { chartTf: string; otherTf: string; chartZone: Zone | null; otherZone: Zone | null } {\n const chartTf = timeframe.info(chart.timeframe).period;\n const otherTf = tf.trim() === '' ? chartTf : timeframe.info(tf).period;\n if (timeframe.info(otherTf).isticks) throw new RangeError(`request.security: tick timeframe \"${tf}\" is not supported.`);\n const chartZone = zoneOf(chart) ?? (tradesEveryDay(ct, chartTf) ? UTC_24X7 : null);\n const otherZone =\n zoneOf(options.other) ??\n (tradesEveryDay(ot, otherTf) ? UTC_24X7 : chartZone && onCalendar(ot, otherTf, chartZone) ? chartZone : null);\n return { chartTf, otherTf, chartZone, otherZone };\n}\n\n/**\n * PineScript `request.security` of another symbol: the index in `otherBars` of the bar shown on each chart bar, -1\n * for na (#179). `otherBars` are the bars of the other symbol on `tf` (\"\" for the chart timeframe, or a higher\n * or a lower one), with times in the unit of the chart bars. Rules in the module notes; the same rules hold for a\n * lower timeframe (#181): lookahead off shows the last lower bar that closes by the close of the chart bar, lookahead\n * on the last one that opened by its open. It also serves the chart symbol on a lower timeframe.\n * @throws RangeError for a tick timeframe\n */\nexport function securityOther(\n chartBars: ReadonlyArray<{ time: number }>,\n otherBars: ReadonlyArray<{ time: number }>,\n tf: string,\n chart: OtherSymbolChart,\n options: OtherSymbolOptions = {}\n): number[] {\n const n = chartBars.length;\n if (n === 0) return [];\n const unit = chart.timeUnit === 'ms' ? 1 : 1000;\n const ct = chartBars.map((b) => b.time * unit);\n const ot = otherBars.map((b) => b.time * unit);\n const { chartTf, otherTf, chartZone, otherZone } = setup(ct, ot, tf, chart, options);\n if (ot.length === 0) return new Array<number>(n).fill(-1);\n\n // by trading day when both timeframes are D / W / M; by open time with an intraday side (#181)\n const daily = timeframe.info(chartTf).isdwm && timeframe.info(otherTf).isdwm;\n // a lower timeframe keeps its rule on the open last bar: the last lower bar so far, not the first one (#184)\n const realtime =\n chart.lastBarConfirmed === false && !options.gaps && timeframe.in_seconds(otherTf) >= timeframe.in_seconds(chartTf);\n let on: number[] = [];\n if (options.lookahead || realtime) {\n if (daily) {\n const info = timeframe.info(otherTf);\n const starts = tradingDays(ot, otherZone).map((d) => (info.isweekly ? weekStart(d) : info.ismonthly ? monthStart(d) : d));\n on = latestAtOrBefore(starts, tradingDays(ct, chartZone));\n } else {\n on = latestAtOrBefore(ot, ct);\n }\n }\n const index = options.lookahead ? on : latestAtOrBefore(closeTimes(ot, otherTf, otherZone), closeTimes(ct, chartTf, chartZone));\n // realtime updates of the open last bar: lookahead off shows the bar of lookahead on\n if (realtime) index[n - 1] = on[n - 1]!;\n if (!options.gaps) return index;\n return index.map((j, i) => (i === 0 || j !== index[i - 1] ? j : -1));\n}\n\n/**\n * PineScript `request.security_lower_tf` (#181): for each chart bar, the range `[from, to)` of the bars of\n * `otherBars` (a lower timeframe, the chart symbol or another one) that it contains: the bars whose close time is\n * after the open of the chart bar and at or before its close (a 13:00 hourly bar of a 24x7 symbol is in a 13:30 stock\n * day, which closes at 20:00). An empty range for a chart bar without such bars.\n */\nexport function securityLowerTf(\n chartBars: ReadonlyArray<{ time: number }>,\n otherBars: ReadonlyArray<{ time: number }>,\n tf: string,\n chart: OtherSymbolChart,\n options: Pick<OtherSymbolOptions, 'other'> = {}\n): Array<[number, number]> {\n const unit = chart.timeUnit === 'ms' ? 1 : 1000;\n const ct = chartBars.map((b) => b.time * unit);\n const ot = otherBars.map((b) => b.time * unit);\n const { chartTf, otherTf, chartZone, otherZone } = setup(ct, ot, tf, chart, options);\n const oc = closeTimes(ot, otherTf, otherZone);\n const from = latestAtOrBefore(oc, ct);\n const to = latestAtOrBefore(oc, closeTimes(ct, chartTf, chartZone));\n return ct.map((_, i) => [from[i]! + 1, Math.max(from[i]! + 1, to[i]! + 1)]);\n}\n\n/**\n * {@link securityOther} with the values of an expression: `values` has one value per bar of the other symbol; the\n * result has one value per chart bar, NaN for na.\n */\nexport function securityOtherValues(\n chartBars: ReadonlyArray<{ time: number }>,\n otherBars: ReadonlyArray<{ time: number }>,\n tf: string,\n values: ArrayLike<number>,\n chart: OtherSymbolChart,\n options: OtherSymbolOptions = {}\n): number[] {\n return securityOther(chartBars, otherBars, tf, chart, options).map((j) => (j < 0 ? NaN : (values[j] ?? NaN)));\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCA,gBAA2B;AAC3B,qBAA4F;AAG5F,MAAM,MAAM;AAiCZ,MAAM,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CAAC,MAAM,EAAE,OAAO,IAAI;AAC7C,QAAM,KAAK,UAAU,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI;AAC7C,QAAM,EAAE,SAAS,SAAS,WAAW,UAAU,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,OAAO;AACnF,QAAM,KAAK,WAAW,IAAI,SAAS,SAAS;AAC5C,QAAM,OAAO,iBAAiB,IAAI,EAAE;AACpC,QAAM,KAAK,iBAAiB,IAAI,WAAW,IAAI,SAAS,SAAS,CAAC;AAClE,SAAO,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAK,GAAG,KAAK,IAAI,KAAK,CAAC,IAAK,GAAG,GAAG,CAAC,IAAK,CAAC,CAAC,CAAC;AAC5E;AAMO,SAAS,oBACd,WACA,WACA,IACA,QACA,OACA,UAA8B,CAAC,GACrB;AACV,SAAO,cAAc,WAAW,WAAW,IAAI,OAAO,OAAO,EAAE,IAAI,CAAC,MAAO,IAAI,IAAI,MAAO,OAAO,CAAC,KAAK,GAAK;AAC9G;",
6
6
  "names": []
7
7
  }
@@ -473,6 +473,7 @@ export declare function falling(source: Source, length: simple_int): series_bool
473
473
  * - Equivalent to: `100 * (source - source[length]) / source[length]`
474
474
  * - Returns percentage change, e.g., 5.0 means 5% increase
475
475
  * - `na` values in the source series are included in calculations and will produce an `na` result
476
+ * - A zero `source[length]` gives +/-Infinity (NaN when `source` is 0 too), as in PineScript
476
477
  * - Useful for momentum analysis and trend strength measurement
477
478
  *
478
479
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ta/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAO,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKnI;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,G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AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAU1E;AAqBD;;;GAGG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,CAE/D;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,CAE/D"}
@@ -539,7 +539,7 @@ function roc(source, length) {
539
539
  result.push(NaN);
540
540
  } else {
541
541
  const oldValue = source[i - length];
542
- if (oldValue === 0 || isNaN(oldValue) || isNaN(source[i])) {
542
+ if (isNaN(oldValue) || isNaN(source[i])) {
543
543
  result.push(NaN);
544
544
  } else {
545
545
  const changeValue = source[i] - oldValue;