oakscriptjs 0.18.0 → 0.20.0
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.
- package/dist/cjs/box/index.d.ts +3 -3
- package/dist/cjs/box/index.d.ts.map +1 -1
- package/dist/cjs/box/index.js.map +2 -2
- package/dist/cjs/drawing/output.d.ts +2 -1
- package/dist/cjs/drawing/output.d.ts.map +1 -1
- package/dist/cjs/drawing/output.js +5 -4
- package/dist/cjs/drawing/output.js.map +2 -2
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/label/index.d.ts +2 -2
- package/dist/cjs/label/index.d.ts.map +1 -1
- package/dist/cjs/label/index.js.map +2 -2
- package/dist/cjs/line/index.d.ts +4 -4
- package/dist/cjs/line/index.d.ts.map +1 -1
- package/dist/cjs/line/index.js +1 -1
- package/dist/cjs/line/index.js.map +2 -2
- package/dist/cjs/polyline/index.d.ts +2 -2
- package/dist/cjs/polyline/index.d.ts.map +1 -1
- package/dist/cjs/polyline/index.js.map +2 -2
- package/dist/cjs/script/constants.d.ts +6 -1
- package/dist/cjs/script/constants.d.ts.map +1 -1
- package/dist/cjs/script/constants.js +2 -1
- package/dist/cjs/script/constants.js.map +2 -2
- package/dist/cjs/script/index.d.ts +44 -17
- package/dist/cjs/script/index.d.ts.map +1 -1
- package/dist/cjs/script/index.js +55 -6
- package/dist/cjs/script/index.js.map +2 -2
- package/dist/cjs/session/bars.d.ts +9 -0
- package/dist/cjs/session/bars.d.ts.map +1 -1
- package/dist/cjs/session/bars.js +36 -15
- package/dist/cjs/session/bars.js.map +2 -2
- package/dist/cjs/session/calendar.d.ts +10 -0
- package/dist/cjs/session/calendar.d.ts.map +1 -1
- package/dist/cjs/session/calendar.js +15 -0
- package/dist/cjs/session/calendar.js.map +2 -2
- package/dist/cjs/session/context.js +1 -1
- package/dist/cjs/session/context.js.map +2 -2
- package/dist/cjs/types/index.d.ts +13 -11
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +3 -1
- package/dist/cjs/types/index.js.map +2 -2
- package/dist/cjs/types/metadata.d.ts +12 -8
- package/dist/cjs/types/metadata.d.ts.map +1 -1
- package/dist/cjs/types/metadata.js.map +1 -1
- package/dist/esm/box/index.d.ts +3 -3
- package/dist/esm/box/index.d.ts.map +1 -1
- package/dist/esm/box/index.js +1 -1
- package/dist/esm/box/index.js.map +1 -1
- package/dist/esm/drawing/output.d.ts +2 -1
- package/dist/esm/drawing/output.d.ts.map +1 -1
- package/dist/esm/drawing/output.js +9 -7
- package/dist/esm/drawing/output.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/label/index.d.ts +2 -2
- package/dist/esm/label/index.d.ts.map +1 -1
- package/dist/esm/label/index.js.map +1 -1
- package/dist/esm/line/index.d.ts +4 -4
- package/dist/esm/line/index.d.ts.map +1 -1
- package/dist/esm/line/index.js +3 -3
- package/dist/esm/line/index.js.map +1 -1
- package/dist/esm/polyline/index.d.ts +2 -2
- package/dist/esm/polyline/index.d.ts.map +1 -1
- package/dist/esm/polyline/index.js +1 -1
- package/dist/esm/polyline/index.js.map +1 -1
- package/dist/esm/script/constants.d.ts +6 -1
- package/dist/esm/script/constants.d.ts.map +1 -1
- package/dist/esm/script/constants.js +6 -1
- package/dist/esm/script/constants.js.map +1 -1
- package/dist/esm/script/index.d.ts +44 -17
- package/dist/esm/script/index.d.ts.map +1 -1
- package/dist/esm/script/index.js +57 -4
- package/dist/esm/script/index.js.map +1 -1
- package/dist/esm/session/bars.d.ts +9 -0
- package/dist/esm/session/bars.d.ts.map +1 -1
- package/dist/esm/session/bars.js +40 -15
- package/dist/esm/session/bars.js.map +1 -1
- package/dist/esm/session/calendar.d.ts +10 -0
- package/dist/esm/session/calendar.d.ts.map +1 -1
- package/dist/esm/session/calendar.js +16 -0
- package/dist/esm/session/calendar.js.map +1 -1
- package/dist/esm/session/context.js +1 -1
- package/dist/esm/session/context.js.map +1 -1
- package/dist/esm/types/index.d.ts +13 -11
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js +3 -1
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/metadata.d.ts +12 -8
- package/dist/esm/types/metadata.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/oakscript/reference/pine-differences.md +2 -0
- package/skills/oakscript/reference/plotting.md +24 -1
- package/src/box/index.ts +4 -4
- package/src/drawing/output.ts +12 -8
- package/src/index.ts +1 -1
- package/src/label/index.ts +3 -3
- package/src/line/index.ts +6 -6
- package/src/polyline/index.ts +2 -2
- package/src/script/constants.ts +6 -1
- package/src/script/index.ts +79 -8
- package/src/session/bars.ts +40 -15
- package/src/session/calendar.ts +22 -0
- package/src/session/context.ts +1 -1
- package/src/types/index.ts +13 -11
- package/src/types/metadata.ts +12 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/session/context.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * The session of a chart context, for code that does not run a whole script (a port with its own bar loop).\n *\n * The same values as the script API gives (`time(tf)`, `time_close(tf)`, `time_tradingday`, `session.*`, the periods\n * of `request.security`), from the session, corrections and holidays of the context. Bar times are in the unit of\n * the context (`timeUnit`, seconds by default, as `Bar.time`); PineScript time values are returned in ms.\n *\n * @module session/context\n */\n\nimport type { Bar } from '../types/index.js';\nimport { info, in_seconds } from '../timeframe/index.js';\nimport { afterCompletion, periodsOf, resample } from '../security/resample.js';\nimport { parsePineSession, sessionRun } from '../time/session.js';\nimport { SessionBars, sessionFlags, strayPeriods, type SessionFlags } from './bars.js';\nimport { TradingCalendar, type SessionSpec } from './calendar.js';\n\n/** The part of a chart context that the session functions read (a `ChartContext` of the script API fits). */\nexport interface SessionContext {\n /** Chart timeframe: \"5\", \"60\", \"1D\"... */\n timeframe?: string;\n /** Exchange time zone: \"America/New_York\", \"Etc/UTC\"... */\n timezone?: string;\n /** Session of the loaded bars: hours, corrections, holidays */\n session?: SessionSpec | string;\n /** Regular trading hours when the bars include extended hours (default: `session`) */\n regularSession?: SessionSpec | string;\n /** Unit of the bar times: 's' (default) or 'ms' */\n timeUnit?: 's' | 'ms';\n}\n\n/** The session calendars of a context: the loaded bars and the regular hours. */\nexport interface ChartSessions {\n bars: SessionBars;\n regular: SessionBars;\n /** ms per unit of the bar times */\n unit: number;\n}\n\nconst toSpec = (s: SessionSpec | string): SessionSpec => (typeof s === 'string' ? { session: s } : s);\nconst cache = new WeakMap<object, ChartSessions>();\n\n/**\n * Session calendars of a chart context (cached per context object).\n * @throws Error when the context has no timeframe, time zone or session\n */\nexport function chartSessions(chart: SessionContext): ChartSessions {\n const cached = cache.get(chart);\n if (cached) return cached;\n const { timeframe, timezone, session } = chart;\n if (!timeframe || !timezone || !session) {\n throw new Error('The chart context needs timeframe, timezone and session for the session functions.');\n }\n const loaded = toSpec(session);\n const regular = chart.regularSession ? toSpec(chart.regularSession) : loaded;\n const out: ChartSessions = {\n bars: new SessionBars(new TradingCalendar(timezone, loaded), timeframe),\n regular: new SessionBars(new TradingCalendar(timezone, { holidays: loaded.holidays, ...regular }), timeframe),\n unit: chart.timeUnit === 'ms' ? 1 : 1000,\n };\n cache.set(chart, out);\n return out;\n}\n\n/** Open and close (ms) of the period that contains a bar opening at a time in ms; NaN outside the session. */\nexport interface SessionPeriods {\n open: (time: number) => number;\n close: (time: number) => number;\n}\n\n/** Calendars of the `session` / `timezone` arguments before the cache restarts */\nconst MAX_ARGUMENT_CALENDARS = 64;\nconst argumentCalendars = new Map<string, TradingCalendar>();\n\n/**\n * Calendar of a session string read in a time zone, without corrections and holidays: it depends on these only, so\n * the calls with other timeframes or other chart contexts share it and its periods (a script often reads\n * `time(timeframe.period, s)` and `time(\"D\", s)` on every bar).\n */\nfunction argumentCalendar(timezone: string, session: string, rule: 'symbol' | 'pine', dayPlacement: boolean): TradingCalendar {\n const key = `${rule}|${dayPlacement}|${timezone}|${session}`;\n let calendar = argumentCalendars.get(key);\n if (!calendar) {\n calendar = new TradingCalendar(timezone, { session }, rule, dayPlacement);\n if (argumentCalendars.size >= MAX_ARGUMENT_CALENDARS) argumentCalendars.clear();\n argumentCalendars.set(key, calendar);\n }\n return calendar;\n}\n\n/**\n * Calendar for the `session` / `timezone` arguments of `time(tf, session, timezone)`. Without both: the loaded\n * session. As in PineScript, an explicit time zone reads the symbol session hours in that zone without corrections\n * and holidays, and an explicit session follows PineScript's session string rules.\n */\nfunction calendarFor(\n bars: SessionBars,\n chart: SessionContext,\n session: string | undefined,\n timezone: string | undefined,\n dayPlacement: boolean\n): { bars: SessionBars; test: boolean; inside?: (time: number) => boolean } {\n if (!session && !timezone) return { bars, test: false };\n const tz = timezone ?? chart.timezone!;\n // a session string that is empty or does not start with a digit is the symbol session: \"regular\" the regular\n // hours, \"extended\" and any other name the loaded hours (PineScript)\n if (session !== undefined && parsePineSession(session) === null) {\n const name = session.trim();\n const symbol = name === 'regular' && chart.regularSession ? chart.regularSession : chart.session!;\n return { bars: new SessionBars(argumentCalendar(tz, toSpec(symbol).session, 'symbol', false), bars.chart.period), test: true };\n }\n return {\n bars: new SessionBars(\n argumentCalendar(tz, session || toSpec(chart.session!).session, session ? 'pine' : 'symbol', dayPlacement),\n bars.chart.period\n ),\n test: true,\n // a PineScript session string: the rules of time.inSession (runs ending at 0000, days around a clock change)\n inside: session ? (time) => sessionRun(time, session, tz, in_seconds(bars.chart.period) * 1000) !== null : undefined,\n };\n}\n\n/**\n * `time(tf, session, timezone)` / `time_close(tf, session, timezone)` of a bar, as PineScript computes them (#173):\n * an intraday timeframe tests the bar with the session rules of time.inSession and aligns its periods on the start\n * of the run that contains the bar; \"D\" tests the bar against the day's session period (the calendar; the time\n * between two runs of a day is inside it, #182); a timeframe of more than one day (\"2D\", \"W\", \"M\") has no test and\n * keeps the period's time. `bars` is the calendar of the loaded session (`chartSessions(chart).bars`).\n */\nexport function sessionPeriods(\n bars: SessionBars,\n chart: SessionContext,\n timeframe: string,\n session?: string,\n timezone?: string\n): SessionPeriods {\n const tf = info(timeframe);\n const { bars: calendar, test, inside } = calendarFor(bars, chart, session, timezone, !tf.isintraday);\n const open = (t: number): number => calendar.timeOf(t, timeframe);\n const close = (t: number): number => calendar.closeOf(t, timeframe);\n if (!test) return { open, close };\n if (tf.isintraday) {\n if (session !== undefined && parsePineSession(session) !== null && !calendar.chart.isdwm) {\n const tz = timezone ?? chart.timezone!;\n const barMs = in_seconds(calendar.chart.period) * 1000;\n const ms = in_seconds(tf.period) * 1000;\n const run = (t: number) => sessionRun(t, session, tz, barMs);\n const start = (t: number, r: [number, number]) => r[0] + Math.floor((t - r[0]) / ms) * ms;\n return {\n open: (t) => { const r = run(t); return r ? start(t, r) : NaN; },\n close: (t) => { const r = run(t); return r ? Math.min(start(t, r) + ms, r[1]) : NaN; },\n };\n }\n const isIn = (t: number) => (inside ? inside(t) : calendar.inside(t));\n return { open: (t) => (isIn(t) ? open(t) : NaN), close: (t) => (isIn(t) ? close(t) : NaN) };\n }\n if (tf.isdaily && tf.multiplier === 1) {\n return { open: (t) => (calendar.inside(t) ? open(t) : NaN), close: (t) => (calendar.inside(t) ? close(t) : NaN) };\n }\n return { open, close };\n}\n\n/** Periods per chart, timeframe, session and time zone (no session / time zone is \"\"): maps of the given strings, no\n * key to build on every bar */\nconst periodCache = new WeakMap<object, Map<string, Map<string, Map<string, SessionPeriods>>>>();\n\nfunction periodsOfChart(chart: SessionContext, timeframe: string, session?: string, timezone?: string): { s: ChartSessions; p: SessionPeriods } {\n const s = chartSessions(chart);\n let byTimeframe = periodCache.get(chart);\n if (!byTimeframe) periodCache.set(chart, (byTimeframe = new Map()));\n let bySession = byTimeframe.get(timeframe);\n if (!bySession) byTimeframe.set(timeframe, (bySession = new Map()));\n let byZone = bySession.get(session ?? '');\n if (!byZone) bySession.set(session ?? '', (byZone = new Map()));\n let p = byZone.get(timezone ?? '');\n if (!p) byZone.set(timezone ?? '', (p = sessionPeriods(s.bars, chart, timeframe, session, timezone)));\n return { s, p };\n}\n\n/**\n * PineScript `time(timeframe, session, timezone)` (ms) of a bar that opens at `time`: the start of its period; NaN\n * without one or outside `session` (#182). Without `session` and `timezone`, the periods of the loaded session.\n */\nexport function periodTime(time: number, timeframe: string, chart: SessionContext, session?: string, timezone?: string): number {\n const { s, p } = periodsOfChart(chart, timeframe, session, timezone);\n return p.open(time * s.unit);\n}\n\n/** PineScript `time_close(timeframe, session, timezone)` (ms) of a bar that opens at `time` (#182). */\nexport function periodClose(time: number, timeframe: string, chart: SessionContext, session?: string, timezone?: string): number {\n const { s, p } = periodsOfChart(chart, timeframe, session, timezone);\n return p.close(time * s.unit);\n}\n\n/** PineScript `time_tradingday` (ms, 00:00 UTC of the trading day) of a bar that opens at `time`. */\nexport function tradingDayTime(time: number, chart: SessionContext): number {\n const s = chartSessions(chart);\n return s.bars.tradingDayTime(time * s.unit);\n}\n\n/** PineScript `session.*` flags of bars that open at `times` (in order). */\nexport function chartSessionFlags(times: ArrayLike<number>, chart: SessionContext): SessionFlags {\n const s = chartSessions(chart);\n return sessionFlags(Array.from(times, (t) => t * s.unit), s.bars, s.regular);\n}\n\n/** Higher-timeframe bars of the chart bars and what `mapToChart` needs to bring values back to the chart. */\nexport interface SessionResample {\n /** Bars of `timeframe`, built from the chart bars */\n bars: Bar[];\n /** Period index of each chart bar */\n group: number[];\n /** Latest completed period at each chart bar */\n latest: number[];\n}\n\n/**\n * Same-symbol `request.security` on a timeframe equal to or higher than the chart's, with the session of the context:\n * D / W / M periods follow the regular hours, corrections and holidays; intraday periods the loaded session.\n * Compute on `bars`, then bring each value series back with `mapToChart(values, group, latest, lookahead, gaps)`.\n * @throws Error when `timeframe` is lower than the chart timeframe\n */\nexport function resampleSession(bars: Bar[], timeframe: string, chart: SessionContext): SessionResample {\n const s = chartSessions(chart);\n const chartTf = s.bars.chart;\n const tf = info(timeframe || chartTf.period);\n if (tf.period === chartTf.period) {\n const group = bars.map((_, i) => i);\n return { bars, group, latest: group };\n }\n if (in_seconds(tf.period) < in_seconds(chartTf.period)) {\n throw new Error(`resampleSession: timeframe \"${tf.period}\" is lower than the chart timeframe \"${chartTf.period}\".`);\n }\n const times = bars.map((b) => (b.time as number) * s.unit);\n const calendar = tf.isdwm ? s.regular : s.bars;\n const starts = times.map((t) => calendar.timeOf(t, tf.period));\n const dayPeriods = times.map((t, i) => {\n const at = s.bars.calendar.locate(t);\n const periods = at ? calendar.calendar.periods(at.date) : [];\n return periods.length ? calendar.timeOf(periods[0]![0], tf.period) : starts[i]!;\n });\n strayPeriods(starts, dayPeriods, times, s.bars, tf.isdwm ? null : in_seconds(tf.period) * 1000);\n const reaches = times.map((t) => s.bars.closeOf(t, chartTf.period) >= calendar.periodEnd(t, tf.period));\n const { group, latest } = periodsOf(starts, dayPeriods, reaches);\n // a higher-timeframe bar ends at the bar that completes it (no value from after the completion)\n const after = afterCompletion(group, latest);\n const kept = (_: unknown, i: number): boolean => !after[i];\n return { bars: resample(bars.filter(kept), starts.map((x) => x / s.unit).filter(kept)).bars, group, latest };\n}\n\n/**\n * Open time of the `count`-th bar after the bar that opens at `time`, on the trading calendar of the context: the\n * closed hours, weekends, holidays and days off are skipped. `count` 0 is the bar itself. For a drawing that ends\n * `count` bars after the last bar (PineScript `bar_index + count`).\n */\nexport function barTimeAfter(time: number, count: number, chart: SessionContext): number {\n const s = chartSessions(chart);\n let t = time * s.unit;\n for (let k = 0; k < count && !Number.isNaN(t); k++) t = s.bars.nextBarTime(t);\n return t / s.unit;\n}\n\n/**\n * Number of bars from the bar that opens at `from` to the bar that contains `to`, on the trading calendar of the\n * context (0 when `to` is in the bar of `from` or before it). For a drawing placed at a time after the last bar\n * (PineScript `time + n days` with `xloc.bar_time`): the chart shows it on the bar of that time, weekends and\n * holidays skipped. `to` is first rounded to the nearest second, a half second going up (#174: 15 ms before a bar\n * opens is on that bar, 501 ms before is on the bar before). NaN when no bar is found within 100,000 bars.\n */\nexport function barsUntil(from: number, to: number, chart: SessionContext): number {\n const s = chartSessions(chart);\n const target = Math.floor((to * s.unit) / 1000 + 0.5) * 1000;\n let t = from * s.unit;\n for (let k = 0; k < 100_000; k++) {\n const next = s.bars.nextBarTime(t);\n if (Number.isNaN(next)) return NaN;\n if (next > target) return k;\n t = next;\n }\n return NaN;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,uBAAiC;AACjC,sBAAqD;AACrD,qBAA6C;AAC7C,kBAA2E;AAC3E,sBAAkD;AAwBlD,MAAM,SAAS,CAAC,MAA0C,OAAO,MAAM,WAAW,EAAE,SAAS,EAAE,IAAI;AACnG,MAAM,QAAQ,oBAAI,QAA+B;AAM1C,SAAS,cAAc,OAAsC;AAClE,QAAM,SAAS,MAAM,IAAI,KAAK;AAC9B,MAAI,OAAQ,QAAO;AACnB,QAAM,EAAE,WAAW,UAAU,QAAQ,IAAI;AACzC,MAAI,CAAC,aAAa,CAAC,YAAY,CAAC,SAAS;AACvC,UAAM,IAAI,MAAM,oFAAoF;AAAA,EACtG;AACA,QAAM,SAAS,OAAO,OAAO;AAC7B,QAAM,UAAU,MAAM,iBAAiB,OAAO,MAAM,cAAc,IAAI;AACtE,QAAM,MAAqB;AAAA,IACzB,MAAM,IAAI,wBAAY,IAAI,gCAAgB,UAAU,MAAM,GAAG,SAAS;AAAA,IACtE,SAAS,IAAI,wBAAY,IAAI,gCAAgB,UAAU,EAAE,UAAU,OAAO,UAAU,GAAG,QAAQ,CAAC,GAAG,SAAS;AAAA,IAC5G,MAAM,MAAM,aAAa,OAAO,IAAI;AAAA,EACtC;AACA,QAAM,IAAI,OAAO,GAAG;AACpB,SAAO;AACT;AASA,MAAM,yBAAyB;AAC/B,MAAM,oBAAoB,oBAAI,IAA6B;AAO3D,SAAS,iBAAiB,UAAkB,SAAiB,M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c,KAAK;AAC7B,aAAO,0BAAa,MAAM,KAAK,OAAO,CAAC,MAAM,IAAI,EAAE,IAAI,GAAG,EAAE,MAAM,EAAE,OAAO;AAC7E;AAkBO,SAAS,gBAAgB,MAAa,WAAmB,OAAwC;AACtG,QAAM,IAAI,cAAc,KAAK;AAC7B,QAAM,UAAU,EAAE,KAAK;AACvB,QAAM,SAAK,uBAAK,aAAa,QAAQ,MAAM;AAC3C,MAAI,GAAG,WAAW,QAAQ,QAAQ;AAChC,UAAMA,SAAQ,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC;AAClC,WAAO,EAAE,MAAM,OAAAA,QAAO,QAAQA,OAAM;AAAA,EACtC;AACA,UAAI,6BAAW,GAAG,MAAM,QAAI,6BAAW,QAAQ,MAAM,GAAG;AACtD,UAAM,IAAI,MAAM,+BAA+B,GAAG,MAAM,wCAAwC,QAAQ,MAAM,IAAI;AAAA,EACpH;AACA,QAAM,QAAQ,KAAK,IAAI,CAAC,MAAO,EAAE,OAAkB,EAAE,IAAI;AACzD,QAAM,WAAW,GAAG,QAAQ,EAAE,UAAU,EAAE;AAC1C,QAAM,SAAS,MAAM,IAAI,CAAC,MAAM,SAAS,OAAO,GAAG,GAAG,MAAM,CAAC;AAC7D,QAAM,aAAa,MAAM,IAAI,CAAC,GAAG,MAAM;AACrC,UAAM,KAAK,EAAE,KAAK,
|
|
4
|
+
"sourcesContent": ["/**\n * The session of a chart context, for code that does not run a whole script (a port with its own bar loop).\n *\n * The same values as the script API gives (`time(tf)`, `time_close(tf)`, `time_tradingday`, `session.*`, the periods\n * of `request.security`), from the session, corrections and holidays of the context. Bar times are in the unit of\n * the context (`timeUnit`, seconds by default, as `Bar.time`); PineScript time values are returned in ms.\n *\n * @module session/context\n */\n\nimport type { Bar } from '../types/index.js';\nimport { info, in_seconds } from '../timeframe/index.js';\nimport { afterCompletion, periodsOf, resample } from '../security/resample.js';\nimport { parsePineSession, sessionRun } from '../time/session.js';\nimport { SessionBars, sessionFlags, strayPeriods, type SessionFlags } from './bars.js';\nimport { TradingCalendar, type SessionSpec } from './calendar.js';\n\n/** The part of a chart context that the session functions read (a `ChartContext` of the script API fits). */\nexport interface SessionContext {\n /** Chart timeframe: \"5\", \"60\", \"1D\"... */\n timeframe?: string;\n /** Exchange time zone: \"America/New_York\", \"Etc/UTC\"... */\n timezone?: string;\n /** Session of the loaded bars: hours, corrections, holidays */\n session?: SessionSpec | string;\n /** Regular trading hours when the bars include extended hours (default: `session`) */\n regularSession?: SessionSpec | string;\n /** Unit of the bar times: 's' (default) or 'ms' */\n timeUnit?: 's' | 'ms';\n}\n\n/** The session calendars of a context: the loaded bars and the regular hours. */\nexport interface ChartSessions {\n bars: SessionBars;\n regular: SessionBars;\n /** ms per unit of the bar times */\n unit: number;\n}\n\nconst toSpec = (s: SessionSpec | string): SessionSpec => (typeof s === 'string' ? { session: s } : s);\nconst cache = new WeakMap<object, ChartSessions>();\n\n/**\n * Session calendars of a chart context (cached per context object).\n * @throws Error when the context has no timeframe, time zone or session\n */\nexport function chartSessions(chart: SessionContext): ChartSessions {\n const cached = cache.get(chart);\n if (cached) return cached;\n const { timeframe, timezone, session } = chart;\n if (!timeframe || !timezone || !session) {\n throw new Error('The chart context needs timeframe, timezone and session for the session functions.');\n }\n const loaded = toSpec(session);\n const regular = chart.regularSession ? toSpec(chart.regularSession) : loaded;\n const out: ChartSessions = {\n bars: new SessionBars(new TradingCalendar(timezone, loaded), timeframe),\n regular: new SessionBars(new TradingCalendar(timezone, { holidays: loaded.holidays, ...regular }), timeframe),\n unit: chart.timeUnit === 'ms' ? 1 : 1000,\n };\n cache.set(chart, out);\n return out;\n}\n\n/** Open and close (ms) of the period that contains a bar opening at a time in ms; NaN outside the session. */\nexport interface SessionPeriods {\n open: (time: number) => number;\n close: (time: number) => number;\n}\n\n/** Calendars of the `session` / `timezone` arguments before the cache restarts */\nconst MAX_ARGUMENT_CALENDARS = 64;\nconst argumentCalendars = new Map<string, TradingCalendar>();\n\n/**\n * Calendar of a session string read in a time zone, without corrections and holidays: it depends on these only, so\n * the calls with other timeframes or other chart contexts share it and its periods (a script often reads\n * `time(timeframe.period, s)` and `time(\"D\", s)` on every bar).\n */\nfunction argumentCalendar(timezone: string, session: string, rule: 'symbol' | 'pine', dayPlacement: boolean): TradingCalendar {\n const key = `${rule}|${dayPlacement}|${timezone}|${session}`;\n let calendar = argumentCalendars.get(key);\n if (!calendar) {\n calendar = new TradingCalendar(timezone, { session }, rule, dayPlacement);\n if (argumentCalendars.size >= MAX_ARGUMENT_CALENDARS) argumentCalendars.clear();\n argumentCalendars.set(key, calendar);\n }\n return calendar;\n}\n\n/**\n * Calendar for the `session` / `timezone` arguments of `time(tf, session, timezone)`. Without both: the loaded\n * session. As in PineScript, an explicit time zone reads the symbol session hours in that zone without corrections\n * and holidays, and an explicit session follows PineScript's session string rules.\n */\nfunction calendarFor(\n bars: SessionBars,\n chart: SessionContext,\n session: string | undefined,\n timezone: string | undefined,\n dayPlacement: boolean\n): { bars: SessionBars; test: boolean; inside?: (time: number) => boolean } {\n if (!session && !timezone) return { bars, test: false };\n const tz = timezone ?? chart.timezone!;\n // a session string that is empty or does not start with a digit is the symbol session: \"regular\" the regular\n // hours, \"extended\" and any other name the loaded hours (PineScript)\n if (session !== undefined && parsePineSession(session) === null) {\n const name = session.trim();\n const symbol = name === 'regular' && chart.regularSession ? chart.regularSession : chart.session!;\n return { bars: new SessionBars(argumentCalendar(tz, toSpec(symbol).session, 'symbol', false), bars.chart.period), test: true };\n }\n return {\n bars: new SessionBars(\n argumentCalendar(tz, session || toSpec(chart.session!).session, session ? 'pine' : 'symbol', dayPlacement),\n bars.chart.period\n ),\n test: true,\n // a PineScript session string: the rules of time.inSession (runs ending at 0000, days around a clock change)\n inside: session ? (time) => sessionRun(time, session, tz, in_seconds(bars.chart.period) * 1000) !== null : undefined,\n };\n}\n\n/**\n * `time(tf, session, timezone)` / `time_close(tf, session, timezone)` of a bar, as PineScript computes them (#173):\n * an intraday timeframe tests the bar with the session rules of time.inSession and aligns its periods on the start\n * of the run that contains the bar; \"D\" tests the bar against the day's session period (the calendar; the time\n * between two runs of a day is inside it, #182); a timeframe of more than one day (\"2D\", \"W\", \"M\") has no test and\n * keeps the period's time. `bars` is the calendar of the loaded session (`chartSessions(chart).bars`).\n */\nexport function sessionPeriods(\n bars: SessionBars,\n chart: SessionContext,\n timeframe: string,\n session?: string,\n timezone?: string\n): SessionPeriods {\n const tf = info(timeframe);\n const { bars: calendar, test, inside } = calendarFor(bars, chart, session, timezone, !tf.isintraday);\n const open = (t: number): number => calendar.timeOf(t, timeframe);\n const close = (t: number): number => calendar.closeOf(t, timeframe);\n if (!test) return { open, close };\n if (tf.isintraday) {\n if (session !== undefined && parsePineSession(session) !== null && !calendar.chart.isdwm) {\n const tz = timezone ?? chart.timezone!;\n const barMs = in_seconds(calendar.chart.period) * 1000;\n const ms = in_seconds(tf.period) * 1000;\n const run = (t: number) => sessionRun(t, session, tz, barMs);\n const start = (t: number, r: [number, number]) => r[0] + Math.floor((t - r[0]) / ms) * ms;\n return {\n open: (t) => { const r = run(t); return r ? start(t, r) : NaN; },\n close: (t) => { const r = run(t); return r ? Math.min(start(t, r) + ms, r[1]) : NaN; },\n };\n }\n const isIn = (t: number) => (inside ? inside(t) : calendar.inside(t));\n return { open: (t) => (isIn(t) ? open(t) : NaN), close: (t) => (isIn(t) ? close(t) : NaN) };\n }\n if (tf.isdaily && tf.multiplier === 1) {\n return { open: (t) => (calendar.inside(t) ? open(t) : NaN), close: (t) => (calendar.inside(t) ? close(t) : NaN) };\n }\n return { open, close };\n}\n\n/** Periods per chart, timeframe, session and time zone (no session / time zone is \"\"): maps of the given strings, no\n * key to build on every bar */\nconst periodCache = new WeakMap<object, Map<string, Map<string, Map<string, SessionPeriods>>>>();\n\nfunction periodsOfChart(chart: SessionContext, timeframe: string, session?: string, timezone?: string): { s: ChartSessions; p: SessionPeriods } {\n const s = chartSessions(chart);\n let byTimeframe = periodCache.get(chart);\n if (!byTimeframe) periodCache.set(chart, (byTimeframe = new Map()));\n let bySession = byTimeframe.get(timeframe);\n if (!bySession) byTimeframe.set(timeframe, (bySession = new Map()));\n let byZone = bySession.get(session ?? '');\n if (!byZone) bySession.set(session ?? '', (byZone = new Map()));\n let p = byZone.get(timezone ?? '');\n if (!p) byZone.set(timezone ?? '', (p = sessionPeriods(s.bars, chart, timeframe, session, timezone)));\n return { s, p };\n}\n\n/**\n * PineScript `time(timeframe, session, timezone)` (ms) of a bar that opens at `time`: the start of its period; NaN\n * without one or outside `session` (#182). Without `session` and `timezone`, the periods of the loaded session.\n */\nexport function periodTime(time: number, timeframe: string, chart: SessionContext, session?: string, timezone?: string): number {\n const { s, p } = periodsOfChart(chart, timeframe, session, timezone);\n return p.open(time * s.unit);\n}\n\n/** PineScript `time_close(timeframe, session, timezone)` (ms) of a bar that opens at `time` (#182). */\nexport function periodClose(time: number, timeframe: string, chart: SessionContext, session?: string, timezone?: string): number {\n const { s, p } = periodsOfChart(chart, timeframe, session, timezone);\n return p.close(time * s.unit);\n}\n\n/** PineScript `time_tradingday` (ms, 00:00 UTC of the trading day) of a bar that opens at `time`. */\nexport function tradingDayTime(time: number, chart: SessionContext): number {\n const s = chartSessions(chart);\n return s.bars.tradingDayTime(time * s.unit);\n}\n\n/** PineScript `session.*` flags of bars that open at `times` (in order). */\nexport function chartSessionFlags(times: ArrayLike<number>, chart: SessionContext): SessionFlags {\n const s = chartSessions(chart);\n return sessionFlags(Array.from(times, (t) => t * s.unit), s.bars, s.regular);\n}\n\n/** Higher-timeframe bars of the chart bars and what `mapToChart` needs to bring values back to the chart. */\nexport interface SessionResample {\n /** Bars of `timeframe`, built from the chart bars */\n bars: Bar[];\n /** Period index of each chart bar */\n group: number[];\n /** Latest completed period at each chart bar */\n latest: number[];\n}\n\n/**\n * Same-symbol `request.security` on a timeframe equal to or higher than the chart's, with the session of the context:\n * D / W / M periods follow the regular hours, corrections and holidays; intraday periods the loaded session.\n * Compute on `bars`, then bring each value series back with `mapToChart(values, group, latest, lookahead, gaps)`.\n * @throws Error when `timeframe` is lower than the chart timeframe\n */\nexport function resampleSession(bars: Bar[], timeframe: string, chart: SessionContext): SessionResample {\n const s = chartSessions(chart);\n const chartTf = s.bars.chart;\n const tf = info(timeframe || chartTf.period);\n if (tf.period === chartTf.period) {\n const group = bars.map((_, i) => i);\n return { bars, group, latest: group };\n }\n if (in_seconds(tf.period) < in_seconds(chartTf.period)) {\n throw new Error(`resampleSession: timeframe \"${tf.period}\" is lower than the chart timeframe \"${chartTf.period}\".`);\n }\n const times = bars.map((b) => (b.time as number) * s.unit);\n const calendar = tf.isdwm ? s.regular : s.bars;\n const starts = times.map((t) => calendar.timeOf(t, tf.period));\n const dayPeriods = times.map((t, i) => {\n const at = s.bars.locateBar(t);\n const periods = at ? calendar.calendar.periods(at.date) : [];\n return periods.length ? calendar.timeOf(periods[0]![0], tf.period) : starts[i]!;\n });\n strayPeriods(starts, dayPeriods, times, s.bars, tf.isdwm ? null : in_seconds(tf.period) * 1000);\n const reaches = times.map((t) => s.bars.closeOf(t, chartTf.period) >= calendar.periodEnd(t, tf.period));\n const { group, latest } = periodsOf(starts, dayPeriods, reaches);\n // a higher-timeframe bar ends at the bar that completes it (no value from after the completion)\n const after = afterCompletion(group, latest);\n const kept = (_: unknown, i: number): boolean => !after[i];\n return { bars: resample(bars.filter(kept), starts.map((x) => x / s.unit).filter(kept)).bars, group, latest };\n}\n\n/**\n * Open time of the `count`-th bar after the bar that opens at `time`, on the trading calendar of the context: the\n * closed hours, weekends, holidays and days off are skipped. `count` 0 is the bar itself. For a drawing that ends\n * `count` bars after the last bar (PineScript `bar_index + count`).\n */\nexport function barTimeAfter(time: number, count: number, chart: SessionContext): number {\n const s = chartSessions(chart);\n let t = time * s.unit;\n for (let k = 0; k < count && !Number.isNaN(t); k++) t = s.bars.nextBarTime(t);\n return t / s.unit;\n}\n\n/**\n * Number of bars from the bar that opens at `from` to the bar that contains `to`, on the trading calendar of the\n * context (0 when `to` is in the bar of `from` or before it). For a drawing placed at a time after the last bar\n * (PineScript `time + n days` with `xloc.bar_time`): the chart shows it on the bar of that time, weekends and\n * holidays skipped. `to` is first rounded to the nearest second, a half second going up (#174: 15 ms before a bar\n * opens is on that bar, 501 ms before is on the bar before). NaN when no bar is found within 100,000 bars.\n */\nexport function barsUntil(from: number, to: number, chart: SessionContext): number {\n const s = chartSessions(chart);\n const target = Math.floor((to * s.unit) / 1000 + 0.5) * 1000;\n let t = from * s.unit;\n for (let k = 0; k < 100_000; k++) {\n const next = s.bars.nextBarTime(t);\n if (Number.isNaN(next)) return NaN;\n if (next > target) return k;\n t = next;\n }\n return NaN;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,uBAAiC;AACjC,sBAAqD;AACrD,qBAA6C;AAC7C,kBAA2E;AAC3E,sBAAkD;AAwBlD,MAAM,SAAS,CAAC,MAA0C,OAAO,MAAM,WAAW,EAAE,SAAS,EAAE,IAAI;AACnG,MAAM,QAAQ,oBAAI,QAA+B;AAM1C,SAAS,cAAc,OAAsC;AAClE,QAAM,SAAS,MAAM,IAAI,KAAK;AAC9B,MAAI,OAAQ,QAAO;AACnB,QAAM,EAAE,WAAW,UAAU,QAAQ,IAAI;AACzC,MAAI,CAAC,aAAa,CAAC,YAAY,CAAC,SAAS;AACvC,UAAM,IAAI,MAAM,oFAAoF;AAAA,EACtG;AACA,QAAM,SAAS,OAAO,OAAO;AAC7B,QAAM,UAAU,MAAM,iBAAiB,OAAO,MAAM,cAAc,IAAI;AACtE,QAAM,MAAqB;AAAA,IACzB,MAAM,IAAI,wBAAY,IAAI,gCAAgB,UAAU,MAAM,GAAG,SAAS;AAAA,IACtE,SAAS,IAAI,wBAAY,IAAI,gCAAgB,UAAU,EAAE,UAAU,OAAO,UAAU,GAAG,QAAQ,CAAC,GAAG,SAAS;AAAA,IAC5G,MA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istance levels, etc.
|
|
44
44
|
*/
|
|
45
45
|
export interface Line {
|
|
46
|
-
/** First point's x coordinate (bar index or
|
|
46
|
+
/** First point's x coordinate (bar index, UNIX timestamp, or percent of the pane's width with xloc 'pane') */
|
|
47
47
|
x1: number;
|
|
48
48
|
/** First point's y coordinate (price level) */
|
|
49
49
|
y1: number;
|
|
50
|
-
/** Second point's x coordinate (bar index or
|
|
50
|
+
/** Second point's x coordinate (bar index, UNIX timestamp, or percent of the pane's width with xloc 'pane') */
|
|
51
51
|
x2: number;
|
|
52
52
|
/** Second point's y coordinate (price level) */
|
|
53
53
|
y2: number;
|
|
54
54
|
/** X-axis coordinate system */
|
|
55
|
-
xloc: 'bar_index' | 'bar_time';
|
|
55
|
+
xloc: 'bar_index' | 'bar_time' | 'pane';
|
|
56
56
|
/** Extension mode */
|
|
57
57
|
extend: 'none' | 'left' | 'right' | 'both';
|
|
58
58
|
/** Line color (stored but not used for calculations) */
|
|
@@ -71,16 +71,16 @@ export interface Line {
|
|
|
71
71
|
* range breakout analysis, and consolidation zone identification.
|
|
72
72
|
*/
|
|
73
73
|
export interface Box {
|
|
74
|
-
/** Left border x coordinate (bar index or
|
|
74
|
+
/** Left border x coordinate (bar index, UNIX timestamp, or percent of the pane's width with xloc 'pane') */
|
|
75
75
|
left: number;
|
|
76
76
|
/** Top border y coordinate (price level) */
|
|
77
77
|
top: number;
|
|
78
|
-
/** Right border x coordinate (bar index or
|
|
78
|
+
/** Right border x coordinate (bar index, UNIX timestamp, or percent of the pane's width with xloc 'pane') */
|
|
79
79
|
right: number;
|
|
80
80
|
/** Bottom border y coordinate (price level) */
|
|
81
81
|
bottom: number;
|
|
82
82
|
/** X-axis coordinate system */
|
|
83
|
-
xloc: 'bar_index' | 'bar_time';
|
|
83
|
+
xloc: 'bar_index' | 'bar_time' | 'pane';
|
|
84
84
|
/** Horizontal extension mode */
|
|
85
85
|
extend: 'none' | 'left' | 'right' | 'both';
|
|
86
86
|
/** Border color (stored but not used for calculations) */
|
|
@@ -116,12 +116,12 @@ export interface Box {
|
|
|
116
116
|
* Labels have limited computational value. Primarily used for marking points and displaying text.
|
|
117
117
|
*/
|
|
118
118
|
export interface Label {
|
|
119
|
-
/** X coordinate (bar index or
|
|
119
|
+
/** X coordinate (bar index, UNIX timestamp, or percent of the pane's width with xloc 'pane') */
|
|
120
120
|
x: number;
|
|
121
121
|
/** Y coordinate (price level when yloc = 'price') */
|
|
122
122
|
y: number;
|
|
123
123
|
/** X-axis coordinate system */
|
|
124
|
-
xloc: 'bar_index' | 'bar_time';
|
|
124
|
+
xloc: 'bar_index' | 'bar_time' | 'pane';
|
|
125
125
|
/** Y-axis positioning mode */
|
|
126
126
|
yloc: 'price' | 'abovebar' | 'belowbar';
|
|
127
127
|
/** Label text content */
|
|
@@ -304,13 +304,15 @@ export declare const na: null;
|
|
|
304
304
|
export type na = null;
|
|
305
305
|
/**
|
|
306
306
|
* X-axis location constants
|
|
307
|
-
* Used to specify whether x-coordinates are bar indices or
|
|
307
|
+
* Used to specify whether x-coordinates are bar indices, timestamps or places on the pane
|
|
308
308
|
*/
|
|
309
309
|
export declare const xloc: {
|
|
310
310
|
/** X-coordinates are bar indices */
|
|
311
311
|
bar_index: "bar_index";
|
|
312
312
|
/** X-coordinates are UNIX timestamps in milliseconds */
|
|
313
313
|
bar_time: "bar_time";
|
|
314
|
+
/** X-coordinates are percents of the pane's width: 0 left edge, 100 right edge (not a PineScript value) */
|
|
315
|
+
pane: "pane";
|
|
314
316
|
};
|
|
315
317
|
/**
|
|
316
318
|
* Table position constants (PineScript `position.*`), for `table.new` and `table.set_position`
|
|
@@ -355,8 +357,8 @@ export interface Polyline {
|
|
|
355
357
|
readonly curved: boolean;
|
|
356
358
|
/** If true, connect the first point to the last point */
|
|
357
359
|
readonly closed: boolean;
|
|
358
|
-
/** X-coordinate mode: 'bar_index' or '
|
|
359
|
-
readonly xloc: 'bar_index' | 'bar_time';
|
|
360
|
+
/** X-coordinate mode: 'bar_index', 'bar_time' or 'pane' */
|
|
361
|
+
readonly xloc: 'bar_index' | 'bar_time' | 'pane';
|
|
360
362
|
/** Color of line segments */
|
|
361
363
|
readonly line_color: color;
|
|
362
364
|
/** Fill color for closed polylines (null for no fill) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC;AACzB,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAC3B,MAAM,MAAM,IAAI,GAAG,OAAO,CAAC;AAE3B,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAGpC,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AAC5B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACrC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AACzC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AACvC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAGzC,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC;AAC7B,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC;AACjC,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC;AAC/B,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AACnC,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC;AAGjC,MAAM,MAAM,SAAS,GAAG,GAAG,CAAC;AAC5B,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC;AAChC,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC;AAC9B,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC;AA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KAAK,CAAC;IAC3B,yDAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,KAAK,GAAG,IAAI,CAAC;IAClC,iBAAiB;IACjB,QAAQ,CAAC,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACnD,2BAA2B;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,iCAAiC;IACjC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAGD,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC"}
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -28,7 +28,9 @@ const xloc = {
|
|
|
28
28
|
/** X-coordinates are bar indices */
|
|
29
29
|
bar_index: "bar_index",
|
|
30
30
|
/** X-coordinates are UNIX timestamps in milliseconds */
|
|
31
|
-
bar_time: "bar_time"
|
|
31
|
+
bar_time: "bar_time",
|
|
32
|
+
/** X-coordinates are percents of the pane's width: 0 left edge, 100 right edge (not a PineScript value) */
|
|
33
|
+
pane: "pane"
|
|
32
34
|
};
|
|
33
35
|
const position = {
|
|
34
36
|
top_left: "top_left",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Core types for OakScriptJS\n * These types mirror the PineScript type system\n */\n\n// Basic types\nexport type int = number;\nexport type float = number;\nexport type bool = boolean;\n//export type string = string;\nexport type color = string | number;\n\n// Series types - In PineScript, series are time-series arrays\nexport type series<T> = T[];\nexport type series_int = series<int>;\nexport type series_float = series<float>;\nexport type series_bool = series<bool>;\nexport type series_string = series<string>;\nexport type series_color = series<color>;\n\n// Simple types (non-series)\nexport type simple_int = int;\nexport type simple_float = float;\nexport type simple_bool = bool;\nexport type simple_string = string;\nexport type simple_color = color;\n\n// Input types\nexport type input_int = int;\nexport type input_float = float;\nexport type input_bool = bool;\nexport type input_string = string;\nexport type input_color = color;\n\n// Const types (compile-time constants)\nexport type const_int = int;\nexport type const_float = float;\nexport type const_bool = bool;\nexport type const_string = string;\nexport type const_color = color;\n\n// Source types for indicators\nexport type Source = series_float;\n\n// Array types\n// PineScript arrays are JS arrays; aliased for API parity and future extension.\nexport type PineArray<T> = Array<T>;\n\n// Map types\n// PineScript maps are JS Maps: keys in insertion order, exact key equality.\nexport type PineMapKey = number | string | boolean;\nexport type PineMap<K extends PineMapKey, V> = Map<K, V>;\n\n// Matrix types\nexport interface PineMatrix<T> {\n rows: int;\n columns: int;\n data: T[][];\n}\n\n// Drawing object types - Now implemented for computational use!\n// While primarily used for visualization in PineScript, these objects have computational value:\n// - line.get_price() for trend analysis\n// - box getters for gap detection and range breakouts\n\n/**\n * Line object - Represents a line on the chart\n * @remarks\n * While lines are visual in PineScript, line.get_price() provides computational value\n * for detecting trend line breakouts, calculating support/resistance levels, etc.\n */\nexport interface Line {\n /** First point's x coordinate (bar index or UNIX timestamp) */\n x1: number;\n /** First point's y coordinate (price level) */\n y1: number;\n /** Second point's x coordinate (bar index or UNIX timestamp) */\n x2: number;\n /** Second point's y coordinate (price level) */\n y2: number;\n /** X-axis coordinate system */\n xloc: 'bar_index' | 'bar_time';\n /** Extension mode */\n extend: 'none' | 'left' | 'right' | 'both';\n /** Line color (stored but not used for calculations) */\n color?: color;\n /** Line style (stored but not used for calculations) */\n style?: 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both';\n /** Line width in pixels (stored but not used for calculations) */\n width?: number;\n /** Display on the main chart pane (PineScript force_overlay) */\n force_overlay?: boolean;\n}\n\n/**\n * Box object - Represents a rectangular area on the chart\n * @remarks\n * Box getters (get_top, get_bottom, get_left, get_right) enable gap detection,\n * range breakout analysis, and consolidation zone identification.\n */\nexport interface Box {\n /** Left border x coordinate (bar index or UNIX timestamp) */\n left: number;\n /** Top border y coordinate (price level) */\n top: number;\n /** Right border x coordinate (bar index or UNIX timestamp) */\n right: number;\n /** Bottom border y coordinate (price level) */\n bottom: number;\n /** X-axis coordinate system */\n xloc: 'bar_index' | 'bar_time';\n /** Horizontal extension mode */\n extend: 'none' | 'left' | 'right' | 'both';\n /** Border color (stored but not used for calculations) */\n border_color?: color;\n /** Border width in pixels (stored but not used for calculations) */\n border_width?: number;\n /** Border style (stored but not used for calculations) */\n border_style?: 'solid' | 'dotted' | 'dashed';\n /** Background fill color (stored but not used for calculations) */\n bgcolor?: color;\n /** Text content displayed in the box */\n text?: string;\n /** Text size */\n text_size?: string | number;\n /** Text color */\n text_color?: color;\n /** Horizontal text alignment */\n text_halign?: 'left' | 'center' | 'right';\n /** Vertical text alignment */\n text_valign?: 'top' | 'center' | 'bottom';\n /** Text wrapping mode */\n text_wrap?: 'none' | 'auto';\n /** Text font family */\n text_font_family?: 'default' | 'monospace';\n /** Text formatting flags: 0 none, 1 bold, 2 italic, 3 bold + italic (PineScript text.format_*) */\n text_formatting?: number;\n /** Display on the main chart pane (PineScript force_overlay) */\n force_overlay?: boolean;\n}\n\n/**\n * Label object - Represents a label/annotation on the chart\n * @remarks\n * Labels have limited computational value. Primarily used for marking points and displaying text.\n */\nexport interface Label {\n /** X coordinate (bar index or UNIX timestamp) */\n x: number;\n /** Y coordinate (price level when yloc = 'price') */\n y: number;\n /** X-axis coordinate system */\n xloc: 'bar_index' | 'bar_time';\n /** Y-axis positioning mode */\n yloc: 'price' | 'abovebar' | 'belowbar';\n /** Label text content */\n text?: string;\n /** Tooltip text shown on hover */\n tooltip?: string;\n /** Border and arrow color */\n color?: color;\n /** Label style */\n style?: 'none' | 'xcross' | 'cross' | 'triangleup' | 'triangledown' | 'flag' | 'circle' |\n 'arrowup' | 'arrowdown' | 'label_up' | 'label_down' | 'label_left' | 'label_right' |\n 'label_lower_left' | 'label_lower_right' | 'label_upper_left' | 'label_upper_right' |\n 'label_center' | 'square' | 'diamond' | 'text_outline';\n /** Text color */\n textcolor?: color;\n /** Label size */\n size?: string | number;\n /** Text alignment */\n textalign?: 'left' | 'center' | 'right';\n /** Text font family */\n text_font_family?: 'default' | 'monospace';\n /** Text formatting flags: 0 none, 1 bold, 2 italic, 3 bold + italic (PineScript text.format_*) */\n text_formatting?: number;\n /** Display on the main chart pane (PineScript force_overlay) */\n force_overlay?: boolean;\n}\n\n/**\n * Linefill object - Represents a filled area between two lines\n * @remarks\n * Minimal computational value. Used to fill channel areas visually.\n */\nexport interface Linefill {\n /** First line reference */\n line1: Line;\n /** Second line reference */\n line2: Line;\n /** Fill color */\n color?: color;\n}\n\n/**\n * Table object - Represents a table for displaying data\n * @remarks\n * Tables have NO computational value (no getter functions in PineScript).\n * Purely for display/visualization purposes.\n */\nexport interface Table {\n /** Table position on chart */\n position: 'top_left' | 'top_center' | 'top_right' |\n 'middle_left' | 'middle_center' | 'middle_right' |\n 'bottom_left' | 'bottom_center' | 'bottom_right';\n /** Number of columns */\n columns: number;\n /** Number of rows */\n rows: number;\n /** Outer frame color */\n frame_color?: color;\n /** Outer frame width */\n frame_width?: number;\n /** Cell border color */\n border_color?: color;\n /** Cell border width */\n border_width?: number;\n /** Table background color */\n bgcolor?: color;\n /** Display on the main chart pane (PineScript force_overlay) */\n force_overlay?: boolean;\n /** Cells by \"column,row\" */\n cells?: Map<string, TableCell>;\n /** Merged cell ranges (PineScript table.merge_cells) */\n merges?: TableMerge[];\n}\n\n/**\n * Merged cell range of a table\n */\nexport interface TableMerge {\n start_column: number;\n start_row: number;\n end_column: number;\n end_row: number;\n}\n\n/**\n * Table cell data\n */\nexport interface TableCell {\n /** Cell text content */\n text?: string;\n /** Cell width as percentage */\n width?: number;\n /** Cell height as percentage */\n height?: number;\n /** Text color */\n text_color?: color;\n /** Horizontal text alignment */\n text_halign?: 'left' | 'center' | 'right';\n /** Vertical text alignment */\n text_valign?: 'top' | 'center' | 'bottom';\n /** Text size */\n text_size?: string | number;\n /** Cell background color */\n bgcolor?: color;\n /** Cell tooltip */\n tooltip?: string;\n /** Text font family */\n text_font_family?: 'default' | 'monospace';\n /** Text formatting flags: 0 none, 1 bold, 2 italic, 3 bold + italic (PineScript text.format_*) */\n text_formatting?: number;\n}\n\n// Series types for drawing objects\nexport type series_line = series<Line>;\nexport type series_box = series<Box>;\nexport type series_label = series<Label>;\nexport type series_linefill = series<Linefill>;\nexport type series_table = series<Table>;\n\n/**\n * Plot object - Represents a plot instance created by plot() function\n * @remarks\n * In PineScript, plot() returns a reference to a plot instance that can be used with fill().\n * This ID is used to reference the plot for filling between plots.\n */\nexport interface Plot {\n /** Unique identifier for this plot */\n id: string;\n /** Series being plotted */\n series: any;\n /** Plot title */\n title?: string;\n /** Plot color */\n color?: any;\n /** Line width */\n linewidth?: number;\n /** Plot style */\n style?: 'line' | 'stepline' | 'histogram' | 'area' | 'circles' | 'columns';\n /** Track price on y-axis */\n trackprice?: boolean;\n /** Histogram base level */\n histbase?: number;\n /** Offset in bars */\n offset?: number;\n /** Join gaps */\n join?: boolean;\n /** Editable in chart */\n editable?: boolean;\n /** Display mode */\n display?: 'all' | 'none';\n}\n\n/**\n * HLine object - Represents a horizontal line instance created by hline() function\n * @remarks\n * In PineScript, hline() returns a reference to an hline instance that can be used with fill().\n * This ID is used to reference the horizontal line for filling between levels.\n */\nexport interface HLine {\n /** Unique identifier for this hline */\n id: string;\n /** Price level for the horizontal line */\n price: number;\n /** Line title */\n title?: string;\n /** Line color */\n color?: any;\n /** Line style */\n linestyle?: 'solid' | 'dashed' | 'dotted';\n /** Line width */\n linewidth?: number;\n /** Editable in chart */\n editable?: boolean;\n}\n\n// Series types for plot and hline (always series qualifier in PineScript)\nexport type series_plot = Plot;\nexport type series_hline = HLine;\n\n// Excluded types (StrategyEntry, StrategyExit) - not used in calculation-only library\n\n// Bar data\nexport interface Bar {\n time: int;\n open: float;\n high: float;\n low: float;\n close: float;\n volume?: float;\n}\n\n// OHLC data type\nexport interface OHLC {\n open: series_float;\n high: series_float;\n low: series_float;\n close: series_float;\n volume?: series_float;\n}\n\n// Constants\nexport const na = null;\nexport type na = null;\n\n/**\n * X-axis location constants\n * Used to specify whether x-coordinates are bar indices or timestamps\n */\nexport const xloc = {\n /** X-coordinates are bar indices */\n bar_index: 'bar_index' as const,\n /** X-coordinates are UNIX timestamps in milliseconds */\n bar_time: 'bar_time' as const,\n};\n\n/**\n * Table position constants (PineScript `position.*`), for `table.new` and `table.set_position`\n */\nexport const position = {\n top_left: 'top_left' as const,\n top_center: 'top_center' as const,\n top_right: 'top_right' as const,\n middle_left: 'middle_left' as const,\n middle_center: 'middle_center' as const,\n middle_right: 'middle_right' as const,\n bottom_left: 'bottom_left' as const,\n bottom_center: 'bottom_center' as const,\n bottom_right: 'bottom_right' as const,\n};\n\n/**\n * ChartPoint interface - Represents a point on the chart\n * @remarks\n * A chart point can have time, index, and price coordinates.\n * At least one of time or index should be provided for x-coordinate positioning.\n */\nexport interface ChartPoint {\n /** UNIX timestamp in milliseconds (null if using bar index) */\n readonly time: number | null;\n /** Bar index (null if using time) */\n readonly index: number | null;\n /** Y-axis price value */\n readonly price: number;\n}\n\n/**\n * Polyline interface - Represents a polyline on the chart\n * @remarks\n * A polyline connects multiple chart points with line segments.\n * When closed, it forms a polygon that can be filled with color.\n */\nexport interface Polyline {\n /** Unique identifier for this polyline */\n readonly id: string;\n /** Array of chart points that define the polyline */\n readonly points: readonly ChartPoint[];\n /** If true, use curved line segments (not yet supported - uses straight lines) */\n readonly curved: boolean;\n /** If true, connect the first point to the last point */\n readonly closed: boolean;\n /** X-coordinate mode: 'bar_index' or 'bar_time' */\n readonly xloc: 'bar_index' | 'bar_time';\n /** Color of line segments */\n readonly line_color: color;\n /** Fill color for closed polylines (null for no fill) */\n readonly fill_color: color | null;\n /** Line style */\n readonly line_style: 'solid' | 'dotted' | 'dashed';\n /** Line width in pixels */\n readonly line_width: number;\n /** Force display on main pane */\n readonly force_overlay: boolean;\n}\n\n// Series types for chart point and polyline\nexport type series_chartpoint = series<ChartPoint>;\nexport type series_polyline = series<Polyline>;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkWO,MAAM,KAAK;AAOX,MAAM,OAAO;AAAA;AAAA,EAElB,WAAW;AAAA;AAAA,EAEX,UAAU;
|
|
4
|
+
"sourcesContent": ["/**\n * Core types for OakScriptJS\n * These types mirror the PineScript type system\n */\n\n// Basic types\nexport type int = number;\nexport type float = number;\nexport type bool = boolean;\n//export type string = string;\nexport type color = string | number;\n\n// Series types - In PineScript, series are time-series arrays\nexport type series<T> = T[];\nexport type series_int = series<int>;\nexport type series_float = series<float>;\nexport type series_bool = series<bool>;\nexport type series_string = series<string>;\nexport type series_color = series<color>;\n\n// Simple types (non-series)\nexport type simple_int = int;\nexport type simple_float = float;\nexport type simple_bool = bool;\nexport type simple_string = string;\nexport type simple_color = color;\n\n// Input types\nexport type input_int = int;\nexport type input_float = float;\nexport type input_bool = bool;\nexport type input_string = string;\nexport type input_color = color;\n\n// Const types (compile-time constants)\nexport type const_int = int;\nexport type const_float = float;\nexport type const_bool = bool;\nexport type const_string = string;\nexport type const_color = color;\n\n// Source types for indicators\nexport type Source = series_float;\n\n// Array types\n// PineScript arrays are JS arrays; aliased for API parity and future extension.\nexport type PineArray<T> = Array<T>;\n\n// Map types\n// PineScript maps are JS Maps: keys in insertion order, exact key equality.\nexport type PineMapKey = number | string | boolean;\nexport type PineMap<K extends PineMapKey, V> = Map<K, V>;\n\n// Matrix types\nexport interface PineMatrix<T> {\n rows: int;\n columns: int;\n data: T[][];\n}\n\n// Drawing object types - Now implemented for computational use!\n// While primarily used for visualization in PineScript, these objects have computational value:\n// - line.get_price() for trend analysis\n// - box getters for gap detection and range breakouts\n\n/**\n * Line object - Represents a line on the chart\n * @remarks\n * While lines are visual in PineScript, line.get_price() provides computational value\n * for detecting trend line breakouts, calculating support/resistance levels, etc.\n */\nexport interface Line {\n /** First point's x coordinate (bar index, UNIX timestamp, or percent of the pane's width with xloc 'pane') */\n x1: number;\n /** First point's y coordinate (price level) */\n y1: number;\n /** Second point's x coordinate (bar index, UNIX timestamp, or percent of the pane's width with xloc 'pane') */\n x2: number;\n /** Second point's y coordinate (price level) */\n y2: number;\n /** X-axis coordinate system */\n xloc: 'bar_index' | 'bar_time' | 'pane';\n /** Extension mode */\n extend: 'none' | 'left' | 'right' | 'both';\n /** Line color (stored but not used for calculations) */\n color?: color;\n /** Line style (stored but not used for calculations) */\n style?: 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both';\n /** Line width in pixels (stored but not used for calculations) */\n width?: number;\n /** Display on the main chart pane (PineScript force_overlay) */\n force_overlay?: boolean;\n}\n\n/**\n * Box object - Represents a rectangular area on the chart\n * @remarks\n * Box getters (get_top, get_bottom, get_left, get_right) enable gap detection,\n * range breakout analysis, and consolidation zone identification.\n */\nexport interface Box {\n /** Left border x coordinate (bar index, UNIX timestamp, or percent of the pane's width with xloc 'pane') */\n left: number;\n /** Top border y coordinate (price level) */\n top: number;\n /** Right border x coordinate (bar index, UNIX timestamp, or percent of the pane's width with xloc 'pane') */\n right: number;\n /** Bottom border y coordinate (price level) */\n bottom: number;\n /** X-axis coordinate system */\n xloc: 'bar_index' | 'bar_time' | 'pane';\n /** Horizontal extension mode */\n extend: 'none' | 'left' | 'right' | 'both';\n /** Border color (stored but not used for calculations) */\n border_color?: color;\n /** Border width in pixels (stored but not used for calculations) */\n border_width?: number;\n /** Border style (stored but not used for calculations) */\n border_style?: 'solid' | 'dotted' | 'dashed';\n /** Background fill color (stored but not used for calculations) */\n bgcolor?: color;\n /** Text content displayed in the box */\n text?: string;\n /** Text size */\n text_size?: string | number;\n /** Text color */\n text_color?: color;\n /** Horizontal text alignment */\n text_halign?: 'left' | 'center' | 'right';\n /** Vertical text alignment */\n text_valign?: 'top' | 'center' | 'bottom';\n /** Text wrapping mode */\n text_wrap?: 'none' | 'auto';\n /** Text font family */\n text_font_family?: 'default' | 'monospace';\n /** Text formatting flags: 0 none, 1 bold, 2 italic, 3 bold + italic (PineScript text.format_*) */\n text_formatting?: number;\n /** Display on the main chart pane (PineScript force_overlay) */\n force_overlay?: boolean;\n}\n\n/**\n * Label object - Represents a label/annotation on the chart\n * @remarks\n * Labels have limited computational value. Primarily used for marking points and displaying text.\n */\nexport interface Label {\n /** X coordinate (bar index, UNIX timestamp, or percent of the pane's width with xloc 'pane') */\n x: number;\n /** Y coordinate (price level when yloc = 'price') */\n y: number;\n /** X-axis coordinate system */\n xloc: 'bar_index' | 'bar_time' | 'pane';\n /** Y-axis positioning mode */\n yloc: 'price' | 'abovebar' | 'belowbar';\n /** Label text content */\n text?: string;\n /** Tooltip text shown on hover */\n tooltip?: string;\n /** Border and arrow color */\n color?: color;\n /** Label style */\n style?: 'none' | 'xcross' | 'cross' | 'triangleup' | 'triangledown' | 'flag' | 'circle' |\n 'arrowup' | 'arrowdown' | 'label_up' | 'label_down' | 'label_left' | 'label_right' |\n 'label_lower_left' | 'label_lower_right' | 'label_upper_left' | 'label_upper_right' |\n 'label_center' | 'square' | 'diamond' | 'text_outline';\n /** Text color */\n textcolor?: color;\n /** Label size */\n size?: string | number;\n /** Text alignment */\n textalign?: 'left' | 'center' | 'right';\n /** Text font family */\n text_font_family?: 'default' | 'monospace';\n /** Text formatting flags: 0 none, 1 bold, 2 italic, 3 bold + italic (PineScript text.format_*) */\n text_formatting?: number;\n /** Display on the main chart pane (PineScript force_overlay) */\n force_overlay?: boolean;\n}\n\n/**\n * Linefill object - Represents a filled area between two lines\n * @remarks\n * Minimal computational value. Used to fill channel areas visually.\n */\nexport interface Linefill {\n /** First line reference */\n line1: Line;\n /** Second line reference */\n line2: Line;\n /** Fill color */\n color?: color;\n}\n\n/**\n * Table object - Represents a table for displaying data\n * @remarks\n * Tables have NO computational value (no getter functions in PineScript).\n * Purely for display/visualization purposes.\n */\nexport interface Table {\n /** Table position on chart */\n position: 'top_left' | 'top_center' | 'top_right' |\n 'middle_left' | 'middle_center' | 'middle_right' |\n 'bottom_left' | 'bottom_center' | 'bottom_right';\n /** Number of columns */\n columns: number;\n /** Number of rows */\n rows: number;\n /** Outer frame color */\n frame_color?: color;\n /** Outer frame width */\n frame_width?: number;\n /** Cell border color */\n border_color?: color;\n /** Cell border width */\n border_width?: number;\n /** Table background color */\n bgcolor?: color;\n /** Display on the main chart pane (PineScript force_overlay) */\n force_overlay?: boolean;\n /** Cells by \"column,row\" */\n cells?: Map<string, TableCell>;\n /** Merged cell ranges (PineScript table.merge_cells) */\n merges?: TableMerge[];\n}\n\n/**\n * Merged cell range of a table\n */\nexport interface TableMerge {\n start_column: number;\n start_row: number;\n end_column: number;\n end_row: number;\n}\n\n/**\n * Table cell data\n */\nexport interface TableCell {\n /** Cell text content */\n text?: string;\n /** Cell width as percentage */\n width?: number;\n /** Cell height as percentage */\n height?: number;\n /** Text color */\n text_color?: color;\n /** Horizontal text alignment */\n text_halign?: 'left' | 'center' | 'right';\n /** Vertical text alignment */\n text_valign?: 'top' | 'center' | 'bottom';\n /** Text size */\n text_size?: string | number;\n /** Cell background color */\n bgcolor?: color;\n /** Cell tooltip */\n tooltip?: string;\n /** Text font family */\n text_font_family?: 'default' | 'monospace';\n /** Text formatting flags: 0 none, 1 bold, 2 italic, 3 bold + italic (PineScript text.format_*) */\n text_formatting?: number;\n}\n\n// Series types for drawing objects\nexport type series_line = series<Line>;\nexport type series_box = series<Box>;\nexport type series_label = series<Label>;\nexport type series_linefill = series<Linefill>;\nexport type series_table = series<Table>;\n\n/**\n * Plot object - Represents a plot instance created by plot() function\n * @remarks\n * In PineScript, plot() returns a reference to a plot instance that can be used with fill().\n * This ID is used to reference the plot for filling between plots.\n */\nexport interface Plot {\n /** Unique identifier for this plot */\n id: string;\n /** Series being plotted */\n series: any;\n /** Plot title */\n title?: string;\n /** Plot color */\n color?: any;\n /** Line width */\n linewidth?: number;\n /** Plot style */\n style?: 'line' | 'stepline' | 'histogram' | 'area' | 'circles' | 'columns';\n /** Track price on y-axis */\n trackprice?: boolean;\n /** Histogram base level */\n histbase?: number;\n /** Offset in bars */\n offset?: number;\n /** Join gaps */\n join?: boolean;\n /** Editable in chart */\n editable?: boolean;\n /** Display mode */\n display?: 'all' | 'none';\n}\n\n/**\n * HLine object - Represents a horizontal line instance created by hline() function\n * @remarks\n * In PineScript, hline() returns a reference to an hline instance that can be used with fill().\n * This ID is used to reference the horizontal line for filling between levels.\n */\nexport interface HLine {\n /** Unique identifier for this hline */\n id: string;\n /** Price level for the horizontal line */\n price: number;\n /** Line title */\n title?: string;\n /** Line color */\n color?: any;\n /** Line style */\n linestyle?: 'solid' | 'dashed' | 'dotted';\n /** Line width */\n linewidth?: number;\n /** Editable in chart */\n editable?: boolean;\n}\n\n// Series types for plot and hline (always series qualifier in PineScript)\nexport type series_plot = Plot;\nexport type series_hline = HLine;\n\n// Excluded types (StrategyEntry, StrategyExit) - not used in calculation-only library\n\n// Bar data\nexport interface Bar {\n time: int;\n open: float;\n high: float;\n low: float;\n close: float;\n volume?: float;\n}\n\n// OHLC data type\nexport interface OHLC {\n open: series_float;\n high: series_float;\n low: series_float;\n close: series_float;\n volume?: series_float;\n}\n\n// Constants\nexport const na = null;\nexport type na = null;\n\n/**\n * X-axis location constants\n * Used to specify whether x-coordinates are bar indices, timestamps or places on the pane\n */\nexport const xloc = {\n /** X-coordinates are bar indices */\n bar_index: 'bar_index' as const,\n /** X-coordinates are UNIX timestamps in milliseconds */\n bar_time: 'bar_time' as const,\n /** X-coordinates are percents of the pane's width: 0 left edge, 100 right edge (not a PineScript value) */\n pane: 'pane' as const,\n};\n\n/**\n * Table position constants (PineScript `position.*`), for `table.new` and `table.set_position`\n */\nexport const position = {\n top_left: 'top_left' as const,\n top_center: 'top_center' as const,\n top_right: 'top_right' as const,\n middle_left: 'middle_left' as const,\n middle_center: 'middle_center' as const,\n middle_right: 'middle_right' as const,\n bottom_left: 'bottom_left' as const,\n bottom_center: 'bottom_center' as const,\n bottom_right: 'bottom_right' as const,\n};\n\n/**\n * ChartPoint interface - Represents a point on the chart\n * @remarks\n * A chart point can have time, index, and price coordinates.\n * At least one of time or index should be provided for x-coordinate positioning.\n */\nexport interface ChartPoint {\n /** UNIX timestamp in milliseconds (null if using bar index) */\n readonly time: number | null;\n /** Bar index (null if using time) */\n readonly index: number | null;\n /** Y-axis price value */\n readonly price: number;\n}\n\n/**\n * Polyline interface - Represents a polyline on the chart\n * @remarks\n * A polyline connects multiple chart points with line segments.\n * When closed, it forms a polygon that can be filled with color.\n */\nexport interface Polyline {\n /** Unique identifier for this polyline */\n readonly id: string;\n /** Array of chart points that define the polyline */\n readonly points: readonly ChartPoint[];\n /** If true, use curved line segments (not yet supported - uses straight lines) */\n readonly curved: boolean;\n /** If true, connect the first point to the last point */\n readonly closed: boolean;\n /** X-coordinate mode: 'bar_index', 'bar_time' or 'pane' */\n readonly xloc: 'bar_index' | 'bar_time' | 'pane';\n /** Color of line segments */\n readonly line_color: color;\n /** Fill color for closed polylines (null for no fill) */\n readonly fill_color: color | null;\n /** Line style */\n readonly line_style: 'solid' | 'dotted' | 'dashed';\n /** Line width in pixels */\n readonly line_width: number;\n /** Force display on main pane */\n readonly force_overlay: boolean;\n}\n\n// Series types for chart point and polyline\nexport type series_chartpoint = series<ChartPoint>;\nexport type series_polyline = series<Polyline>;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkWO,MAAM,KAAK;AAOX,MAAM,OAAO;AAAA;AAAA,EAElB,WAAW;AAAA;AAAA,EAEX,UAAU;AAAA;AAAA,EAEV,MAAM;AACR;AAKO,MAAM,WAAW;AAAA,EACtB,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,aAAa;AAAA,EACb,eAAe;AAAA,EACf,cAAc;AAAA,EACd,aAAa;AAAA,EACb,eAAe;AAAA,EACf,cAAc;AAChB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -352,8 +352,9 @@ export interface LabelData {
|
|
|
352
352
|
time: number;
|
|
353
353
|
/** 'bar_time': the x coordinates are times given by the script (xloc.bar_time). A time after the last bar is
|
|
354
354
|
* drawn on the future bar that holds it, on the chart's calendar (trading sessions). Omitted: bar indexes (a
|
|
355
|
-
* future bar index k bars after the last bar has the time lastTime + k * interval).
|
|
356
|
-
|
|
355
|
+
* future bar index k bars after the last bar has the time lastTime + k * interval). 'pane': the times are percents
|
|
356
|
+
* of the pane's width (0 left edge, 100 right edge): drawn there whatever bars are in view. */
|
|
357
|
+
xloc?: 'bar_time' | 'pane';
|
|
357
358
|
/** Price; not used with yloc 'abovebar' / 'belowbar' */
|
|
358
359
|
price: number;
|
|
359
360
|
text: string;
|
|
@@ -389,8 +390,9 @@ export interface LineDrawingData {
|
|
|
389
390
|
price2: number;
|
|
390
391
|
/** 'bar_time': the x coordinates are times given by the script (xloc.bar_time). A time after the last bar is
|
|
391
392
|
* drawn on the future bar that holds it, on the chart's calendar (trading sessions). Omitted: bar indexes (a
|
|
392
|
-
* future bar index k bars after the last bar has the time lastTime + k * interval).
|
|
393
|
-
|
|
393
|
+
* future bar index k bars after the last bar has the time lastTime + k * interval). 'pane': the times are percents
|
|
394
|
+
* of the pane's width (0 left edge, 100 right edge): drawn there whatever bars are in view. */
|
|
395
|
+
xloc?: 'bar_time' | 'pane';
|
|
394
396
|
/** Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */
|
|
395
397
|
color?: string;
|
|
396
398
|
/** Omitted: 1. A width of 0 is kept (PineScript `width = 0`) */
|
|
@@ -411,8 +413,9 @@ export interface BoxData {
|
|
|
411
413
|
price2: number;
|
|
412
414
|
/** 'bar_time': the x coordinates are times given by the script (xloc.bar_time). A time after the last bar is
|
|
413
415
|
* drawn on the future bar that holds it, on the chart's calendar (trading sessions). Omitted: bar indexes (a
|
|
414
|
-
* future bar index k bars after the last bar has the time lastTime + k * interval).
|
|
415
|
-
|
|
416
|
+
* future bar index k bars after the last bar has the time lastTime + k * interval). 'pane': the times are percents
|
|
417
|
+
* of the pane's width (0 left edge, 100 right edge): drawn there whatever bars are in view. */
|
|
418
|
+
xloc?: 'bar_time' | 'pane';
|
|
416
419
|
/** Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */
|
|
417
420
|
bgColor?: string;
|
|
418
421
|
/** Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */
|
|
@@ -457,8 +460,9 @@ export interface PolylineData {
|
|
|
457
460
|
}>;
|
|
458
461
|
/** 'bar_time': the x coordinates are times given by the script (xloc.bar_time). A time after the last bar is
|
|
459
462
|
* drawn on the future bar that holds it, on the chart's calendar (trading sessions). Omitted: bar indexes (a
|
|
460
|
-
* future bar index k bars after the last bar has the time lastTime + k * interval).
|
|
461
|
-
|
|
463
|
+
* future bar index k bars after the last bar has the time lastTime + k * interval). 'pane': the times are percents
|
|
464
|
+
* of the pane's width (0 left edge, 100 right edge): drawn there whatever bars are in view. */
|
|
465
|
+
xloc?: 'bar_time' | 'pane';
|
|
462
466
|
/** Curved segments between the points */
|
|
463
467
|
curved?: boolean;
|
|
464
468
|
/** The last point is connected to the first */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../src/types/metadata.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,kBAAkB,CAAC;AAE/J;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,aAAa,GAAG,aAAa,GAAG,MAAM,CAAC;AAElF;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,iBAA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CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK;IAChE,yBAAyB;IACzB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,yBAAyB;IACzB,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,QAAQ,EAAE,GAAG,SAAS,EAAE,CAAC;CACtD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/metadata.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @fileoverview Type definitions for indicator metadata\n * These types define the structure of data returned by indicators\n * @module types/metadata\n */\n\n/**\n * Plot style options\n */\nexport type PlotStyle = 'line' | 'stepline' | 'histogram' | 'area' | 'circles' | 'columns' | 'cross' | 'areabr' | 'steplinebr' | 'linebr' | 'stepline_diamond';\n\n/**\n * Line style options\n */\nexport type LineStyle = 'solid' | 'dashed' | 'dotted';\n\n/**\n * Plot display options\n */\nexport type PlotDisplay = 'all' | 'none' | 'data_window' | 'status_line' | 'pane';\n\n/**\n * Options for a plot\n */\nexport interface PlotOptions {\n /** Plot title */\n title?: string;\n /** Plot color (hex string or named color) */\n color?: string;\n /** Line width */\n linewidth?: number;\n /** Plot style */\n style?: PlotStyle;\n /** Line style (PineScript `linestyle`); default solid. A constant or an input value, not per bar */\n linestyle?: LineStyle;\n /** Track price on price scale */\n trackprice?: boolean;\n /** Histogram base value */\n histbase?: number;\n /** Offset from current bar */\n offset?: number;\n /** Join gaps in data */\n join?: boolean;\n /** User can edit */\n editable?: boolean;\n /** Display mode */\n display?: PlotDisplay;\n /** Transparency (0-100) */\n transp?: number;\n /** Draw the plot on the main chart pane even when the indicator is not an overlay; default false */\n force_overlay?: boolean;\n}\n\n/**\n * Options for a horizontal line\n */\nexport interface HLineOptions {\n /** Line title */\n title?: string;\n /** Line color */\n color?: string;\n /** Line style (PineScript default: dashed) */\n linestyle?: LineStyle;\n /** Line width */\n linewidth?: number;\n /** User can edit */\n editable?: boolean;\n}\n\n/**\n * Options for a fill\n */\nexport interface FillOptions {\n /** Fill color */\n color?: string;\n /** Transparency (0-100) */\n transp?: number;\n /** Fill title */\n title?: string;\n /** User can edit */\n editable?: boolean;\n /** Fill gaps in data */\n fillgaps?: boolean;\n}\n\n/**\n * Input parameter type\n */\nexport type InputType = 'int' | 'float' | 'bool' | 'string' | 'source' | 'color' | 'timeframe' | 'session' | 'time' | 'symbol';\n\n/**\n * Input parameter metadata\n */\nexport interface InputMetadata {\n /** Input type */\n type: InputType;\n /** Internal name (snake_case) */\n name: string;\n /** Display title */\n title: string;\n /** Default value */\n defval: any;\n /** Minimum value (for numeric inputs) */\n minval?: number;\n /** Maximum value (for numeric inputs) */\n maxval?: number;\n /** Step size (for numeric inputs) */\n step?: number;\n /** Tooltip text */\n tooltip?: string;\n /** Inline group */\n inline?: string;\n /** Parameter group */\n group?: string;\n /** Options for dropdown (for string/source inputs) */\n options?: any[];\n /** Confirm before changing */\n confirm?: boolean;\n}\n\n/**\n * Plot metadata\n */\nexport interface PlotMetadata {\n /** Variable name for the plot */\n varName: string;\n /** Plot title */\n title: string;\n /** Plot color */\n color: string;\n /** Line width */\n linewidth: number;\n /** Plot style */\n style: PlotStyle;\n}\n\n/**\n * Indicator metadata\n */\nexport interface IndicatorMetadata {\n /** Indicator title */\n title: string;\n /** Short title */\n shorttitle?: string;\n /** Overlay on main chart */\n overlay: boolean;\n /** Number format precision */\n precision?: number;\n /** Number format */\n format?: string;\n /** Timeframe */\n timeframe?: string;\n /** Show gaps in timeframes */\n timeframe_gaps?: boolean;\n /** Input parameters */\n inputs?: InputMetadata[];\n /** Plots */\n plots?: PlotMetadata[];\n}\n\n/**\n * Time-value pair for charting\n */\nexport interface TimeValue {\n /** Time (timestamp or string) */\n time: any;\n /** Value */\n value: number;\n /** Per-bar color override */\n color?: string;\n}\n\n/**\n * Plot data with options\n */\nexport interface PlotData {\n /** Time-value pairs */\n data: TimeValue[];\n /** Plot options */\n options?: PlotOptions;\n}\n\n/**\n * Horizontal line data\n */\nexport interface HLineData {\n /** Id of the declaration that produced it (its config entry) */\n id?: string;\n /** Y-axis value */\n value: number;\n /** Line options */\n options?: HLineOptions;\n}\n\n/**\n * Fill data (area between two plots)\n */\nexport interface FillData {\n /** Id of the declaration that produced it (its config entry) */\n id?: string;\n /** First plot index or name */\n plot1: number | string;\n /** Second plot index or name */\n plot2: number | string;\n /** Fill options */\n options?: FillOptions;\n /** Per-bar fill colors (overrides static options.color) */\n colors?: string[];\n /** Gradient fill (PineScript `fill(p1, p2, top_value, bottom_value, top_color, bottom_color)`) */\n gradient?: FillGradient;\n}\n\n/**\n * Gradient of a fill, one entry per bar. PineScript rules: the colour\n * changes with the price, `topColor` at `topValue` and `bottomColor` at `bottomValue`; outside that range the end\n * colour is kept; each bar has its own gradient (the part from bar i-1 to bar i uses the values of bar i).\n */\nexport interface FillGradient {\n /** Price of `topColor`, per bar */\n topValue: number[];\n /** Price of `bottomColor`, per bar */\n bottomValue: number[];\n /** Colour at `topValue`, per bar (null: na) */\n topColor: Array<string | null>;\n /** Colour at `bottomValue`, per bar (null: na) */\n bottomColor: Array<string | null>;\n}\n\n/**\n * Marker location on the chart (PineScript plotshape/plotchar `location.*`)\n */\nexport type MarkerLocation = 'abovebar' | 'belowbar' | 'top' | 'bottom' | 'absolute';\n\n/**\n * PineScript size constant (`size.auto`, `size.tiny`, ...)\n */\nexport type PineSize = 'auto' | 'tiny' | 'small' | 'normal' | 'large' | 'huge';\n\n/**\n * Marker size (PineScript size.* constants)\n */\nexport type MarkerSize = PineSize;\n\n/**\n * Shape style (PineScript shape.* constants)\n */\nexport type ShapeStyle =\n | 'xcross'\n | 'cross'\n | 'triangleup'\n | 'triangledown'\n | 'flag'\n | 'circle'\n | 'arrowup'\n | 'arrowdown'\n | 'labelup'\n | 'labeldown'\n | 'square'\n | 'diamond';\n\n/**\n * Position of a marker:\n * - aboveBar / belowBar / inBar: next to the bar (PineScript location.abovebar / location.belowbar)\n * - atPriceTop / atPriceBottom / atPriceMiddle: at `price` (PineScript location.absolute), with the meaning of the\n * lightweight-charts price positions: atPriceTop has the shape above the price, its bottom (the tip of a label) on\n * the price (shape.labeldown); atPriceBottom has the shape below the price, its top on the price (shape.labelup);\n * atPriceMiddle centres the shape on the price (other shapes)\n * - top / bottom: at the top / bottom edge of the pane of the indicator (PineScript location.top / location.bottom),\n * the price pane for an overlay indicator or with forceOverlay\n */\nexport type MarkerPosition =\n | 'aboveBar'\n | 'belowBar'\n | 'inBar'\n | 'atPriceTop'\n | 'atPriceBottom'\n | 'atPriceMiddle'\n | 'top'\n | 'bottom';\n\n/**\n * Marker shape (PineScript shape.* in the lightweight-charts spelling)\n */\nexport type MarkerShape =\n | 'arrowUp'\n | 'arrowDown'\n | 'circle'\n | 'square'\n | 'labelUp'\n | 'labelDown'\n | 'triangleUp'\n | 'triangleDown'\n | 'cross'\n | 'xcross'\n | 'diamond'\n | 'flag';\n\n/**\n * One marker: a plotshape()/plotchar() marker on a bar where the condition held, or a marker of a built-in indicator\n */\nexport interface MarkerData {\n /** Time of the bar the marker is displayed on (offset already applied) */\n time: number;\n /** Where the marker is drawn */\n position: MarkerPosition;\n /** Price of the atPrice* positions (required with them) */\n price?: number;\n /** Shape. A plotchar marker also has `char`: the character is drawn in place of the shape */\n shape: MarkerShape;\n /**\n * Shape colour (the character colour of a plotchar marker). A fully transparent colour ('transparent',\n * '#rrggbb00', 'rgba(r, g, b, 0)') draws no shape, as PineScript `color = na`; the text is still drawn\n */\n color: string;\n /** Text; a line feed starts a new line */\n text?: string;\n /**\n * Text colour (PineScript textcolor). When omitted: white inside label shapes (labelUp / labelDown), the shape\n * colour for the other shapes\n */\n textColor?: string;\n /** Size multiplier (1 = default size) or a PineScript size */\n size?: number | PineSize;\n /** PineScript force_overlay = true: the marker of a non-overlay indicator is drawn on the price pane */\n forceOverlay?: boolean;\n /** Id of the plotshape/plotchar declaration that produced it (script markers) */\n id?: string;\n /** plotchar character, drawn in place of the shape */\n char?: string;\n /** Hover tooltip */\n tooltip?: string;\n}\n\n/**\n * Per-bar arrow from plotarrow(): up arrow for a positive value, down arrow for a negative value\n */\nexport interface ArrowData {\n /** Time of the bar the arrow is displayed on (offset already applied) */\n time: any;\n /** Id of the plotarrow declaration that produced it */\n id: string;\n /** Series value (non-zero): its sign gives the direction, its absolute value the height */\n value: number;\n /** Arrow color (colorup or colordown of that bar) */\n color: string;\n}\n\n/**\n * Per-bar candle color (barcolor() output)\n */\nexport interface BarColorData {\n /** Id of the declaration that produced it (its config entry) */\n id?: string;\n /** Time of the colored bar (offset already applied) */\n time: number;\n /** Color */\n color: string;\n}\n\n/**\n * Per-bar background color (bgcolor() output)\n */\nexport interface BgColorData {\n /** Id of the declaration that produced it (its config entry) */\n id?: string;\n /** Time of the colored bar (offset already applied) */\n time: number;\n /** Color (with its transparency) */\n color: string;\n /** PineScript bgcolor(..., force_overlay = true): drawn on the price pane even for a non-overlay indicator */\n forceOverlay?: boolean;\n}\n\n/**\n * One candle of plotcandle() (or of a built-in indicator that draws candles)\n */\nexport interface PlotCandleData {\n time: number;\n open: number;\n high: number;\n low: number;\n close: number;\n /** Body colour */\n color?: string;\n borderColor?: string;\n wickColor?: string;\n /** PineScript force_overlay = true: the candles of a non-overlay indicator are drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/**\n * One bar of plotbar(): an OHLC bar (a vertical line from low to high, the open tick on the left, the close tick on\n * the right)\n */\nexport interface PlotBarData {\n time: number;\n open: number;\n high: number;\n low: number;\n close: number;\n color?: string;\n /** PineScript force_overlay = true: the bars of a non-overlay indicator are drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/** PineScript label style (`label.style_*` without the prefix) */\nexport type LabelStyle =\n | 'none'\n | 'xcross'\n | 'cross'\n | 'triangleup'\n | 'triangledown'\n | 'flag'\n | 'circle'\n | 'arrowup'\n | 'arrowdown'\n | 'label_up'\n | 'label_down'\n | 'label_left'\n | 'label_right'\n | 'label_lower_left'\n | 'label_lower_right'\n | 'label_upper_left'\n | 'label_upper_right'\n | 'label_center'\n | 'square'\n | 'diamond'\n | 'text_outline';\n\n// Drawing outputs (labels, lines, boxes, linefills, polylines, tables). A field the script did not set is omitted and\n// the renderer uses the PineScript default; a colour set to na is 'transparent'. A point on a bar after the last bar\n// (PineScript bar_index + k) has the time of that future bar (see barTime). The same applies to markers and plots.\n\n/**\n * A label (PineScript label.new)\n */\nexport interface LabelData {\n time: number;\n /** 'bar_time': the x coordinates are times given by the script (xloc.bar_time). A time after the last bar is\n * drawn on the future bar that holds it, on the chart's calendar (trading sessions). Omitted: bar indexes (a\n * future bar index k bars after the last bar has the time lastTime + k * interval). */\n xloc?: 'bar_time';\n /** Price; not used with yloc 'abovebar' / 'belowbar' */\n price: number;\n text: string;\n /** Background, border and arrow colour. Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */\n color?: string;\n /** Omitted: #FFFFFF in a v6 script, #363A45 in v4 and v5 (the result does not carry the version) */\n textColor?: string;\n /** 'none': text only, no background (PineScript label.style_none). Omitted: 'label_down' */\n style?: LabelStyle;\n /** Omitted: 'normal' */\n size?: PineSize | number;\n /**\n * PineScript yloc: 'price' (default) places the label at `price`; 'abovebar' / 'belowbar' place it above the bar\n * high / below the bar low and ignore `price` (the renderer reads the bar at `time`).\n */\n yloc?: 'price' | 'abovebar' | 'belowbar';\n /** Omitted: 'center' */\n textAlign?: 'left' | 'center' | 'right';\n tooltip?: string;\n fontFamily?: 'default' | 'monospace';\n /** PineScript text.format_* flags: 0 none, 1 bold, 2 italic, 3 bold + italic */\n textFormatting?: number;\n /** PineScript force_overlay = true: the label of a non-overlay indicator is drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/**\n * A line (PineScript line.new)\n */\nexport interface LineDrawingData {\n time1: number;\n price1: number;\n time2: number;\n price2: number;\n /** 'bar_time': the x coordinates are times given by the script (xloc.bar_time). A time after the last bar is\n * drawn on the future bar that holds it, on the chart's calendar (trading sessions). Omitted: bar indexes (a\n * future bar index k bars after the last bar has the time lastTime + k * interval). */\n xloc?: 'bar_time';\n /** Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */\n color?: string;\n /** Omitted: 1. A width of 0 is kept (PineScript `width = 0`) */\n width?: number;\n /** Omitted: 'solid' */\n style?: 'solid' | 'dashed' | 'dotted' | 'arrow_left' | 'arrow_right' | 'arrow_both';\n extend?: 'none' | 'left' | 'right' | 'both';\n /** PineScript force_overlay = true: the line of a non-overlay indicator is drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/**\n * A rectangle (PineScript box.new): time1 / price1 are the left / top, time2 / price2 the right / bottom\n */\nexport interface BoxData {\n time1: number;\n price1: number;\n time2: number;\n price2: number;\n /** 'bar_time': the x coordinates are times given by the script (xloc.bar_time). A time after the last bar is\n * drawn on the future bar that holds it, on the chart's calendar (trading sessions). Omitted: bar indexes (a\n * future bar index k bars after the last bar has the time lastTime + k * interval). */\n xloc?: 'bar_time';\n /** Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */\n bgColor?: string;\n /** Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */\n borderColor?: string;\n /** Omitted: 1. A width of 0 is no border (PineScript `border_width = 0`) */\n borderWidth?: number;\n /** Omitted: 'solid' */\n borderStyle?: 'solid' | 'dashed' | 'dotted';\n text?: string;\n /** Omitted: #FFFFFF in a v6 script, #363A45 in v5 (the result does not carry the version) */\n textColor?: string;\n /** Omitted: 'auto' */\n textSize?: PineSize | number;\n /** Omitted: 'center' */\n textHAlign?: 'left' | 'center' | 'right';\n /** Omitted: 'center' */\n textVAlign?: 'top' | 'center' | 'bottom';\n textWrap?: 'none' | 'auto';\n fontFamily?: 'default' | 'monospace';\n /** PineScript text.format_* flags: 0 none, 1 bold, 2 italic, 3 bold + italic */\n textFormatting?: number;\n /** PineScript box extend: the box continues to the left / right edge of the chart */\n extend?: 'none' | 'left' | 'right' | 'both';\n /** PineScript force_overlay = true: the box of a non-overlay indicator is drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/**\n * The area between two lines (PineScript linefill.new), with the two lines as drawn (their extend included)\n */\nexport interface LinefillData {\n line1: LineDrawingData;\n line2: LineDrawingData;\n color?: string;\n}\n\n/**\n * A polyline (PineScript polyline.new)\n */\nexport interface PolylineData {\n points: Array<{ time: number; price: number }>;\n /** 'bar_time': the x coordinates are times given by the script (xloc.bar_time). A time after the last bar is\n * drawn on the future bar that holds it, on the chart's calendar (trading sessions). Omitted: bar indexes (a\n * future bar index k bars after the last bar has the time lastTime + k * interval). */\n xloc?: 'bar_time';\n /** Curved segments between the points */\n curved?: boolean;\n /** The last point is connected to the first */\n closed?: boolean;\n /** Omitted: #2962FF (color.blue) */\n lineColor?: string;\n /** Fill of the area inside the polyline. Omitted: no fill */\n fillColor?: string;\n lineStyle?: 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both';\n /** Omitted: 1 */\n lineWidth?: number;\n /** PineScript force_overlay = true: the polyline of a non-overlay indicator is drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/** Table position (PineScript position.*) */\nexport type TablePosition =\n | 'top_left'\n | 'top_center'\n | 'top_right'\n | 'middle_left'\n | 'middle_center'\n | 'middle_right'\n | 'bottom_left'\n | 'bottom_center'\n | 'bottom_right';\n\n/**\n * A table cell (PineScript table.cell)\n */\nexport interface TableCellData {\n row: number;\n column: number;\n text: string;\n /** Omitted: no background */\n bgColor?: string;\n /** Omitted: #363A45 (in v4, v5 and v6 scripts) */\n textColor?: string;\n /** Omitted: 'auto' */\n textSize?: PineSize | number;\n /** Width in % of the chart width; 0 fits the text */\n width?: number;\n /** Height in % of the chart height; 0 fits the text */\n height?: number;\n textHAlign?: 'left' | 'center' | 'right';\n textVAlign?: 'top' | 'center' | 'bottom';\n tooltip?: string;\n fontFamily?: 'default' | 'monospace';\n /** PineScript text.format_* flags: 0 none, 1 bold, 2 italic, 3 bold + italic */\n textFormatting?: number;\n}\n\n/**\n * Merged cells of a table (PineScript table.merge_cells): the cell at the start column / row covers the range and\n * gives its content\n */\nexport interface TableMergeData {\n startColumn: number;\n startRow: number;\n endColumn: number;\n endRow: number;\n}\n\n/**\n * A table (PineScript table.new)\n */\nexport interface TableData {\n position: TablePosition;\n columns: number;\n rows: number;\n cells: TableCellData[];\n merges?: TableMergeData[];\n /** Omitted: no background */\n bgColor?: string;\n /** Omitted: no frame */\n frameColor?: string;\n /** Omitted: 0 */\n frameWidth?: number;\n /** Omitted: no cell borders */\n borderColor?: string;\n /** Omitted: 0 */\n borderWidth?: number;\n /** PineScript force_overlay = true: the table of a non-overlay indicator is drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/**\n * Complete indicator calculation result\n */\nexport interface IndicatorResult {\n /** Indicator metadata */\n metadata: IndicatorMetadata;\n /** Plot data as Record mapping plot IDs to TimeValue arrays */\n plots: Record<string, TimeValue[]>;\n /** Horizontal lines */\n hlines?: HLineData[];\n /** Fills */\n fills?: FillData[];\n /** Markers from plotshape()/plotchar() */\n markers?: MarkerData[];\n /** Arrows from plotarrow() */\n arrows?: ArrowData[];\n /** Background colors from bgcolor() */\n bgColors?: BgColorData[];\n /** Bar colors from barcolor() */\n barColors?: BarColorData[];\n /** Candles from plotcandle(), keyed by plotcandle id */\n plotCandles?: Record<string, PlotCandleData[]>;\n /** OHLC bars from plotbar(), keyed by plotbar id */\n plotBars?: Record<string, PlotBarData[]>;\n /** Labels alive after the last bar */\n labels?: LabelData[];\n /** Lines alive after the last bar */\n lines?: LineDrawingData[];\n /** Boxes alive after the last bar */\n boxes?: BoxData[];\n /** Linefills alive after the last bar */\n linefills?: LinefillData[];\n /** Polylines alive after the last bar */\n polylines?: PolylineData[];\n /** Tables alive after the last bar */\n tables?: TableData[];\n}\n\n/**\n * Indicator factory function type\n */\nexport type IndicatorFactory = (options?: Record<string, any>) => {\n /** Indicator metadata */\n metadata: IndicatorMetadata;\n /** Calculate function */\n calculate: (bars: any[]) => PlotData[] | TimeValue[];\n};\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * @fileoverview Type definitions for indicator metadata\n * These types define the structure of data returned by indicators\n * @module types/metadata\n */\n\n/**\n * Plot style options\n */\nexport type PlotStyle = 'line' | 'stepline' | 'histogram' | 'area' | 'circles' | 'columns' | 'cross' | 'areabr' | 'steplinebr' | 'linebr' | 'stepline_diamond';\n\n/**\n * Line style options\n */\nexport type LineStyle = 'solid' | 'dashed' | 'dotted';\n\n/**\n * Plot display options\n */\nexport type PlotDisplay = 'all' | 'none' | 'data_window' | 'status_line' | 'pane';\n\n/**\n * Options for a plot\n */\nexport interface PlotOptions {\n /** Plot title */\n title?: string;\n /** Plot color (hex string or named color) */\n color?: string;\n /** Line width */\n linewidth?: number;\n /** Plot style */\n style?: PlotStyle;\n /** Line style (PineScript `linestyle`); default solid. A constant or an input value, not per bar */\n linestyle?: LineStyle;\n /** Track price on price scale */\n trackprice?: boolean;\n /** Histogram base value */\n histbase?: number;\n /** Offset from current bar */\n offset?: number;\n /** Join gaps in data */\n join?: boolean;\n /** User can edit */\n editable?: boolean;\n /** Display mode */\n display?: PlotDisplay;\n /** Transparency (0-100) */\n transp?: number;\n /** Draw the plot on the main chart pane even when the indicator is not an overlay; default false */\n force_overlay?: boolean;\n}\n\n/**\n * Options for a horizontal line\n */\nexport interface HLineOptions {\n /** Line title */\n title?: string;\n /** Line color */\n color?: string;\n /** Line style (PineScript default: dashed) */\n linestyle?: LineStyle;\n /** Line width */\n linewidth?: number;\n /** User can edit */\n editable?: boolean;\n}\n\n/**\n * Options for a fill\n */\nexport interface FillOptions {\n /** Fill color */\n color?: string;\n /** Transparency (0-100) */\n transp?: number;\n /** Fill title */\n title?: string;\n /** User can edit */\n editable?: boolean;\n /** Fill gaps in data */\n fillgaps?: boolean;\n}\n\n/**\n * Input parameter type\n */\nexport type InputType = 'int' | 'float' | 'bool' | 'string' | 'source' | 'color' | 'timeframe' | 'session' | 'time' | 'symbol';\n\n/**\n * Input parameter metadata\n */\nexport interface InputMetadata {\n /** Input type */\n type: InputType;\n /** Internal name (snake_case) */\n name: string;\n /** Display title */\n title: string;\n /** Default value */\n defval: any;\n /** Minimum value (for numeric inputs) */\n minval?: number;\n /** Maximum value (for numeric inputs) */\n maxval?: number;\n /** Step size (for numeric inputs) */\n step?: number;\n /** Tooltip text */\n tooltip?: string;\n /** Inline group */\n inline?: string;\n /** Parameter group */\n group?: string;\n /** Options for dropdown (for string/source inputs) */\n options?: any[];\n /** Confirm before changing */\n confirm?: boolean;\n}\n\n/**\n * Plot metadata\n */\nexport interface PlotMetadata {\n /** Variable name for the plot */\n varName: string;\n /** Plot title */\n title: string;\n /** Plot color */\n color: string;\n /** Line width */\n linewidth: number;\n /** Plot style */\n style: PlotStyle;\n}\n\n/**\n * Indicator metadata\n */\nexport interface IndicatorMetadata {\n /** Indicator title */\n title: string;\n /** Short title */\n shorttitle?: string;\n /** Overlay on main chart */\n overlay: boolean;\n /** Number format precision */\n precision?: number;\n /** Number format */\n format?: string;\n /** Timeframe */\n timeframe?: string;\n /** Show gaps in timeframes */\n timeframe_gaps?: boolean;\n /** Input parameters */\n inputs?: InputMetadata[];\n /** Plots */\n plots?: PlotMetadata[];\n}\n\n/**\n * Time-value pair for charting\n */\nexport interface TimeValue {\n /** Time (timestamp or string) */\n time: any;\n /** Value */\n value: number;\n /** Per-bar color override */\n color?: string;\n}\n\n/**\n * Plot data with options\n */\nexport interface PlotData {\n /** Time-value pairs */\n data: TimeValue[];\n /** Plot options */\n options?: PlotOptions;\n}\n\n/**\n * Horizontal line data\n */\nexport interface HLineData {\n /** Id of the declaration that produced it (its config entry) */\n id?: string;\n /** Y-axis value */\n value: number;\n /** Line options */\n options?: HLineOptions;\n}\n\n/**\n * Fill data (area between two plots)\n */\nexport interface FillData {\n /** Id of the declaration that produced it (its config entry) */\n id?: string;\n /** First plot index or name */\n plot1: number | string;\n /** Second plot index or name */\n plot2: number | string;\n /** Fill options */\n options?: FillOptions;\n /** Per-bar fill colors (overrides static options.color) */\n colors?: string[];\n /** Gradient fill (PineScript `fill(p1, p2, top_value, bottom_value, top_color, bottom_color)`) */\n gradient?: FillGradient;\n}\n\n/**\n * Gradient of a fill, one entry per bar. PineScript rules: the colour\n * changes with the price, `topColor` at `topValue` and `bottomColor` at `bottomValue`; outside that range the end\n * colour is kept; each bar has its own gradient (the part from bar i-1 to bar i uses the values of bar i).\n */\nexport interface FillGradient {\n /** Price of `topColor`, per bar */\n topValue: number[];\n /** Price of `bottomColor`, per bar */\n bottomValue: number[];\n /** Colour at `topValue`, per bar (null: na) */\n topColor: Array<string | null>;\n /** Colour at `bottomValue`, per bar (null: na) */\n bottomColor: Array<string | null>;\n}\n\n/**\n * Marker location on the chart (PineScript plotshape/plotchar `location.*`)\n */\nexport type MarkerLocation = 'abovebar' | 'belowbar' | 'top' | 'bottom' | 'absolute';\n\n/**\n * PineScript size constant (`size.auto`, `size.tiny`, ...)\n */\nexport type PineSize = 'auto' | 'tiny' | 'small' | 'normal' | 'large' | 'huge';\n\n/**\n * Marker size (PineScript size.* constants)\n */\nexport type MarkerSize = PineSize;\n\n/**\n * Shape style (PineScript shape.* constants)\n */\nexport type ShapeStyle =\n | 'xcross'\n | 'cross'\n | 'triangleup'\n | 'triangledown'\n | 'flag'\n | 'circle'\n | 'arrowup'\n | 'arrowdown'\n | 'labelup'\n | 'labeldown'\n | 'square'\n | 'diamond';\n\n/**\n * Position of a marker:\n * - aboveBar / belowBar / inBar: next to the bar (PineScript location.abovebar / location.belowbar)\n * - atPriceTop / atPriceBottom / atPriceMiddle: at `price` (PineScript location.absolute), with the meaning of the\n * lightweight-charts price positions: atPriceTop has the shape above the price, its bottom (the tip of a label) on\n * the price (shape.labeldown); atPriceBottom has the shape below the price, its top on the price (shape.labelup);\n * atPriceMiddle centres the shape on the price (other shapes)\n * - top / bottom: at the top / bottom edge of the pane of the indicator (PineScript location.top / location.bottom),\n * the price pane for an overlay indicator or with forceOverlay\n */\nexport type MarkerPosition =\n | 'aboveBar'\n | 'belowBar'\n | 'inBar'\n | 'atPriceTop'\n | 'atPriceBottom'\n | 'atPriceMiddle'\n | 'top'\n | 'bottom';\n\n/**\n * Marker shape (PineScript shape.* in the lightweight-charts spelling)\n */\nexport type MarkerShape =\n | 'arrowUp'\n | 'arrowDown'\n | 'circle'\n | 'square'\n | 'labelUp'\n | 'labelDown'\n | 'triangleUp'\n | 'triangleDown'\n | 'cross'\n | 'xcross'\n | 'diamond'\n | 'flag';\n\n/**\n * One marker: a plotshape()/plotchar() marker on a bar where the condition held, or a marker of a built-in indicator\n */\nexport interface MarkerData {\n /** Time of the bar the marker is displayed on (offset already applied) */\n time: number;\n /** Where the marker is drawn */\n position: MarkerPosition;\n /** Price of the atPrice* positions (required with them) */\n price?: number;\n /** Shape. A plotchar marker also has `char`: the character is drawn in place of the shape */\n shape: MarkerShape;\n /**\n * Shape colour (the character colour of a plotchar marker). A fully transparent colour ('transparent',\n * '#rrggbb00', 'rgba(r, g, b, 0)') draws no shape, as PineScript `color = na`; the text is still drawn\n */\n color: string;\n /** Text; a line feed starts a new line */\n text?: string;\n /**\n * Text colour (PineScript textcolor). When omitted: white inside label shapes (labelUp / labelDown), the shape\n * colour for the other shapes\n */\n textColor?: string;\n /** Size multiplier (1 = default size) or a PineScript size */\n size?: number | PineSize;\n /** PineScript force_overlay = true: the marker of a non-overlay indicator is drawn on the price pane */\n forceOverlay?: boolean;\n /** Id of the plotshape/plotchar declaration that produced it (script markers) */\n id?: string;\n /** plotchar character, drawn in place of the shape */\n char?: string;\n /** Hover tooltip */\n tooltip?: string;\n}\n\n/**\n * Per-bar arrow from plotarrow(): up arrow for a positive value, down arrow for a negative value\n */\nexport interface ArrowData {\n /** Time of the bar the arrow is displayed on (offset already applied) */\n time: any;\n /** Id of the plotarrow declaration that produced it */\n id: string;\n /** Series value (non-zero): its sign gives the direction, its absolute value the height */\n value: number;\n /** Arrow color (colorup or colordown of that bar) */\n color: string;\n}\n\n/**\n * Per-bar candle color (barcolor() output)\n */\nexport interface BarColorData {\n /** Id of the declaration that produced it (its config entry) */\n id?: string;\n /** Time of the colored bar (offset already applied) */\n time: number;\n /** Color */\n color: string;\n}\n\n/**\n * Per-bar background color (bgcolor() output)\n */\nexport interface BgColorData {\n /** Id of the declaration that produced it (its config entry) */\n id?: string;\n /** Time of the colored bar (offset already applied) */\n time: number;\n /** Color (with its transparency) */\n color: string;\n /** PineScript bgcolor(..., force_overlay = true): drawn on the price pane even for a non-overlay indicator */\n forceOverlay?: boolean;\n}\n\n/**\n * One candle of plotcandle() (or of a built-in indicator that draws candles)\n */\nexport interface PlotCandleData {\n time: number;\n open: number;\n high: number;\n low: number;\n close: number;\n /** Body colour */\n color?: string;\n borderColor?: string;\n wickColor?: string;\n /** PineScript force_overlay = true: the candles of a non-overlay indicator are drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/**\n * One bar of plotbar(): an OHLC bar (a vertical line from low to high, the open tick on the left, the close tick on\n * the right)\n */\nexport interface PlotBarData {\n time: number;\n open: number;\n high: number;\n low: number;\n close: number;\n color?: string;\n /** PineScript force_overlay = true: the bars of a non-overlay indicator are drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/** PineScript label style (`label.style_*` without the prefix) */\nexport type LabelStyle =\n | 'none'\n | 'xcross'\n | 'cross'\n | 'triangleup'\n | 'triangledown'\n | 'flag'\n | 'circle'\n | 'arrowup'\n | 'arrowdown'\n | 'label_up'\n | 'label_down'\n | 'label_left'\n | 'label_right'\n | 'label_lower_left'\n | 'label_lower_right'\n | 'label_upper_left'\n | 'label_upper_right'\n | 'label_center'\n | 'square'\n | 'diamond'\n | 'text_outline';\n\n// Drawing outputs (labels, lines, boxes, linefills, polylines, tables). A field the script did not set is omitted and\n// the renderer uses the PineScript default; a colour set to na is 'transparent'. A point on a bar after the last bar\n// (PineScript bar_index + k) has the time of that future bar (see barTime). The same applies to markers and plots.\n\n/**\n * A label (PineScript label.new)\n */\nexport interface LabelData {\n time: number;\n /** 'bar_time': the x coordinates are times given by the script (xloc.bar_time). A time after the last bar is\n * drawn on the future bar that holds it, on the chart's calendar (trading sessions). Omitted: bar indexes (a\n * future bar index k bars after the last bar has the time lastTime + k * interval). 'pane': the times are percents\n * of the pane's width (0 left edge, 100 right edge): drawn there whatever bars are in view. */\n xloc?: 'bar_time' | 'pane';\n /** Price; not used with yloc 'abovebar' / 'belowbar' */\n price: number;\n text: string;\n /** Background, border and arrow colour. Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */\n color?: string;\n /** Omitted: #FFFFFF in a v6 script, #363A45 in v4 and v5 (the result does not carry the version) */\n textColor?: string;\n /** 'none': text only, no background (PineScript label.style_none). Omitted: 'label_down' */\n style?: LabelStyle;\n /** Omitted: 'normal' */\n size?: PineSize | number;\n /**\n * PineScript yloc: 'price' (default) places the label at `price`; 'abovebar' / 'belowbar' place it above the bar\n * high / below the bar low and ignore `price` (the renderer reads the bar at `time`).\n */\n yloc?: 'price' | 'abovebar' | 'belowbar';\n /** Omitted: 'center' */\n textAlign?: 'left' | 'center' | 'right';\n tooltip?: string;\n fontFamily?: 'default' | 'monospace';\n /** PineScript text.format_* flags: 0 none, 1 bold, 2 italic, 3 bold + italic */\n textFormatting?: number;\n /** PineScript force_overlay = true: the label of a non-overlay indicator is drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/**\n * A line (PineScript line.new)\n */\nexport interface LineDrawingData {\n time1: number;\n price1: number;\n time2: number;\n price2: number;\n /** 'bar_time': the x coordinates are times given by the script (xloc.bar_time). A time after the last bar is\n * drawn on the future bar that holds it, on the chart's calendar (trading sessions). Omitted: bar indexes (a\n * future bar index k bars after the last bar has the time lastTime + k * interval). 'pane': the times are percents\n * of the pane's width (0 left edge, 100 right edge): drawn there whatever bars are in view. */\n xloc?: 'bar_time' | 'pane';\n /** Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */\n color?: string;\n /** Omitted: 1. A width of 0 is kept (PineScript `width = 0`) */\n width?: number;\n /** Omitted: 'solid' */\n style?: 'solid' | 'dashed' | 'dotted' | 'arrow_left' | 'arrow_right' | 'arrow_both';\n extend?: 'none' | 'left' | 'right' | 'both';\n /** PineScript force_overlay = true: the line of a non-overlay indicator is drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/**\n * A rectangle (PineScript box.new): time1 / price1 are the left / top, time2 / price2 the right / bottom\n */\nexport interface BoxData {\n time1: number;\n price1: number;\n time2: number;\n price2: number;\n /** 'bar_time': the x coordinates are times given by the script (xloc.bar_time). A time after the last bar is\n * drawn on the future bar that holds it, on the chart's calendar (trading sessions). Omitted: bar indexes (a\n * future bar index k bars after the last bar has the time lastTime + k * interval). 'pane': the times are percents\n * of the pane's width (0 left edge, 100 right edge): drawn there whatever bars are in view. */\n xloc?: 'bar_time' | 'pane';\n /** Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */\n bgColor?: string;\n /** Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */\n borderColor?: string;\n /** Omitted: 1. A width of 0 is no border (PineScript `border_width = 0`) */\n borderWidth?: number;\n /** Omitted: 'solid' */\n borderStyle?: 'solid' | 'dashed' | 'dotted';\n text?: string;\n /** Omitted: #FFFFFF in a v6 script, #363A45 in v5 (the result does not carry the version) */\n textColor?: string;\n /** Omitted: 'auto' */\n textSize?: PineSize | number;\n /** Omitted: 'center' */\n textHAlign?: 'left' | 'center' | 'right';\n /** Omitted: 'center' */\n textVAlign?: 'top' | 'center' | 'bottom';\n textWrap?: 'none' | 'auto';\n fontFamily?: 'default' | 'monospace';\n /** PineScript text.format_* flags: 0 none, 1 bold, 2 italic, 3 bold + italic */\n textFormatting?: number;\n /** PineScript box extend: the box continues to the left / right edge of the chart */\n extend?: 'none' | 'left' | 'right' | 'both';\n /** PineScript force_overlay = true: the box of a non-overlay indicator is drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/**\n * The area between two lines (PineScript linefill.new), with the two lines as drawn (their extend included)\n */\nexport interface LinefillData {\n line1: LineDrawingData;\n line2: LineDrawingData;\n color?: string;\n}\n\n/**\n * A polyline (PineScript polyline.new)\n */\nexport interface PolylineData {\n points: Array<{ time: number; price: number }>;\n /** 'bar_time': the x coordinates are times given by the script (xloc.bar_time). A time after the last bar is\n * drawn on the future bar that holds it, on the chart's calendar (trading sessions). Omitted: bar indexes (a\n * future bar index k bars after the last bar has the time lastTime + k * interval). 'pane': the times are percents\n * of the pane's width (0 left edge, 100 right edge): drawn there whatever bars are in view. */\n xloc?: 'bar_time' | 'pane';\n /** Curved segments between the points */\n curved?: boolean;\n /** The last point is connected to the first */\n closed?: boolean;\n /** Omitted: #2962FF (color.blue) */\n lineColor?: string;\n /** Fill of the area inside the polyline. Omitted: no fill */\n fillColor?: string;\n lineStyle?: 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both';\n /** Omitted: 1 */\n lineWidth?: number;\n /** PineScript force_overlay = true: the polyline of a non-overlay indicator is drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/** Table position (PineScript position.*) */\nexport type TablePosition =\n | 'top_left'\n | 'top_center'\n | 'top_right'\n | 'middle_left'\n | 'middle_center'\n | 'middle_right'\n | 'bottom_left'\n | 'bottom_center'\n | 'bottom_right';\n\n/**\n * A table cell (PineScript table.cell)\n */\nexport interface TableCellData {\n row: number;\n column: number;\n text: string;\n /** Omitted: no background */\n bgColor?: string;\n /** Omitted: #363A45 (in v4, v5 and v6 scripts) */\n textColor?: string;\n /** Omitted: 'auto' */\n textSize?: PineSize | number;\n /** Width in % of the chart width; 0 fits the text */\n width?: number;\n /** Height in % of the chart height; 0 fits the text */\n height?: number;\n textHAlign?: 'left' | 'center' | 'right';\n textVAlign?: 'top' | 'center' | 'bottom';\n tooltip?: string;\n fontFamily?: 'default' | 'monospace';\n /** PineScript text.format_* flags: 0 none, 1 bold, 2 italic, 3 bold + italic */\n textFormatting?: number;\n}\n\n/**\n * Merged cells of a table (PineScript table.merge_cells): the cell at the start column / row covers the range and\n * gives its content\n */\nexport interface TableMergeData {\n startColumn: number;\n startRow: number;\n endColumn: number;\n endRow: number;\n}\n\n/**\n * A table (PineScript table.new)\n */\nexport interface TableData {\n position: TablePosition;\n columns: number;\n rows: number;\n cells: TableCellData[];\n merges?: TableMergeData[];\n /** Omitted: no background */\n bgColor?: string;\n /** Omitted: no frame */\n frameColor?: string;\n /** Omitted: 0 */\n frameWidth?: number;\n /** Omitted: no cell borders */\n borderColor?: string;\n /** Omitted: 0 */\n borderWidth?: number;\n /** PineScript force_overlay = true: the table of a non-overlay indicator is drawn on the price pane */\n forceOverlay?: boolean;\n}\n\n/**\n * Complete indicator calculation result\n */\nexport interface IndicatorResult {\n /** Indicator metadata */\n metadata: IndicatorMetadata;\n /** Plot data as Record mapping plot IDs to TimeValue arrays */\n plots: Record<string, TimeValue[]>;\n /** Horizontal lines */\n hlines?: HLineData[];\n /** Fills */\n fills?: FillData[];\n /** Markers from plotshape()/plotchar() */\n markers?: MarkerData[];\n /** Arrows from plotarrow() */\n arrows?: ArrowData[];\n /** Background colors from bgcolor() */\n bgColors?: BgColorData[];\n /** Bar colors from barcolor() */\n barColors?: BarColorData[];\n /** Candles from plotcandle(), keyed by plotcandle id */\n plotCandles?: Record<string, PlotCandleData[]>;\n /** OHLC bars from plotbar(), keyed by plotbar id */\n plotBars?: Record<string, PlotBarData[]>;\n /** Labels alive after the last bar */\n labels?: LabelData[];\n /** Lines alive after the last bar */\n lines?: LineDrawingData[];\n /** Boxes alive after the last bar */\n boxes?: BoxData[];\n /** Linefills alive after the last bar */\n linefills?: LinefillData[];\n /** Polylines alive after the last bar */\n polylines?: PolylineData[];\n /** Tables alive after the last bar */\n tables?: TableData[];\n}\n\n/**\n * Indicator factory function type\n */\nexport type IndicatorFactory = (options?: Record<string, any>) => {\n /** Indicator metadata */\n metadata: IndicatorMetadata;\n /** Calculate function */\n calculate: (bars: any[]) => PlotData[] | TimeValue[];\n};\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/box/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* @version 6
|
|
13
13
|
*/
|
|
14
14
|
import type { ChartPoint, Box, color } from '../types/index.js';
|
|
15
|
-
type BoxXloc = 'bar_index' | 'bar_time';
|
|
15
|
+
type BoxXloc = 'bar_index' | 'bar_time' | 'pane';
|
|
16
16
|
type BoxExtend = 'none' | 'left' | 'right' | 'both';
|
|
17
17
|
/**
|
|
18
18
|
* Creates a new box (PineScript `box.new`), with two chart points or with coordinates, in PineScript's
|
|
@@ -223,7 +223,7 @@ export declare function set_rightbottom(id: Box, right: number, bottom: number):
|
|
|
223
223
|
* @param id - Box object to modify
|
|
224
224
|
* @param left - New left border coordinate
|
|
225
225
|
* @param right - New right border coordinate
|
|
226
|
-
* @param xloc - New coordinate system ('bar_index' or '
|
|
226
|
+
* @param xloc - New coordinate system ('bar_index', 'bar_time' or 'pane')
|
|
227
227
|
* @returns Modified box object
|
|
228
228
|
*
|
|
229
229
|
* @remarks
|
|
@@ -236,7 +236,7 @@ export declare function set_rightbottom(id: Box, right: number, bottom: number):
|
|
|
236
236
|
* box.set_xloc(box, 1609459200000, 1609545600000, 'bar_time');
|
|
237
237
|
* ```
|
|
238
238
|
*/
|
|
239
|
-
export declare function set_xloc(id: Box, left: number, right: number, xloc: 'bar_index' | 'bar_time'): Box;
|
|
239
|
+
export declare function set_xloc(id: Box, left: number, right: number, xloc: 'bar_index' | 'bar_time' | 'pane'): Box;
|
|
240
240
|
/**
|
|
241
241
|
* Sets the horizontal extension mode.
|
|
242
242
|
*
|