oakscriptjs 0.10.0 → 0.11.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.map +1 -1
- package/dist/cjs/box/index.js +7 -1
- package/dist/cjs/box/index.js.map +2 -2
- package/dist/cjs/callsite/index.d.ts +73 -32
- package/dist/cjs/callsite/index.d.ts.map +1 -1
- package/dist/cjs/callsite/index.js +69 -65
- package/dist/cjs/callsite/index.js.map +2 -2
- package/dist/cjs/drawing/registry.d.ts +75 -0
- package/dist/cjs/drawing/registry.d.ts.map +1 -1
- package/dist/cjs/drawing/registry.js +139 -6
- package/dist/cjs/drawing/registry.js.map +2 -2
- package/dist/cjs/index.d.ts +8 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +30 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/label/index.d.ts.map +1 -1
- package/dist/cjs/label/index.js +3 -0
- package/dist/cjs/label/index.js.map +2 -2
- package/dist/cjs/line/index.d.ts.map +1 -1
- package/dist/cjs/line/index.js +7 -1
- package/dist/cjs/line/index.js.map +2 -2
- package/dist/cjs/math/index.d.ts.map +1 -1
- package/dist/cjs/math/index.js +2 -0
- package/dist/cjs/math/index.js.map +2 -2
- package/dist/cjs/polyline/index.d.ts.map +1 -1
- package/dist/cjs/polyline/index.js +3 -0
- package/dist/cjs/polyline/index.js.map +2 -2
- package/dist/cjs/runtime/index.d.ts +2 -1
- package/dist/cjs/runtime/index.d.ts.map +1 -1
- package/dist/cjs/runtime/index.js +2 -0
- package/dist/cjs/runtime/index.js.map +2 -2
- package/dist/cjs/runtime/input-active.d.ts +27 -0
- package/dist/cjs/runtime/input-active.d.ts.map +1 -0
- package/dist/cjs/runtime/input-active.js +44 -0
- package/dist/cjs/runtime/input-active.js.map +7 -0
- package/dist/cjs/runtime/types.d.ts +29 -2
- package/dist/cjs/runtime/types.d.ts.map +1 -1
- package/dist/cjs/runtime/types.js.map +1 -1
- package/dist/cjs/script/index.d.ts +53 -17
- package/dist/cjs/script/index.d.ts.map +1 -1
- package/dist/cjs/script/index.js +70 -11
- package/dist/cjs/script/index.js.map +3 -3
- package/dist/cjs/session/bars.d.ts +15 -1
- package/dist/cjs/session/bars.d.ts.map +1 -1
- package/dist/cjs/session/bars.js +41 -6
- package/dist/cjs/session/bars.js.map +3 -3
- package/dist/cjs/session/calendar.d.ts +9 -1
- package/dist/cjs/session/calendar.d.ts.map +1 -1
- package/dist/cjs/session/calendar.js +28 -2
- package/dist/cjs/session/calendar.js.map +2 -2
- package/dist/cjs/session/context.d.ts +75 -0
- package/dist/cjs/session/context.d.ts.map +1 -0
- package/dist/cjs/session/context.js +113 -0
- package/dist/cjs/session/context.js.map +7 -0
- package/dist/cjs/str/index.d.ts +12 -4
- package/dist/cjs/str/index.d.ts.map +1 -1
- package/dist/cjs/str/index.js +13 -7
- package/dist/cjs/str/index.js.map +2 -2
- package/dist/cjs/str/numberformat.d.ts +10 -2
- package/dist/cjs/str/numberformat.d.ts.map +1 -1
- package/dist/cjs/str/numberformat.js +10 -2
- package/dist/cjs/str/numberformat.js.map +2 -2
- package/dist/cjs/ta/index.d.ts +33 -17
- package/dist/cjs/ta/index.d.ts.map +1 -1
- package/dist/cjs/ta/index.js +70 -29
- package/dist/cjs/ta/index.js.map +2 -2
- package/dist/cjs/ta/limits.d.ts +24 -0
- package/dist/cjs/ta/limits.d.ts.map +1 -0
- package/dist/cjs/ta/limits.js +50 -0
- package/dist/cjs/ta/limits.js.map +7 -0
- package/dist/cjs/ta/running-sum.d.ts +0 -16
- package/dist/cjs/ta/running-sum.d.ts.map +1 -1
- package/dist/cjs/ta/running-sum.js +2 -0
- package/dist/cjs/ta/running-sum.js.map +2 -2
- package/dist/cjs/ta-series.d.ts +7 -7
- package/dist/cjs/ta-series.d.ts.map +1 -1
- package/dist/cjs/ta-series.js +9 -7
- package/dist/cjs/ta-series.js.map +2 -2
- package/dist/cjs/time/index.d.ts +5 -2
- package/dist/cjs/time/index.d.ts.map +1 -1
- package/dist/cjs/time/index.js +2 -2
- package/dist/cjs/time/index.js.map +2 -2
- package/dist/cjs/time/session.d.ts +17 -1
- package/dist/cjs/time/session.d.ts.map +1 -1
- package/dist/cjs/time/session.js +61 -7
- package/dist/cjs/time/session.js.map +2 -2
- package/dist/cjs/types/metadata.d.ts +27 -3
- 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.map +1 -1
- package/dist/esm/box/index.js +8 -2
- package/dist/esm/box/index.js.map +1 -1
- package/dist/esm/callsite/index.d.ts +73 -32
- package/dist/esm/callsite/index.d.ts.map +1 -1
- package/dist/esm/callsite/index.js +143 -106
- package/dist/esm/callsite/index.js.map +1 -1
- package/dist/esm/drawing/registry.d.ts +75 -0
- package/dist/esm/drawing/registry.d.ts.map +1 -1
- package/dist/esm/drawing/registry.js +237 -6
- package/dist/esm/drawing/registry.js.map +1 -1
- package/dist/esm/index.d.ts +8 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +11 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/label/index.d.ts.map +1 -1
- package/dist/esm/label/index.js +4 -1
- package/dist/esm/label/index.js.map +1 -1
- package/dist/esm/line/index.d.ts.map +1 -1
- package/dist/esm/line/index.js +8 -2
- package/dist/esm/line/index.js.map +1 -1
- package/dist/esm/math/index.d.ts.map +1 -1
- package/dist/esm/math/index.js +3 -0
- package/dist/esm/math/index.js.map +1 -1
- package/dist/esm/polyline/index.d.ts.map +1 -1
- package/dist/esm/polyline/index.js +5 -1
- package/dist/esm/polyline/index.js.map +1 -1
- package/dist/esm/runtime/index.d.ts +2 -1
- package/dist/esm/runtime/index.d.ts.map +1 -1
- package/dist/esm/runtime/index.js +1 -0
- package/dist/esm/runtime/index.js.map +1 -1
- package/dist/esm/runtime/input-active.d.ts +27 -0
- package/dist/esm/runtime/input-active.d.ts.map +1 -0
- package/dist/esm/runtime/input-active.js +54 -0
- package/dist/esm/runtime/input-active.js.map +1 -0
- package/dist/esm/runtime/types.d.ts +29 -2
- package/dist/esm/runtime/types.d.ts.map +1 -1
- package/dist/esm/script/index.d.ts +53 -17
- package/dist/esm/script/index.d.ts.map +1 -1
- package/dist/esm/script/index.js +80 -13
- package/dist/esm/script/index.js.map +1 -1
- package/dist/esm/session/bars.d.ts +15 -1
- package/dist/esm/session/bars.d.ts.map +1 -1
- package/dist/esm/session/bars.js +50 -6
- package/dist/esm/session/bars.js.map +1 -1
- package/dist/esm/session/calendar.d.ts +9 -1
- package/dist/esm/session/calendar.d.ts.map +1 -1
- package/dist/esm/session/calendar.js +35 -3
- package/dist/esm/session/calendar.js.map +1 -1
- package/dist/esm/session/context.d.ts +75 -0
- package/dist/esm/session/context.d.ts.map +1 -0
- package/dist/esm/session/context.js +122 -0
- package/dist/esm/session/context.js.map +1 -0
- package/dist/esm/str/index.d.ts +12 -4
- package/dist/esm/str/index.d.ts.map +1 -1
- package/dist/esm/str/index.js +33 -12
- package/dist/esm/str/index.js.map +1 -1
- package/dist/esm/str/numberformat.d.ts +10 -2
- package/dist/esm/str/numberformat.d.ts.map +1 -1
- package/dist/esm/str/numberformat.js +16 -2
- package/dist/esm/str/numberformat.js.map +1 -1
- package/dist/esm/ta/index.d.ts +33 -17
- package/dist/esm/ta/index.d.ts.map +1 -1
- package/dist/esm/ta/index.js +130 -56
- package/dist/esm/ta/index.js.map +1 -1
- package/dist/esm/ta/limits.d.ts +24 -0
- package/dist/esm/ta/limits.d.ts.map +1 -0
- package/dist/esm/ta/limits.js +42 -0
- package/dist/esm/ta/limits.js.map +1 -0
- package/dist/esm/ta/running-sum.d.ts +0 -16
- package/dist/esm/ta/running-sum.d.ts.map +1 -1
- package/dist/esm/ta/running-sum.js +2 -0
- package/dist/esm/ta/running-sum.js.map +1 -1
- package/dist/esm/ta-series.d.ts +7 -7
- package/dist/esm/ta-series.d.ts.map +1 -1
- package/dist/esm/ta-series.js +9 -7
- package/dist/esm/ta-series.js.map +1 -1
- package/dist/esm/time/index.d.ts +5 -2
- package/dist/esm/time/index.d.ts.map +1 -1
- package/dist/esm/time/index.js +6 -3
- package/dist/esm/time/index.js.map +1 -1
- package/dist/esm/time/session.d.ts +17 -1
- package/dist/esm/time/session.d.ts.map +1 -1
- package/dist/esm/time/session.js +97 -10
- package/dist/esm/time/session.js.map +1 -1
- package/dist/esm/types/metadata.d.ts +27 -3
- package/dist/esm/types/metadata.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/box/index.ts +8 -2
- package/src/callsite/index.ts +150 -100
- package/src/drawing/registry.ts +255 -5
- package/src/index.ts +36 -1
- package/src/label/index.ts +4 -1
- package/src/line/index.ts +8 -2
- package/src/math/index.ts +2 -0
- package/src/polyline/index.ts +3 -1
- package/src/runtime/index.ts +3 -0
- package/src/runtime/input-active.ts +50 -0
- package/src/runtime/types.ts +25 -2
- package/src/script/index.ts +123 -23
- package/src/session/bars.ts +47 -6
- package/src/session/calendar.ts +37 -3
- package/src/session/context.ts +160 -0
- package/src/str/index.ts +30 -12
- package/src/str/numberformat.ts +18 -3
- package/src/ta/index.ts +148 -66
- package/src/ta/limits.ts +47 -0
- package/src/ta/running-sum.ts +2 -0
- package/src/ta-series.ts +16 -14
- package/src/time/index.ts +6 -3
- package/src/time/session.ts +89 -9
- package/src/types/metadata.ts +27 -3
package/dist/cjs/time/index.d.ts
CHANGED
|
@@ -83,7 +83,10 @@ export declare function second(time: int, timezone: string): int;
|
|
|
83
83
|
* ":" (1 = Sunday ... 7 = Saturday), e.g. "0930-1600:23456" or "1000-1100,1400-1500".
|
|
84
84
|
* Without days, one period covers every day and several periods cover Monday to Friday.
|
|
85
85
|
* A period includes its start and excludes its end. An overnight period ("1800-0930")
|
|
86
|
-
* belongs to the day it ends. "0000-0000" and "24x7" cover the whole day.
|
|
86
|
+
* belongs to the day it ends. "0000-0000" and "24x7" cover the whole day. A period that ends at 0000 ends at 24:00 of
|
|
87
|
+
* the day it starts. On the days around a clock change the periods are placed as PineScript places them (see
|
|
88
|
+
* time/session.ts); `barMs`, the duration of the bars in ms, is needed for one of these rules (the day before the
|
|
89
|
+
* clocks go back).
|
|
87
90
|
*/
|
|
88
|
-
export declare function inSession(time: int, session: string, timezone: string): boolean;
|
|
91
|
+
export declare function inSession(time: int, session: string, timezone: string, barMs?: number): boolean;
|
|
89
92
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/time/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAKzD;;GAEG;AACH,wBAAgB,GAAG,IAAI,GAAG,CAEzB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAC;AACnD,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,UAAU,EACf,IAAI,CAAC,EAAE,UAAU,EACjB,MAAM,CAAC,EAAE,UAAU,EACnB,MAAM,CAAC,EAAE,UAAU,GAClB,GAAG,CAAC;AACP,wBAAgB,SAAS,CACvB,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,UAAU,EACf,IAAI,CAAC,EAAE,UAAU,EACjB,MAAM,CAAC,EAAE,UAAU,EACnB,MAAM,CAAC,EAAE,UAAU,GAClB,GAAG,CAAC;AAmBP;;GAEG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,CAErD;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,CAEtD;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E,UAAU,EACf,IAAI,CAAC,EAAE,UAAU,EACjB,MAAM,CAAC,EAAE,UAAU,EACnB,MAAM,CAAC,EAAE,UAAU,GAClB,GAAG,CAAC;AAmBP;;GAEG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,CAErD;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,CAEtD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,CAE3D;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,CAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,CAQ3D;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,CAErD;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,CAEvD;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,CAEvD;AAID;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAE/F"}
|
package/dist/cjs/time/index.js
CHANGED
|
@@ -80,7 +80,7 @@ function minute(time, timezone) {
|
|
|
80
80
|
function second(time, timezone) {
|
|
81
81
|
return field(time, timezone, (f) => f.second);
|
|
82
82
|
}
|
|
83
|
-
function inSession(time, session, timezone) {
|
|
84
|
-
return (0, import_session.inSession)(time, session, timezone);
|
|
83
|
+
function inSession(time, session, timezone, barMs) {
|
|
84
|
+
return (0, import_session.inSession)(time, session, timezone, barMs);
|
|
85
85
|
}
|
|
86
86
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/time/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Time namespace\n * Mirrors PineScript's time and calendar functions.\n *\n * Every function takes an explicit time zone: UTC/GMT offset notation (\"UTC-5\",\n * \"GMT+0530\", \"UTC+05:30\") or an IANA name (\"America/New_York\"). The PineScript\n * default time zone (the exchange time zone, `syminfo.timezone`) is not known here.\n */\n\nimport type { int, simple_int } from '../types/index.js';\nimport { zonedFields, zonedToUnix } from './timezone.js';\nimport { parseDateString } from './datestring.js';\nimport { inSession as sessionContains } from './session.js';\n\n/**\n * Returns the current time in milliseconds\n */\nexport function now(): int {\n return Date.now();\n}\n\n/**\n * Returns the UNIX time (ms) of a date and time.\n *\n * - `timestamp(dateString)`: RFC 2822 or ISO 8601 date string (\"20 Feb 2020\",\n * \"2020-02-20T14:48:00\", \"2024-01-01 09:30 +0000\", \"04 Dec 1995 00:12:00 GMT+5\").\n * Without a time the time is 00:00; without a time zone the time zone is GMT+0.\n * - `timestamp(timezone, year, month, day, hour?, minute?, second?)`: calendar fields in `timezone`.\n * A wall-clock time that occurs twice resolves to the later instant; a missing one is\n * shifted forward by the gap (as in PineScript).\n * - `timestamp(year, month, day, hour?, minute?, second?)`: calendar fields in the time zone\n * of the host. PineScript reads them in the exchange time zone, which is not known here:\n * use the `timezone` form for PineScript values.\n *\n * Out-of-range fields roll over (month 13 is January of the next year).\n *\n * @example\n * ```typescript\n * time.timestamp('2024-01-02'); // 1704153600000\n * time.timestamp('America/New_York', 2024, 1, 2, 9, 30); // 1704205800000\n * ```\n */\nexport function timestamp(dateString: string): int;\nexport function timestamp(\n timezone: string,\n year: simple_int,\n month: simple_int,\n day: simple_int,\n hour?: simple_int,\n minute?: simple_int,\n second?: simple_int\n): int;\nexport function timestamp(\n year: simple_int,\n month: simple_int,\n day: simple_int,\n hour?: simple_int,\n minute?: simple_int,\n second?: simple_int\n): int;\nexport function timestamp(first: string | simple_int, ...rest: Array<simple_int | undefined>): int {\n if (typeof first === 'string') {\n if (rest.length === 0) return parseDateString(first);\n // PineScript: an na field counts as 0 (day na of January 2020 is 2019-12-31)\n const f = (v: number | undefined) => (v === undefined || v === null || Number.isNaN(v) ? 0 : v);\n const [year, month, day, hour, minute, second] = rest as [number, number, number, number?, number?, number?];\n return zonedToUnix(first, f(year), f(month), f(day), f(hour), f(minute), f(second));\n }\n const [month, day, hour, minute, second] = rest as [number, number, number?, number?, number?];\n return new Date(first, month - 1, day, hour || 0, minute || 0, second || 0).getTime();\n}\n\n// \u2500\u2500 Calendar fields \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction field(time: number, timezone: string, pick: (f: ReturnType<typeof zonedFields>) => number): int {\n return Number.isNaN(time) ? NaN : pick(zonedFields(time, timezone));\n}\n\n/**\n * Year of a UNIX time (ms) in `timezone`.\n */\nexport function year(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.year);\n}\n\n/**\n * Month (1-12) of a UNIX time (ms) in `timezone`.\n */\nexport function month(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.month);\n}\n\n/**\n * Day of the month (1-31) of a UNIX time (ms) in `timezone`.\n */\nexport function dayofmonth(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.day);\n}\n\n/**\n * Day of the week of a UNIX time (ms) in `timezone`: 1 = Sunday, 2 = Monday ... 7 = Saturday\n * (PineScript `dayofweek.sunday` ... `dayofweek.saturday`).\n */\nexport function dayofweek(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.dayOfWeek);\n}\n\n/**\n * Week number of the year of a UNIX time (ms) in `timezone`.\n *\n * Weeks start on Monday and follow ISO 8601: week 1 is the week that contains the\n * first Thursday of the year, so the first days of January can be in week 52 or 53\n * of the previous year. The PineScript reference does not define the rule.\n */\nexport function weekofyear(time: int, timezone: string): int {\n return field(time, timezone, (f) => {\n const date = Date.UTC(f.year, f.month - 1, f.day);\n const mondayBased = (f.dayOfWeek + 5) % 7; // Monday = 0 ... Sunday = 6\n const thursday = new Date(date + (3 - mondayBased) * 86_400_000);\n const yearStart = Date.UTC(thursday.getUTCFullYear(), 0, 1);\n return 1 + Math.floor((thursday.getTime() - yearStart) / (7 * 86_400_000));\n });\n}\n\n/**\n * Hour (0-23) of a UNIX time (ms) in `timezone`.\n */\nexport function hour(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.hour);\n}\n\n/**\n * Minute (0-59) of a UNIX time (ms) in `timezone`.\n */\nexport function minute(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.minute);\n}\n\n/**\n * Second (0-59) of a UNIX time (ms) in `timezone`.\n */\nexport function second(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.second);\n}\n\n// \u2500\u2500 Sessions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * True when a bar opening at `time` is inside `session`, with the session hours read in `timezone`.\n *\n * This is the session test of PineScript `time(timeframe, session, timezone)`, which returns\n * `na` for bars outside the session: `na(time(\"1\", \"0930-1600\", \"America/New_York\"))` is\n * `!time.inSession(barTime, \"0930-1600\", \"America/New_York\")`.\n *\n * Session format: \"HHmm-HHmm\", several periods separated by commas, optional days after\n * \":\" (1 = Sunday ... 7 = Saturday), e.g. \"0930-1600:23456\" or \"1000-1100,1400-1500\".\n * Without days, one period covers every day and several periods cover Monday to Friday.\n * A period includes its start and excludes its end. An overnight period (\"1800-0930\")\n * belongs to the day it ends. \"0000-0000\" and \"24x7\" cover the whole day.\n */\nexport function inSession(time: int, session: string, timezone: string): boolean {\n return sessionContains(time, session, timezone);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,sBAAyC;AACzC,wBAAgC;AAChC,qBAA6C;AAKtC,SAAS,MAAW;AACzB,SAAO,KAAK,IAAI;AAClB;AAyCO,SAAS,UAAU,UAA+B,MAA0C;AACjG,MAAI,OAAO,UAAU,UAAU;AAC7B,QAAI,KAAK,WAAW,EAAG,YAAO,mCAAgB,KAAK;AAEnD,UAAM,IAAI,CAAC,MAA2B,MAAM,UAAa,MAAM,QAAQ,OAAO,MAAM,CAAC,IAAI,IAAI;AAC7F,UAAM,CAACA,OAAMC,QAAOC,MAAKC,OAAMC,SAAQC,OAAM,IAAI;AACjD,eAAO,6BAAY,OAAO,EAAEL,KAAI,GAAG,EAAEC,MAAK,GAAG,EAAEC,IAAG,GAAG,EAAEC,KAAI,GAAG,EAAEC,OAAM,GAAG,EAAEC,OAAM,CAAC;AAAA,EACpF;AACA,QAAM,CAACJ,QAAO,KAAKE,OAAMC,SAAQC,OAAM,IAAI;AAC3C,SAAO,IAAI,KAAK,OAAOJ,SAAQ,G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
|
|
4
|
+
"sourcesContent": ["/**\n * Time namespace\n * Mirrors PineScript's time and calendar functions.\n *\n * Every function takes an explicit time zone: UTC/GMT offset notation (\"UTC-5\",\n * \"GMT+0530\", \"UTC+05:30\") or an IANA name (\"America/New_York\"). The PineScript\n * default time zone (the exchange time zone, `syminfo.timezone`) is not known here.\n */\n\nimport type { int, simple_int } from '../types/index.js';\nimport { zonedFields, zonedToUnix } from './timezone.js';\nimport { parseDateString } from './datestring.js';\nimport { inSession as sessionContains } from './session.js';\n\n/**\n * Returns the current time in milliseconds\n */\nexport function now(): int {\n return Date.now();\n}\n\n/**\n * Returns the UNIX time (ms) of a date and time.\n *\n * - `timestamp(dateString)`: RFC 2822 or ISO 8601 date string (\"20 Feb 2020\",\n * \"2020-02-20T14:48:00\", \"2024-01-01 09:30 +0000\", \"04 Dec 1995 00:12:00 GMT+5\").\n * Without a time the time is 00:00; without a time zone the time zone is GMT+0.\n * - `timestamp(timezone, year, month, day, hour?, minute?, second?)`: calendar fields in `timezone`.\n * A wall-clock time that occurs twice resolves to the later instant; a missing one is\n * shifted forward by the gap (as in PineScript).\n * - `timestamp(year, month, day, hour?, minute?, second?)`: calendar fields in the time zone\n * of the host. PineScript reads them in the exchange time zone, which is not known here:\n * use the `timezone` form for PineScript values.\n *\n * Out-of-range fields roll over (month 13 is January of the next year).\n *\n * @example\n * ```typescript\n * time.timestamp('2024-01-02'); // 1704153600000\n * time.timestamp('America/New_York', 2024, 1, 2, 9, 30); // 1704205800000\n * ```\n */\nexport function timestamp(dateString: string): int;\nexport function timestamp(\n timezone: string,\n year: simple_int,\n month: simple_int,\n day: simple_int,\n hour?: simple_int,\n minute?: simple_int,\n second?: simple_int\n): int;\nexport function timestamp(\n year: simple_int,\n month: simple_int,\n day: simple_int,\n hour?: simple_int,\n minute?: simple_int,\n second?: simple_int\n): int;\nexport function timestamp(first: string | simple_int, ...rest: Array<simple_int | undefined>): int {\n if (typeof first === 'string') {\n if (rest.length === 0) return parseDateString(first);\n // PineScript: an na field counts as 0 (day na of January 2020 is 2019-12-31)\n const f = (v: number | undefined) => (v === undefined || v === null || Number.isNaN(v) ? 0 : v);\n const [year, month, day, hour, minute, second] = rest as [number, number, number, number?, number?, number?];\n return zonedToUnix(first, f(year), f(month), f(day), f(hour), f(minute), f(second));\n }\n const [month, day, hour, minute, second] = rest as [number, number, number?, number?, number?];\n return new Date(first, month - 1, day, hour || 0, minute || 0, second || 0).getTime();\n}\n\n// \u2500\u2500 Calendar fields \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction field(time: number, timezone: string, pick: (f: ReturnType<typeof zonedFields>) => number): int {\n return Number.isNaN(time) ? NaN : pick(zonedFields(time, timezone));\n}\n\n/**\n * Year of a UNIX time (ms) in `timezone`.\n */\nexport function year(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.year);\n}\n\n/**\n * Month (1-12) of a UNIX time (ms) in `timezone`.\n */\nexport function month(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.month);\n}\n\n/**\n * Day of the month (1-31) of a UNIX time (ms) in `timezone`.\n */\nexport function dayofmonth(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.day);\n}\n\n/**\n * Day of the week of a UNIX time (ms) in `timezone`: 1 = Sunday, 2 = Monday ... 7 = Saturday\n * (PineScript `dayofweek.sunday` ... `dayofweek.saturday`).\n */\nexport function dayofweek(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.dayOfWeek);\n}\n\n/**\n * Week number of the year of a UNIX time (ms) in `timezone`.\n *\n * Weeks start on Monday and follow ISO 8601: week 1 is the week that contains the\n * first Thursday of the year, so the first days of January can be in week 52 or 53\n * of the previous year. The PineScript reference does not define the rule.\n */\nexport function weekofyear(time: int, timezone: string): int {\n return field(time, timezone, (f) => {\n const date = Date.UTC(f.year, f.month - 1, f.day);\n const mondayBased = (f.dayOfWeek + 5) % 7; // Monday = 0 ... Sunday = 6\n const thursday = new Date(date + (3 - mondayBased) * 86_400_000);\n const yearStart = Date.UTC(thursday.getUTCFullYear(), 0, 1);\n return 1 + Math.floor((thursday.getTime() - yearStart) / (7 * 86_400_000));\n });\n}\n\n/**\n * Hour (0-23) of a UNIX time (ms) in `timezone`.\n */\nexport function hour(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.hour);\n}\n\n/**\n * Minute (0-59) of a UNIX time (ms) in `timezone`.\n */\nexport function minute(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.minute);\n}\n\n/**\n * Second (0-59) of a UNIX time (ms) in `timezone`.\n */\nexport function second(time: int, timezone: string): int {\n return field(time, timezone, (f) => f.second);\n}\n\n// \u2500\u2500 Sessions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * True when a bar opening at `time` is inside `session`, with the session hours read in `timezone`.\n *\n * This is the session test of PineScript `time(timeframe, session, timezone)`, which returns\n * `na` for bars outside the session: `na(time(\"1\", \"0930-1600\", \"America/New_York\"))` is\n * `!time.inSession(barTime, \"0930-1600\", \"America/New_York\")`.\n *\n * Session format: \"HHmm-HHmm\", several periods separated by commas, optional days after\n * \":\" (1 = Sunday ... 7 = Saturday), e.g. \"0930-1600:23456\" or \"1000-1100,1400-1500\".\n * Without days, one period covers every day and several periods cover Monday to Friday.\n * A period includes its start and excludes its end. An overnight period (\"1800-0930\")\n * belongs to the day it ends. \"0000-0000\" and \"24x7\" cover the whole day. A period that ends at 0000 ends at 24:00 of\n * the day it starts. On the days around a clock change the periods are placed as PineScript places them (see\n * time/session.ts); `barMs`, the duration of the bars in ms, is needed for one of these rules (the day before the\n * clocks go back).\n */\nexport function inSession(time: int, session: string, timezone: string, barMs?: number): boolean {\n return sessionContains(time, session, timezone, barMs);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,sBAAyC;AACzC,wBAAgC;AAChC,qBAA6C;AAKtC,SAAS,MAAW;AACzB,SAAO,KAAK,IAAI;AAClB;AAyCO,SAAS,UAAU,UAA+B,MAA0C;AACjG,MAAI,OAAO,UAAU,UAAU;AAC7B,QAAI,KAAK,WAAW,EAAG,YAAO,mCAAgB,KAAK;AAEnD,UAAM,IAAI,CAAC,MAA2B,MAAM,UAAa,MAAM,QAAQ,OAAO,MAAM,CAAC,IAAI,IAAI;AAC7F,UAAM,CAACA,OAAMC,QAAOC,MAAKC,OAAMC,SAAQC,OAAM,IAAI;AACjD,eAAO,6BAAY,OAAO,EAAEL,KAAI,GAAG,EAAEC,MAAK,GAAG,EAAEC,IAAG,GAAG,EAAEC,KAAI,GAAG,EAAEC,OAAM,GAAG,EAAEC,OAAM,CAAC;AAAA,EACpF;AACA,QAAM,CAACJ,QAAO,KAAKE,OAAMC,SAAQC,OAAM,IAAI;AAC3C,SAAO,IAAI,KAAK,OAAOJ,SAAQ,GAAG,KAAKE,SAAQ,GAAGC,WAAU,GAAGC,WAAU,CAAC,EAAE,QAAQ;AACtF;AAIA,SAAS,MAAM,MAAc,UAAkB,MAA0D;AACvG,SAAO,OAAO,MAAM,IAAI,IAAI,MAAM,SAAK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]
|
|
7
7
|
}
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* - a trailing ",", ":" or "|" ends its list ("1100-1400," is "1100-1400" Monday to Friday)
|
|
13
13
|
* - an end before the start is an overnight run that belongs to the day it ends; equal ends are 24 hours;
|
|
14
14
|
* "0000-0000" and "24x7" are the whole day, every day
|
|
15
|
+
* - a run that ends at 0000 ("2000-0000") ends at 24:00 of the day it starts and belongs to that day
|
|
16
|
+
* ("2000-0000:6" is Friday 20:00 to midnight)
|
|
15
17
|
* - a string that is empty or does not start with a digit ("regular", "extended") is the symbol's own session
|
|
16
18
|
* - a malformed string ("1100 -1400", "0930-16", ":8") is an error, as the PineScript runtime error
|
|
17
19
|
*/
|
|
@@ -29,8 +31,22 @@ export declare function parsePineSession(session: string): SessionRange[] | null
|
|
|
29
31
|
/**
|
|
30
32
|
* True when `time` falls inside `session`, with the session hours read in `timezone`.
|
|
31
33
|
* A run includes its start minute and excludes its end minute.
|
|
34
|
+
*
|
|
35
|
+
* On the days around a clock change PineScript does not read the wall clock of each bar; it places each run of
|
|
36
|
+
* each local day (measured on 15- and 5-minute bars, clocks going forward and back, four time zones):
|
|
37
|
+
* - a wall time of the day is placed with the offset before the change when it is before the wall time of the
|
|
38
|
+
* change (02:00 for 02:00 -> 03:00, 03:00 for 03:00 -> 02:00), with the offset after it otherwise. Forward
|
|
39
|
+
* change: "0100-0300" lasts one hour and "0130-0230" is empty; back change: "0230-0330" lasts two hours
|
|
40
|
+
* - a run that ends exactly on the wall time of the change is placed with the offset after the change at both ends
|
|
41
|
+
* (forward change: "0100-0200" is one hour earlier than the wall clock says)
|
|
42
|
+
* - clocks going back: a run that ends inside the repeated hour also covers its second pass
|
|
43
|
+
* - clocks going back, the day BEFORE the change: a run with a start or an end on the wall time of the change is
|
|
44
|
+
* also true one hour (the amount of the change) later, from one bar after its usual end. This needs the bar
|
|
45
|
+
* duration `barMs`; without it the rule is not applied
|
|
46
|
+
*
|
|
47
|
+
* @param barMs - Duration of the bars in ms (the chart timeframe); only used by the last rule
|
|
32
48
|
* @throws Error for the symbol's own session ("regular", "extended", ""), which this function does not know: use
|
|
33
49
|
* `time(timeframe, session)` in a script with the chart session
|
|
34
50
|
*/
|
|
35
|
-
export declare function inSession(time: number, session: string, timezone: string): boolean;
|
|
51
|
+
export declare function inSession(time: number, session: string, timezone: string, barMs?: number): boolean;
|
|
36
52
|
//# sourceMappingURL=session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/time/session.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/time/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,iHAAiH;AACjH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACnB;AA+BD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,EAAE,GAAG,IAAI,CAuCvE;AAuBD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CA4DlG"}
|
package/dist/cjs/time/session.js
CHANGED
|
@@ -91,19 +91,73 @@ function parsePineSession(session) {
|
|
|
91
91
|
parsed.set(session, out);
|
|
92
92
|
return out;
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
const MS_PER_MINUTE = 6e4;
|
|
95
|
+
const MS_PER_HOUR = 36e5;
|
|
96
|
+
const MS_PER_DAY = 864e5;
|
|
97
|
+
const CHANGE_WINDOW = 36 * MS_PER_HOUR;
|
|
98
|
+
function clockChangeNear(time, timezone) {
|
|
99
|
+
let lo = time - CHANGE_WINDOW;
|
|
100
|
+
let hi = time + CHANGE_WINDOW;
|
|
101
|
+
const before = (0, import_timezone.zoneOffset)(lo, timezone);
|
|
102
|
+
const after = (0, import_timezone.zoneOffset)(hi, timezone);
|
|
103
|
+
if (before === after) return null;
|
|
104
|
+
while (hi - lo > MS_PER_MINUTE) {
|
|
105
|
+
const mid = Math.floor((lo + hi) / 2 / MS_PER_MINUTE) * MS_PER_MINUTE;
|
|
106
|
+
if ((0, import_timezone.zoneOffset)(mid, timezone) === before) lo = mid;
|
|
107
|
+
else hi = mid;
|
|
108
|
+
}
|
|
109
|
+
return { at: hi, before, after };
|
|
110
|
+
}
|
|
111
|
+
function inSession(time, session, timezone, barMs) {
|
|
95
112
|
if (Number.isNaN(time)) return false;
|
|
96
113
|
const ranges = parsePineSession(session);
|
|
97
114
|
if (ranges === null) throw new Error(`Session "${session}" is the symbol session: it needs the chart session (time(timeframe, session) in a script)`);
|
|
115
|
+
const change = clockChangeNear(time, timezone);
|
|
98
116
|
const f = (0, import_timezone.zonedFields)(time, timezone);
|
|
99
117
|
const minute = f.hour * 60 + f.minute;
|
|
100
118
|
const nextDay = f.dayOfWeek % 7 + 1;
|
|
101
|
-
for (const { start, end, days } of ranges) {
|
|
102
|
-
if (start
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
119
|
+
for (const { start, end: rawEnd, days } of ranges) {
|
|
120
|
+
if (start === rawEnd) {
|
|
121
|
+
if (days.has(start === 0 || minute < start ? f.dayOfWeek : nextDay)) return true;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
const end = rawEnd === 0 ? MINUTES_PER_DAY : rawEnd;
|
|
125
|
+
const overnight = start > end;
|
|
126
|
+
if (!change) {
|
|
127
|
+
if (!overnight) {
|
|
128
|
+
if (minute >= start && minute < end && days.has(f.dayOfWeek)) return true;
|
|
129
|
+
} else {
|
|
130
|
+
if (minute >= start && days.has(nextDay)) return true;
|
|
131
|
+
if (minute < end && days.has(f.dayOfWeek)) return true;
|
|
132
|
+
}
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
const changeWall = change.at + change.before;
|
|
136
|
+
const place = (naive) => naive < changeWall ? naive - change.before : naive - change.after;
|
|
137
|
+
const today = Math.floor((time + change.before) / MS_PER_DAY);
|
|
138
|
+
for (let day = today - 1; day <= today + 1; day++) {
|
|
139
|
+
if (!days.has((day + 4) % 7 + 1)) continue;
|
|
140
|
+
const from = day * MS_PER_DAY + (overnight ? start - MINUTES_PER_DAY : start) * MS_PER_MINUTE;
|
|
141
|
+
const to = day * MS_PER_DAY + end * MS_PER_MINUTE;
|
|
142
|
+
if (to === changeWall) {
|
|
143
|
+
if (time >= from - change.after && time < to - change.after) return true;
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (time >= place(from) && time < place(to)) return true;
|
|
147
|
+
const repeated = change.at + change.after;
|
|
148
|
+
if (change.after < change.before && to < changeWall && to > repeated) {
|
|
149
|
+
if (time >= Math.max(from, repeated) - change.after && time < to - change.after) return true;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (barMs !== void 0 && change.after < change.before) {
|
|
153
|
+
const day = Math.floor(changeWall / MS_PER_DAY) - 1;
|
|
154
|
+
const wallMinute = (changeWall - (day + 1) * MS_PER_DAY) / MS_PER_MINUTE;
|
|
155
|
+
if ((start === wallMinute || end === wallMinute) && days.has((day + 4) % 7 + 1)) {
|
|
156
|
+
const from = day * MS_PER_DAY + (overnight ? start - MINUTES_PER_DAY : start) * MS_PER_MINUTE - change.before;
|
|
157
|
+
const to = day * MS_PER_DAY + end * MS_PER_MINUTE - change.before;
|
|
158
|
+
const shift = change.before - change.after;
|
|
159
|
+
if (time >= from + shift && time < to + shift && time >= to + barMs) return true;
|
|
160
|
+
}
|
|
107
161
|
}
|
|
108
162
|
}
|
|
109
163
|
return false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/time/session.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * PineScript session strings (\"0930-1600\", \"0930-1600:23456\", \"1000-1100,1400-1500:23456\", \"0930-1600|1000-1300:7\",\n * \"24x7\").\n *\n * Grammar (measured on PineScript): `range[,range...][:days]`, several sections joined by \"|\".\n * - a range is exactly \"HHMM-HHMM\"; hours and minutes are minute counts taken modulo one day (\"0930-2500\" runs\n * 09:30 to 01:00, \"0960-1600\" 10:00 to 16:00); a start of 24:00 or later must open a run of at most a day\n * - days are digits 1 (Sunday) to 7 (Saturday), the day each run ends on\n * - a lone range without days runs every day; otherwise a section without days is the default section, which runs\n * on the weekdays (2-6) no other section names, and a later section naming a day replaces the earlier ones on that\n * day (\"1100-1400|1200-1300:7\": 11:00-14:00 Monday to Friday, 12:00-13:00 Saturday)\n * - a trailing \",\", \":\" or \"|\" ends its list (\"1100-1400,\" is \"1100-1400\" Monday to Friday)\n * - an end before the start is an overnight run that belongs to the day it ends; equal ends are 24 hours;\n * \"0000-0000\" and \"24x7\" are the whole day, every day\n * - a string that is empty or does not start with a digit (\"regular\", \"extended\") is the symbol's own session\n * - a malformed string (\"1100 -1400\", \"0930-16\", \":8\") is an error, as the PineScript runtime error\n */\n\nimport { zonedFields } from './timezone.js';\n\nconst MINUTES_PER_DAY = 1440;\nconst WEEKDAYS = [2, 3, 4, 5, 6];\nconst ALL_DAYS = [1, 2, 3, 4, 5, 6, 7];\n\n/** A run of a session: minutes after midnight (0-1439) and the days it ends on (1 = Sunday ... 7 = Saturday). */\nexport interface SessionRange {\n start: number;\n end: number;\n days: Set<number>;\n}\n\nfunction invalid(session: string): SyntaxError {\n return new SyntaxError(`Invalid session \"${session}\": expected \"HHMM-HHMM[,HHMM-HHMM...][:days][|...]\"`);\n}\n\nfunction parseRanges(text: string, session: string): Array<[number, number]> {\n if (!text) return [];\n const entries = text.split(',');\n if (entries.length > 1 && entries[entries.length - 1] === '') entries.pop();\n return entries.map((entry) => {\n if (!/^\\d{4}-\\d{4}$/.test(entry)) throw invalid(session);\n let start = Number(entry.slice(0, 2)) * 60 + Number(entry.slice(2, 4));\n let end = Number(entry.slice(5, 7)) * 60 + Number(entry.slice(7, 9));\n if (start >= MINUTES_PER_DAY) {\n const endOfRun = end || MINUTES_PER_DAY;\n if (!(start - MINUTES_PER_DAY < endOfRun && endOfRun <= start && start < 2 * MINUTES_PER_DAY)) throw invalid(session);\n }\n start %= MINUTES_PER_DAY;\n end %= MINUTES_PER_DAY;\n return [start, end];\n });\n}\n\nfunction parseDays(text: string, session: string): Set<number> {\n if (!/^[1-7]+$/.test(text)) throw invalid(session);\n return new Set([...text].map(Number));\n}\n\nconst parsed = new Map<string, SessionRange[] | null>();\n\n/**\n * Runs of a PineScript session string, or null for the symbol's own session (empty or not starting with a digit).\n * @throws SyntaxError when the string is malformed (a PineScript runtime error)\n */\nexport function parsePineSession(session: string): SessionRange[] | null {\n const cached = parsed.get(session);\n if (cached !== undefined) return cached;\n const spec = session.trim();\n let out: SessionRange[] | null;\n if (!spec || !/^\\d/.test(spec)) {\n out = null;\n } else if (spec === '24x7') {\n out = [{ start: 0, end: 0, days: new Set(ALL_DAYS) }];\n } else if (!/[:,|]/.test(spec)) {\n out = parseRanges(spec, session).map(([start, end]) => ({ start, end, days: new Set(ALL_DAYS) }));\n } else {\n const sections = spec.split('|');\n if (sections.length > 1 && sections[sections.length - 1] === '') sections.pop();\n const items = sections.map((section) => {\n const parts = section.split(':');\n if (parts.length > 2) throw invalid(session);\n const ranges = parseRanges(parts[0]!, session);\n const days = parts.length === 1 || parts[1] === '' ? null : parseDays(parts[1]!, session);\n return { ranges, days };\n });\n if (items.filter((it) => it.days === null).length > 1) throw invalid(session);\n // a later section naming a day replaces the earlier ones on that day; the default section takes the weekdays\n // no other section names\n const own: Set<number>[] = items.map(() => new Set<number>());\n const claimed = new Set<number>();\n for (let i = items.length - 1; i >= 0; i--) {\n const days = items[i]!.days;\n if (days === null) continue;\n for (const d of days) if (!claimed.has(d)) own[i]!.add(d);\n for (const d of days) claimed.add(d);\n }\n items.forEach((it, i) => {\n if (it.days === null) for (const d of WEEKDAYS) if (!claimed.has(d)) own[i]!.add(d);\n });\n out = items.flatMap((it, i) => (own[i]!.size ? it.ranges.map(([start, end]) => ({ start, end, days: own[i]! })) : []));\n }\n parsed.set(session, out);\n return out;\n}\n\n/**\n * True when `time` falls inside `session`, with the session hours read in `timezone`.\n * A run includes its start minute and excludes its end minute.\n * @throws Error for the symbol's own session (\"regular\", \"extended\", \"\"), which this function does not know: use\n * `time(timeframe, session)` in a script with the chart session\n */\nexport function inSession(time: number, session: string, timezone: string): boolean {\n if (Number.isNaN(time)) return false;\n const ranges = parsePineSession(session);\n if (ranges === null) throw new Error(`Session \"${session}\" is the symbol session: it needs the chart session (time(timeframe, session) in a script)`);\n const f = zonedFields(time, timezone);\n const minute = f.hour * 60 + f.minute;\n const nextDay = (f.dayOfWeek % 7) + 1;\n for (const { start, end, days } of ranges) {\n if (start < end || (start === 0 && end === 0)) {\n if (minute >= start && (minute < end || end === 0) && days.has(f.dayOfWeek)) return true;\n } else {\n // Overnight (24 hours when start === end): the part from `start` belongs to the next day.\n if (minute >= start && days.has(nextDay)) return true;\n if (minute < end && days.has(f.dayOfWeek)) return true;\n }\n }\n return false;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["/**\n * PineScript session strings (\"0930-1600\", \"0930-1600:23456\", \"1000-1100,1400-1500:23456\", \"0930-1600|1000-1300:7\",\n * \"24x7\").\n *\n * Grammar (measured on PineScript): `range[,range...][:days]`, several sections joined by \"|\".\n * - a range is exactly \"HHMM-HHMM\"; hours and minutes are minute counts taken modulo one day (\"0930-2500\" runs\n * 09:30 to 01:00, \"0960-1600\" 10:00 to 16:00); a start of 24:00 or later must open a run of at most a day\n * - days are digits 1 (Sunday) to 7 (Saturday), the day each run ends on\n * - a lone range without days runs every day; otherwise a section without days is the default section, which runs\n * on the weekdays (2-6) no other section names, and a later section naming a day replaces the earlier ones on that\n * day (\"1100-1400|1200-1300:7\": 11:00-14:00 Monday to Friday, 12:00-13:00 Saturday)\n * - a trailing \",\", \":\" or \"|\" ends its list (\"1100-1400,\" is \"1100-1400\" Monday to Friday)\n * - an end before the start is an overnight run that belongs to the day it ends; equal ends are 24 hours;\n * \"0000-0000\" and \"24x7\" are the whole day, every day\n * - a run that ends at 0000 (\"2000-0000\") ends at 24:00 of the day it starts and belongs to that day\n * (\"2000-0000:6\" is Friday 20:00 to midnight)\n * - a string that is empty or does not start with a digit (\"regular\", \"extended\") is the symbol's own session\n * - a malformed string (\"1100 -1400\", \"0930-16\", \":8\") is an error, as the PineScript runtime error\n */\n\nimport { zoneOffset, zonedFields } from './timezone.js';\n\nconst MINUTES_PER_DAY = 1440;\nconst WEEKDAYS = [2, 3, 4, 5, 6];\nconst ALL_DAYS = [1, 2, 3, 4, 5, 6, 7];\n\n/** A run of a session: minutes after midnight (0-1439) and the days it ends on (1 = Sunday ... 7 = Saturday). */\nexport interface SessionRange {\n start: number;\n end: number;\n days: Set<number>;\n}\n\nfunction invalid(session: string): SyntaxError {\n return new SyntaxError(`Invalid session \"${session}\": expected \"HHMM-HHMM[,HHMM-HHMM...][:days][|...]\"`);\n}\n\nfunction parseRanges(text: string, session: string): Array<[number, number]> {\n if (!text) return [];\n const entries = text.split(',');\n if (entries.length > 1 && entries[entries.length - 1] === '') entries.pop();\n return entries.map((entry) => {\n if (!/^\\d{4}-\\d{4}$/.test(entry)) throw invalid(session);\n let start = Number(entry.slice(0, 2)) * 60 + Number(entry.slice(2, 4));\n let end = Number(entry.slice(5, 7)) * 60 + Number(entry.slice(7, 9));\n if (start >= MINUTES_PER_DAY) {\n const endOfRun = end || MINUTES_PER_DAY;\n if (!(start - MINUTES_PER_DAY < endOfRun && endOfRun <= start && start < 2 * MINUTES_PER_DAY)) throw invalid(session);\n }\n start %= MINUTES_PER_DAY;\n end %= MINUTES_PER_DAY;\n return [start, end];\n });\n}\n\nfunction parseDays(text: string, session: string): Set<number> {\n if (!/^[1-7]+$/.test(text)) throw invalid(session);\n return new Set([...text].map(Number));\n}\n\nconst parsed = new Map<string, SessionRange[] | null>();\n\n/**\n * Runs of a PineScript session string, or null for the symbol's own session (empty or not starting with a digit).\n * @throws SyntaxError when the string is malformed (a PineScript runtime error)\n */\nexport function parsePineSession(session: string): SessionRange[] | null {\n const cached = parsed.get(session);\n if (cached !== undefined) return cached;\n const spec = session.trim();\n let out: SessionRange[] | null;\n if (!spec || !/^\\d/.test(spec)) {\n out = null;\n } else if (spec === '24x7') {\n out = [{ start: 0, end: 0, days: new Set(ALL_DAYS) }];\n } else if (!/[:,|]/.test(spec)) {\n out = parseRanges(spec, session).map(([start, end]) => ({ start, end, days: new Set(ALL_DAYS) }));\n } else {\n const sections = spec.split('|');\n if (sections.length > 1 && sections[sections.length - 1] === '') sections.pop();\n const items = sections.map((section) => {\n const parts = section.split(':');\n if (parts.length > 2) throw invalid(session);\n const ranges = parseRanges(parts[0]!, session);\n const days = parts.length === 1 || parts[1] === '' ? null : parseDays(parts[1]!, session);\n return { ranges, days };\n });\n if (items.filter((it) => it.days === null).length > 1) throw invalid(session);\n // a later section naming a day replaces the earlier ones on that day; the default section takes the weekdays\n // no other section names\n const own: Set<number>[] = items.map(() => new Set<number>());\n const claimed = new Set<number>();\n for (let i = items.length - 1; i >= 0; i--) {\n const days = items[i]!.days;\n if (days === null) continue;\n for (const d of days) if (!claimed.has(d)) own[i]!.add(d);\n for (const d of days) claimed.add(d);\n }\n items.forEach((it, i) => {\n if (it.days === null) for (const d of WEEKDAYS) if (!claimed.has(d)) own[i]!.add(d);\n });\n out = items.flatMap((it, i) => (own[i]!.size ? it.ranges.map(([start, end]) => ({ start, end, days: own[i]! })) : []));\n }\n parsed.set(session, out);\n return out;\n}\n\nconst MS_PER_MINUTE = 60_000;\nconst MS_PER_HOUR = 3_600_000;\nconst MS_PER_DAY = 86_400_000;\n/** A clock change is looked for this far on each side of the tested time. */\nconst CHANGE_WINDOW = 36 * MS_PER_HOUR;\n\n/** The clock change of `timezone` within 36 hours of `time`: its UNIX time and the offsets (ms) around it. */\nfunction clockChangeNear(time: number, timezone: string): { at: number; before: number; after: number } | null {\n let lo = time - CHANGE_WINDOW;\n let hi = time + CHANGE_WINDOW;\n const before = zoneOffset(lo, timezone);\n const after = zoneOffset(hi, timezone);\n if (before === after) return null;\n while (hi - lo > MS_PER_MINUTE) {\n const mid = Math.floor((lo + hi) / 2 / MS_PER_MINUTE) * MS_PER_MINUTE;\n if (zoneOffset(mid, timezone) === before) lo = mid;\n else hi = mid;\n }\n return { at: hi, before, after };\n}\n\n/**\n * True when `time` falls inside `session`, with the session hours read in `timezone`.\n * A run includes its start minute and excludes its end minute.\n *\n * On the days around a clock change PineScript does not read the wall clock of each bar; it places each run of\n * each local day (measured on 15- and 5-minute bars, clocks going forward and back, four time zones):\n * - a wall time of the day is placed with the offset before the change when it is before the wall time of the\n * change (02:00 for 02:00 -> 03:00, 03:00 for 03:00 -> 02:00), with the offset after it otherwise. Forward\n * change: \"0100-0300\" lasts one hour and \"0130-0230\" is empty; back change: \"0230-0330\" lasts two hours\n * - a run that ends exactly on the wall time of the change is placed with the offset after the change at both ends\n * (forward change: \"0100-0200\" is one hour earlier than the wall clock says)\n * - clocks going back: a run that ends inside the repeated hour also covers its second pass\n * - clocks going back, the day BEFORE the change: a run with a start or an end on the wall time of the change is\n * also true one hour (the amount of the change) later, from one bar after its usual end. This needs the bar\n * duration `barMs`; without it the rule is not applied\n *\n * @param barMs - Duration of the bars in ms (the chart timeframe); only used by the last rule\n * @throws Error for the symbol's own session (\"regular\", \"extended\", \"\"), which this function does not know: use\n * `time(timeframe, session)` in a script with the chart session\n */\nexport function inSession(time: number, session: string, timezone: string, barMs?: number): boolean {\n if (Number.isNaN(time)) return false;\n const ranges = parsePineSession(session);\n if (ranges === null) throw new Error(`Session \"${session}\" is the symbol session: it needs the chart session (time(timeframe, session) in a script)`);\n const change = clockChangeNear(time, timezone);\n const f = zonedFields(time, timezone);\n const minute = f.hour * 60 + f.minute;\n const nextDay = (f.dayOfWeek % 7) + 1;\n for (const { start, end: rawEnd, days } of ranges) {\n if (start === rawEnd) {\n // 24 hours: the run belongs to the day it ends (\"0000-0000\": the day itself)\n if (days.has(start === 0 || minute < start ? f.dayOfWeek : nextDay)) return true;\n continue;\n }\n // a run that ends at 0000 ends at 24:00 of the day it starts\n const end = rawEnd === 0 ? MINUTES_PER_DAY : rawEnd;\n const overnight = start > end;\n if (!change) {\n if (!overnight) {\n if (minute >= start && minute < end && days.has(f.dayOfWeek)) return true;\n } else {\n // the part from `start` belongs to the next day\n if (minute >= start && days.has(nextDay)) return true;\n if (minute < end && days.has(f.dayOfWeek)) return true;\n }\n continue;\n }\n // local days as naive instants (wall clock read as UTC)\n const changeWall = change.at + change.before;\n const place = (naive: number): number => (naive < changeWall ? naive - change.before : naive - change.after);\n const today = Math.floor((time + change.before) / MS_PER_DAY);\n for (let day = today - 1; day <= today + 1; day++) {\n if (!days.has(((day + 4) % 7) + 1)) continue; // 01/01/1970 is a Thursday (5)\n const from = day * MS_PER_DAY + (overnight ? start - MINUTES_PER_DAY : start) * MS_PER_MINUTE;\n const to = day * MS_PER_DAY + end * MS_PER_MINUTE;\n if (to === changeWall) {\n if (time >= from - change.after && time < to - change.after) return true;\n continue;\n }\n if (time >= place(from) && time < place(to)) return true;\n // clocks going back: the second pass of the repeated hour\n const repeated = change.at + change.after;\n if (change.after < change.before && to < changeWall && to > repeated) {\n if (time >= Math.max(from, repeated) - change.after && time < to - change.after) return true;\n }\n }\n // clocks going back, the day before: a run with an end on the wall time of the change is also true one change\n // later, from one bar after its usual end\n if (barMs !== undefined && change.after < change.before) {\n const day = Math.floor(changeWall / MS_PER_DAY) - 1;\n const wallMinute = (changeWall - (day + 1) * MS_PER_DAY) / MS_PER_MINUTE;\n if ((start === wallMinute || end === wallMinute) && days.has(((day + 4) % 7) + 1)) {\n const from = day * MS_PER_DAY + (overnight ? start - MINUTES_PER_DAY : start) * MS_PER_MINUTE - change.before;\n const to = day * MS_PER_DAY + end * MS_PER_MINUTE - change.before;\n const shift = change.before - change.after;\n if (time >= from + shift && time < to + shift && time >= to + barMs) return true;\n }\n }\n }\n return false;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBA,sBAAwC;AAExC,MAAM,kBAAkB;AACxB,MAAM,WAAW,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;AAC/B,MAAM,WAAW,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AASrC,SAAS,QAAQ,SAA8B;AAC7C,SAAO,IAAI,YAAY,oBAAoB,OAAO,qDAAqD;AACzG;AAEA,SAAS,YAAY,MAAc,SAA0C;AAC3E,MAAI,CAAC,KAAM,QAAO,CAAC;AACnB,QAAM,UAAU,KAAK,MAAM,GAAG;AAC9B,MAAI,QAAQ,SAAS,KAAK,QAAQ,QAAQ,SAAS,CAAC,MAAM,GAAI,SAAQ,IAAI;AAC1E,SAAO,QAAQ,IAAI,CAAC,UAAU;AAC5B,QAAI,CAAC,gBAAgB,KAAK,KAAK,EAAG,OAAM,QAAQ,OAAO;AACvD,QAAI,QAAQ,OAAO,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,OAAO,MAAM,MAAM,GAAG,CAAC,CAAC;AACrE,QAAI,MAAM,OAAO,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,OAAO,MAAM,MAAM,GAAG,CAAC,CAAC;AACnE,QAAI,SAAS,iBAAiB;AAC5B,YAAM,WAAW,OAAO;AACxB,UAAI,EAAE,QAAQ,kBAAkB,YAAY,YAAY,SAAS,QAAQ,IAAI,iBAAkB,OAAM,QAAQ,OAAO;AAAA,IACtH;AACA,aAAS;AACT,WAAO;AACP,WAAO,CAAC,OA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,IAAK,CAAC,EAAG;AACpC,YAAM,OAAO,MAAM,cAAc,YAAY,QAAQ,kBAAkB,SAAS;AAChF,YAAM,KAAK,MAAM,aAAa,MAAM;AACpC,UAAI,OAAO,YAAY;AACrB,YAAI,QAAQ,OAAO,OAAO,SAAS,OAAO,KAAK,OAAO,MAAO,QAAO;AACpE;AAAA,MACF;AACA,UAAI,QAAQ,MAAM,IAAI,KAAK,OAAO,MAAM,EAAE,EAAG,QAAO;AAEpD,YAAM,WAAW,OAAO,KAAK,OAAO;AACpC,UAAI,OAAO,QAAQ,OAAO,UAAU,KAAK,cAAc,KAAK,UAAU;AACpE,YAAI,QAAQ,KAAK,IAAI,MAAM,QAAQ,IAAI,OAAO,SAAS,OAAO,KAAK,OAAO,MAAO,QAAO;AAAA,MAC1F;AAAA,IACF;AAGA,QAAI,UAAU,UAAa,OAAO,QAAQ,OAAO,QAAQ;AACvD,YAAM,MAAM,KAAK,MAAM,aAAa,UAAU,IAAI;AAClD,YAAM,cAAc,cAAc,MAAM,KAAK,cAAc;AAC3D,WAAK,UAAU,cAAc,QAAQ,eAAe,KAAK,KAAM,MAAM,KAAK,IAAK,CAAC,GAAG;AACjF,cAAM,OAAO,MAAM,cAAc,YAAY,QAAQ,kBAAkB,SAAS,gBAAgB,OAAO;AACvG,cAAM,KAAK,MAAM,aAAa,MAAM,gBAAgB,OAAO;AAC3D,cAAM,QAAQ,OAAO,SAAS,OAAO;AACrC,YAAI,QAAQ,OAAO,SAAS,OAAO,KAAK,SAAS,QAAQ,KAAK,MAAO,QAAO;AAAA,MAC9E;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -345,17 +345,20 @@ export interface LabelData {
|
|
|
345
345
|
/** Price; not used with yloc 'abovebar' / 'belowbar' */
|
|
346
346
|
price: number;
|
|
347
347
|
text: string;
|
|
348
|
-
/** Background, border and arrow colour */
|
|
348
|
+
/** Background, border and arrow colour. Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */
|
|
349
349
|
color?: string;
|
|
350
|
+
/** Omitted: #FFFFFF in a v6 script, #363A45 in v4 and v5 (the result does not carry the version) */
|
|
350
351
|
textColor?: string;
|
|
351
|
-
/** 'none': text only, no background (PineScript label.style_none) */
|
|
352
|
+
/** 'none': text only, no background (PineScript label.style_none). Omitted: 'label_down' */
|
|
352
353
|
style?: LabelStyle;
|
|
354
|
+
/** Omitted: 'normal' */
|
|
353
355
|
size?: PineSize | number;
|
|
354
356
|
/**
|
|
355
357
|
* PineScript yloc: 'price' (default) places the label at `price`; 'abovebar' / 'belowbar' place it above the bar
|
|
356
358
|
* high / below the bar low and ignore `price` (the renderer reads the bar at `time`).
|
|
357
359
|
*/
|
|
358
360
|
yloc?: 'price' | 'abovebar' | 'belowbar';
|
|
361
|
+
/** Omitted: 'center' */
|
|
359
362
|
textAlign?: 'left' | 'center' | 'right';
|
|
360
363
|
tooltip?: string;
|
|
361
364
|
fontFamily?: 'default' | 'monospace';
|
|
@@ -372,8 +375,11 @@ export interface LineDrawingData {
|
|
|
372
375
|
price1: number;
|
|
373
376
|
time2: number;
|
|
374
377
|
price2: number;
|
|
378
|
+
/** Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */
|
|
375
379
|
color?: string;
|
|
380
|
+
/** Omitted: 1. A width of 0 is kept (PineScript `width = 0`) */
|
|
376
381
|
width?: number;
|
|
382
|
+
/** Omitted: 'solid' */
|
|
377
383
|
style?: 'solid' | 'dashed' | 'dotted' | 'arrow_left' | 'arrow_right' | 'arrow_both';
|
|
378
384
|
extend?: 'none' | 'left' | 'right' | 'both';
|
|
379
385
|
/** PineScript force_overlay = true: the line of a non-overlay indicator is drawn on the price pane */
|
|
@@ -387,14 +393,22 @@ export interface BoxData {
|
|
|
387
393
|
price1: number;
|
|
388
394
|
time2: number;
|
|
389
395
|
price2: number;
|
|
396
|
+
/** Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */
|
|
390
397
|
bgColor?: string;
|
|
398
|
+
/** Omitted: #2962FF (color.blue; #2196F3 in a v4 script) */
|
|
391
399
|
borderColor?: string;
|
|
400
|
+
/** Omitted: 1. A width of 0 is no border (PineScript `border_width = 0`) */
|
|
392
401
|
borderWidth?: number;
|
|
402
|
+
/** Omitted: 'solid' */
|
|
393
403
|
borderStyle?: 'solid' | 'dashed' | 'dotted';
|
|
394
404
|
text?: string;
|
|
405
|
+
/** Omitted: #FFFFFF in a v6 script, #363A45 in v5 (the result does not carry the version) */
|
|
395
406
|
textColor?: string;
|
|
407
|
+
/** Omitted: 'auto' */
|
|
396
408
|
textSize?: PineSize | number;
|
|
409
|
+
/** Omitted: 'center' */
|
|
397
410
|
textHAlign?: 'left' | 'center' | 'right';
|
|
411
|
+
/** Omitted: 'center' */
|
|
398
412
|
textVAlign?: 'top' | 'center' | 'bottom';
|
|
399
413
|
textWrap?: 'none' | 'auto';
|
|
400
414
|
fontFamily?: 'default' | 'monospace';
|
|
@@ -425,10 +439,12 @@ export interface PolylineData {
|
|
|
425
439
|
curved?: boolean;
|
|
426
440
|
/** The last point is connected to the first */
|
|
427
441
|
closed?: boolean;
|
|
442
|
+
/** Omitted: #2962FF (color.blue) */
|
|
428
443
|
lineColor?: string;
|
|
429
|
-
/** Fill of the area inside the polyline */
|
|
444
|
+
/** Fill of the area inside the polyline. Omitted: no fill */
|
|
430
445
|
fillColor?: string;
|
|
431
446
|
lineStyle?: 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both';
|
|
447
|
+
/** Omitted: 1 */
|
|
432
448
|
lineWidth?: number;
|
|
433
449
|
/** PineScript force_overlay = true: the polyline of a non-overlay indicator is drawn on the price pane */
|
|
434
450
|
forceOverlay?: boolean;
|
|
@@ -442,8 +458,11 @@ export interface TableCellData {
|
|
|
442
458
|
row: number;
|
|
443
459
|
column: number;
|
|
444
460
|
text: string;
|
|
461
|
+
/** Omitted: no background */
|
|
445
462
|
bgColor?: string;
|
|
463
|
+
/** Omitted: #363A45 (in v4, v5 and v6 scripts) */
|
|
446
464
|
textColor?: string;
|
|
465
|
+
/** Omitted: 'auto' */
|
|
447
466
|
textSize?: PineSize | number;
|
|
448
467
|
/** Width in % of the chart width; 0 fits the text */
|
|
449
468
|
width?: number;
|
|
@@ -475,10 +494,15 @@ export interface TableData {
|
|
|
475
494
|
rows: number;
|
|
476
495
|
cells: TableCellData[];
|
|
477
496
|
merges?: TableMergeData[];
|
|
497
|
+
/** Omitted: no background */
|
|
478
498
|
bgColor?: string;
|
|
499
|
+
/** Omitted: no frame */
|
|
479
500
|
frameColor?: string;
|
|
501
|
+
/** Omitted: 0 */
|
|
480
502
|
frameWidth?: number;
|
|
503
|
+
/** Omitted: no cell borders */
|
|
481
504
|
borderColor?: string;
|
|
505
|
+
/** Omitted: 0 */
|
|
482
506
|
borderWidth?: number;
|
|
483
507
|
/** PineScript force_overlay = true: the table of a non-overlay indicator is drawn on the price pane */
|
|
484
508
|
forceOverlay?: boolean;
|
|
@@ -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,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,i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,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';\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 /** 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 /** 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 /** 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 /** 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 /** Price; not used with yloc 'abovebar' / 'belowbar' */\n price: number;\n text: string;\n /** Background, border and arrow colour */\n color?: string;\n textColor?: string;\n /** 'none': text only, no background (PineScript label.style_none) */\n style?: LabelStyle;\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 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 color?: string;\n width?: number;\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 bgColor?: string;\n borderColor?: string;\n borderWidth?: number;\n borderStyle?: 'solid' | 'dashed' | 'dotted';\n text?: string;\n textColor?: string;\n textSize?: PineSize | number;\n textHAlign?: 'left' | 'center' | 'right';\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 /** Curved segments between the points */\n curved?: boolean;\n /** The last point is connected to the first */\n closed?: boolean;\n lineColor?: string;\n /** Fill of the area inside the polyline */\n fillColor?: string;\n lineStyle?: 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both';\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 bgColor?: string;\n textColor?: string;\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 bgColor?: string;\n frameColor?: string;\n frameWidth?: number;\n borderColor?: string;\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';\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 /** 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 /** 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 /** 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 /** 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 /** 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 /** 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 /** 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 /** 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
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src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