oakscriptjs 0.10.1 → 0.11.1
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/array/index.d.ts +8 -2
- package/dist/cjs/array/index.d.ts.map +1 -1
- package/dist/cjs/array/index.js +2 -1
- package/dist/cjs/array/index.js.map +2 -2
- 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 +84 -0
- package/dist/cjs/drawing/registry.d.ts.map +1 -1
- package/dist/cjs/drawing/registry.js +153 -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 +33 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/input.d.ts +9 -1
- package/dist/cjs/input.d.ts.map +1 -1
- package/dist/cjs/input.js +16 -0
- package/dist/cjs/input.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 +10 -27
- package/dist/cjs/line/index.d.ts.map +1 -1
- package/dist/cjs/line/index.js +11 -22
- package/dist/cjs/line/index.js.map +2 -2
- package/dist/cjs/linefill/index.d.ts +3 -0
- package/dist/cjs/linefill/index.d.ts.map +1 -1
- package/dist/cjs/linefill/index.js +15 -1
- package/dist/cjs/linefill/index.js.map +3 -3
- 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/adapters/SimpleInputAdapter.js +1 -1
- package/dist/cjs/runtime/adapters/SimpleInputAdapter.js.map +2 -2
- package/dist/cjs/runtime/index.d.ts +1 -1
- package/dist/cjs/runtime/index.d.ts.map +1 -1
- package/dist/cjs/runtime/index.js +1 -0
- package/dist/cjs/runtime/index.js.map +2 -2
- package/dist/cjs/runtime/inputs.d.ts +9 -0
- package/dist/cjs/runtime/inputs.d.ts.map +1 -1
- package/dist/cjs/runtime/inputs.js +8 -0
- package/dist/cjs/runtime/inputs.js.map +2 -2
- package/dist/cjs/runtime/types.d.ts +1 -1
- 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 +91 -21
- package/dist/cjs/script/index.d.ts.map +1 -1
- package/dist/cjs/script/index.js +207 -19
- package/dist/cjs/script/index.js.map +3 -3
- package/dist/cjs/security/other.d.ts +92 -0
- package/dist/cjs/security/other.d.ts.map +1 -0
- package/dist/cjs/security/other.js +164 -0
- package/dist/cjs/security/other.js.map +7 -0
- package/dist/cjs/session/bars.d.ts +24 -1
- package/dist/cjs/session/bars.d.ts.map +1 -1
- package/dist/cjs/session/bars.js +56 -7
- package/dist/cjs/session/bars.js.map +3 -3
- package/dist/cjs/session/calendar.d.ts +13 -2
- package/dist/cjs/session/calendar.d.ts.map +1 -1
- package/dist/cjs/session/calendar.js +39 -9
- package/dist/cjs/session/calendar.js.map +2 -2
- package/dist/cjs/session/context.d.ts +76 -0
- package/dist/cjs/session/context.d.ts.map +1 -0
- package/dist/cjs/session/context.js +114 -0
- package/dist/cjs/session/context.js.map +7 -0
- package/dist/cjs/str/floatingdecimal.d.ts +31 -0
- package/dist/cjs/str/floatingdecimal.d.ts.map +1 -0
- package/dist/cjs/str/floatingdecimal.js +298 -0
- package/dist/cjs/str/floatingdecimal.js.map +7 -0
- package/dist/cjs/str/index.d.ts +4 -1
- package/dist/cjs/str/index.d.ts.map +1 -1
- package/dist/cjs/str/index.js +2 -1
- package/dist/cjs/str/index.js.map +2 -2
- package/dist/cjs/str/numberformat.d.ts +7 -3
- package/dist/cjs/str/numberformat.d.ts.map +1 -1
- package/dist/cjs/str/numberformat.js +4 -3
- package/dist/cjs/str/numberformat.js.map +2 -2
- package/dist/cjs/ta/index.d.ts +67 -34
- package/dist/cjs/ta/index.d.ts.map +1 -1
- package/dist/cjs/ta/index.js +202 -145
- package/dist/cjs/ta/index.js.map +2 -2
- package/dist/cjs/ta/limits.d.ts +35 -0
- package/dist/cjs/ta/limits.d.ts.map +1 -0
- package/dist/cjs/ta/limits.js +64 -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 +8 -8
- package/dist/cjs/ta-series.d.ts.map +1 -1
- package/dist/cjs/ta-series.js +10 -8
- package/dist/cjs/ta-series.js.map +2 -2
- package/dist/cjs/table/index.d.ts +3 -1
- package/dist/cjs/table/index.d.ts.map +1 -1
- package/dist/cjs/table/index.js +1 -0
- package/dist/cjs/table/index.js.map +3 -3
- 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 +26 -1
- package/dist/cjs/time/session.d.ts.map +1 -1
- package/dist/cjs/time/session.js +94 -12
- package/dist/cjs/time/session.js.map +3 -3
- package/dist/cjs/time/timezone.d.ts +6 -1
- package/dist/cjs/time/timezone.d.ts.map +1 -1
- package/dist/cjs/time/timezone.js +2 -2
- package/dist/cjs/time/timezone.js.map +2 -2
- package/dist/cjs/types/metadata.d.ts +28 -4
- package/dist/cjs/types/metadata.d.ts.map +1 -1
- package/dist/cjs/types/metadata.js.map +1 -1
- package/dist/esm/array/index.d.ts +8 -2
- package/dist/esm/array/index.d.ts.map +1 -1
- package/dist/esm/array/index.js +12 -3
- package/dist/esm/array/index.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 +84 -0
- package/dist/esm/drawing/registry.d.ts.map +1 -1
- package/dist/esm/drawing/registry.js +260 -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 +13 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/input.d.ts +9 -1
- package/dist/esm/input.d.ts.map +1 -1
- package/dist/esm/input.js +16 -0
- package/dist/esm/input.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 +10 -27
- package/dist/esm/line/index.d.ts.map +1 -1
- package/dist/esm/line/index.js +22 -60
- package/dist/esm/line/index.js.map +1 -1
- package/dist/esm/linefill/index.d.ts +3 -0
- package/dist/esm/linefill/index.d.ts.map +1 -1
- package/dist/esm/linefill/index.js +20 -1
- package/dist/esm/linefill/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/adapters/SimpleInputAdapter.js +1 -1
- package/dist/esm/runtime/adapters/SimpleInputAdapter.js.map +1 -1
- package/dist/esm/runtime/index.d.ts +1 -1
- package/dist/esm/runtime/index.d.ts.map +1 -1
- package/dist/esm/runtime/index.js +1 -1
- package/dist/esm/runtime/index.js.map +1 -1
- package/dist/esm/runtime/inputs.d.ts +9 -0
- package/dist/esm/runtime/inputs.d.ts.map +1 -1
- package/dist/esm/runtime/inputs.js +15 -0
- package/dist/esm/runtime/inputs.js.map +1 -1
- package/dist/esm/runtime/types.d.ts +1 -1
- package/dist/esm/runtime/types.d.ts.map +1 -1
- package/dist/esm/script/index.d.ts +91 -21
- package/dist/esm/script/index.d.ts.map +1 -1
- package/dist/esm/script/index.js +259 -28
- package/dist/esm/script/index.js.map +1 -1
- package/dist/esm/security/other.d.ts +92 -0
- package/dist/esm/security/other.d.ts.map +1 -0
- package/dist/esm/security/other.js +211 -0
- package/dist/esm/security/other.js.map +1 -0
- package/dist/esm/session/bars.d.ts +24 -1
- package/dist/esm/session/bars.d.ts.map +1 -1
- package/dist/esm/session/bars.js +75 -6
- package/dist/esm/session/bars.js.map +1 -1
- package/dist/esm/session/calendar.d.ts +13 -2
- package/dist/esm/session/calendar.d.ts.map +1 -1
- package/dist/esm/session/calendar.js +54 -10
- package/dist/esm/session/calendar.js.map +1 -1
- package/dist/esm/session/context.d.ts +76 -0
- package/dist/esm/session/context.d.ts.map +1 -0
- package/dist/esm/session/context.js +124 -0
- package/dist/esm/session/context.js.map +1 -0
- package/dist/esm/str/floatingdecimal.d.ts +31 -0
- package/dist/esm/str/floatingdecimal.d.ts.map +1 -0
- package/dist/esm/str/floatingdecimal.js +272 -0
- package/dist/esm/str/floatingdecimal.js.map +1 -0
- package/dist/esm/str/index.d.ts +4 -1
- package/dist/esm/str/index.d.ts.map +1 -1
- package/dist/esm/str/index.js +9 -2
- package/dist/esm/str/index.js.map +1 -1
- package/dist/esm/str/numberformat.d.ts +7 -3
- package/dist/esm/str/numberformat.d.ts.map +1 -1
- package/dist/esm/str/numberformat.js +11 -5
- package/dist/esm/str/numberformat.js.map +1 -1
- package/dist/esm/ta/index.d.ts +67 -34
- package/dist/esm/ta/index.d.ts.map +1 -1
- package/dist/esm/ta/index.js +284 -240
- package/dist/esm/ta/index.js.map +1 -1
- package/dist/esm/ta/limits.d.ts +35 -0
- package/dist/esm/ta/limits.d.ts.map +1 -0
- package/dist/esm/ta/limits.js +67 -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 +8 -8
- package/dist/esm/ta-series.d.ts.map +1 -1
- package/dist/esm/ta-series.js +11 -8
- package/dist/esm/ta-series.js.map +1 -1
- package/dist/esm/table/index.d.ts +3 -1
- package/dist/esm/table/index.d.ts.map +1 -1
- package/dist/esm/table/index.js +6 -1
- package/dist/esm/table/index.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 +26 -1
- package/dist/esm/time/session.d.ts.map +1 -1
- package/dist/esm/time/session.js +141 -16
- package/dist/esm/time/session.js.map +1 -1
- package/dist/esm/time/timezone.d.ts +6 -1
- package/dist/esm/time/timezone.d.ts.map +1 -1
- package/dist/esm/time/timezone.js +8 -2
- package/dist/esm/time/timezone.js.map +1 -1
- package/dist/esm/types/metadata.d.ts +28 -4
- package/dist/esm/types/metadata.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/array/index.ts +11 -3
- package/src/box/index.ts +8 -2
- package/src/callsite/index.ts +150 -100
- package/src/drawing/registry.ts +278 -5
- package/src/index.ts +44 -1
- package/src/input.ts +18 -1
- package/src/label/index.ts +4 -1
- package/src/line/index.ts +22 -64
- package/src/linefill/index.ts +20 -1
- package/src/math/index.ts +2 -0
- package/src/polyline/index.ts +3 -1
- package/src/runtime/adapters/SimpleInputAdapter.ts +1 -1
- package/src/runtime/index.ts +1 -0
- package/src/runtime/inputs.ts +16 -0
- package/src/runtime/types.ts +1 -1
- package/src/script/index.ts +355 -34
- package/src/security/other.ts +269 -0
- package/src/session/bars.ts +70 -6
- package/src/session/calendar.ts +60 -10
- package/src/session/context.ts +162 -0
- package/src/str/floatingdecimal.ts +268 -0
- package/src/str/index.ts +8 -2
- package/src/str/numberformat.ts +13 -6
- package/src/ta/index.ts +304 -248
- package/src/ta/limits.ts +74 -0
- package/src/ta/running-sum.ts +2 -0
- package/src/ta-series.ts +19 -16
- package/src/table/index.ts +4 -1
- package/src/time/index.ts +6 -3
- package/src/time/session.ts +137 -15
- package/src/time/timezone.ts +9 -2
- package/src/types/metadata.ts +28 -4
|
@@ -19,12 +19,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var registry_exports = {};
|
|
20
20
|
__export(registry_exports, {
|
|
21
21
|
DEFAULT_MAX_COUNT: () => DEFAULT_MAX_COUNT,
|
|
22
|
+
MAX_DRAWING_BARS_BACK: () => MAX_DRAWING_BARS_BACK,
|
|
23
|
+
MAX_DRAWING_BARS_FORWARD: () => MAX_DRAWING_BARS_FORWARD,
|
|
22
24
|
all: () => all,
|
|
25
|
+
checkBarIndex: () => checkBarIndex,
|
|
26
|
+
holdDrawing: () => holdDrawing,
|
|
23
27
|
isDeleted: () => isDeleted,
|
|
24
28
|
register: () => register,
|
|
29
|
+
releaseDrawing: () => releaseDrawing,
|
|
25
30
|
remove: () => remove,
|
|
26
31
|
resetDrawings: () => resetDrawings,
|
|
27
|
-
|
|
32
|
+
setDrawingBar: () => setDrawingBar,
|
|
33
|
+
setDrawingLimits: () => setDrawingLimits,
|
|
34
|
+
varDrawing: () => varDrawing
|
|
28
35
|
});
|
|
29
36
|
module.exports = __toCommonJS(registry_exports);
|
|
30
37
|
const DEFAULT_MAX_COUNT = 50;
|
|
@@ -44,6 +51,89 @@ let limits = {
|
|
|
44
51
|
polyline: DEFAULT_MAX_COUNT
|
|
45
52
|
};
|
|
46
53
|
const deleted = /* @__PURE__ */ new WeakSet();
|
|
54
|
+
let held = /* @__PURE__ */ new WeakMap();
|
|
55
|
+
let releasedAt = /* @__PURE__ */ new WeakMap();
|
|
56
|
+
const LINEFILL_RELEASE_BARS = 5e3;
|
|
57
|
+
let heldAt = /* @__PURE__ */ new WeakMap();
|
|
58
|
+
const COUNTED_KINDS = ["line", "label", "box", "polyline"];
|
|
59
|
+
const isCounted = (kind) => COUNTED_KINDS.includes(kind);
|
|
60
|
+
let pending = { line: 0, label: 0, box: 0, polyline: 0 };
|
|
61
|
+
const PENDING_RESET = { line: 5, label: 5, box: 5, polyline: 3 };
|
|
62
|
+
function holdDrawing(obj) {
|
|
63
|
+
if (!held.has(obj)) {
|
|
64
|
+
if (currentBar === null) heldAt.delete(obj);
|
|
65
|
+
else heldAt.set(obj, currentBar);
|
|
66
|
+
}
|
|
67
|
+
held.set(obj, (held.get(obj) ?? 0) + 1);
|
|
68
|
+
return obj;
|
|
69
|
+
}
|
|
70
|
+
function releaseDrawing(obj) {
|
|
71
|
+
if (!obj) return;
|
|
72
|
+
const count = held.get(obj) ?? 0;
|
|
73
|
+
if (count > 1) held.set(obj, count - 1);
|
|
74
|
+
else if (held.delete(obj) && currentBar !== null) releasedAt.set(obj, currentBar);
|
|
75
|
+
}
|
|
76
|
+
function heldBefore(obj) {
|
|
77
|
+
if (!held.has(obj)) return false;
|
|
78
|
+
const bar = heldAt.get(obj);
|
|
79
|
+
return bar === void 0 || currentBar === null || bar < currentBar;
|
|
80
|
+
}
|
|
81
|
+
function fillProtected(obj) {
|
|
82
|
+
if (held.has(obj)) return true;
|
|
83
|
+
const bar = releasedAt.get(obj);
|
|
84
|
+
return bar !== void 0 && currentBar !== null && currentBar - bar < LINEFILL_RELEASE_BARS;
|
|
85
|
+
}
|
|
86
|
+
function varDrawing(initial) {
|
|
87
|
+
let current = initial ? holdDrawing(initial) : void 0;
|
|
88
|
+
return {
|
|
89
|
+
get value() {
|
|
90
|
+
return current;
|
|
91
|
+
},
|
|
92
|
+
set value(next) {
|
|
93
|
+
if (next === current) return;
|
|
94
|
+
releaseDrawing(current);
|
|
95
|
+
current = next ? holdDrawing(next) : void 0;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
const MAX_DRAWING_BARS_BACK = 1e4;
|
|
100
|
+
const MAX_DRAWING_BARS_FORWARD = 500;
|
|
101
|
+
let currentBar = null;
|
|
102
|
+
let lastBarIndex = null;
|
|
103
|
+
const isAllowanceKind = (kind) => kind === "line" || kind === "label" || kind === "box";
|
|
104
|
+
let lastBar = null;
|
|
105
|
+
function setDrawingBar(barIndex, last = false, lastIndex) {
|
|
106
|
+
if (lastBar && !(last && barIndex === lastBar.bar)) lastBar = null;
|
|
107
|
+
currentBar = barIndex;
|
|
108
|
+
lastBarIndex = barIndex === null ? null : lastIndex ?? (last ? barIndex : null);
|
|
109
|
+
if (barIndex !== null && last && !lastBar) {
|
|
110
|
+
const start = (kind) => pending[kind] >= PENDING_RESET[kind] ? 0 : pending[kind];
|
|
111
|
+
lastBar = {
|
|
112
|
+
bar: barIndex,
|
|
113
|
+
old: /* @__PURE__ */ new Set([...live.line, ...live.label, ...live.box, ...live.polyline]),
|
|
114
|
+
allowance: { line: start("line"), label: start("label"), box: start("box") },
|
|
115
|
+
carried: pending.polyline,
|
|
116
|
+
polyline: false,
|
|
117
|
+
oldPolylinesGone: 0
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function checkBarIndex(method, variable, x, xloc) {
|
|
122
|
+
if ((xloc ?? "bar_index") !== "bar_index") return x;
|
|
123
|
+
x = Math.trunc(x);
|
|
124
|
+
if (currentBar === null) return x;
|
|
125
|
+
if (lastBarIndex !== null && x - lastBarIndex > MAX_DRAWING_BARS_FORWARD) {
|
|
126
|
+
throw new Error(
|
|
127
|
+
`Error on bar ${currentBar}: Objects positioned using xloc.bar_index cannot be drawn further than ${MAX_DRAWING_BARS_FORWARD} bars into the future.`
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
if (currentBar - x > MAX_DRAWING_BARS_BACK) {
|
|
131
|
+
throw new Error(
|
|
132
|
+
`Error on bar ${currentBar}: Bar index value of the \`${variable}\` argument (${x}) in \`${method}()\` is too far from the current bar index. Try using \`time\` instead.`
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
return x;
|
|
136
|
+
}
|
|
47
137
|
const COORDINATES = {
|
|
48
138
|
line: ["x1", "y1", "x2", "y2"],
|
|
49
139
|
label: ["x", "y"],
|
|
@@ -59,20 +149,70 @@ function markDeleted(kind, obj, explicit) {
|
|
|
59
149
|
for (const fill of live.linefill.filter((f) => f.line1 === obj || f.line2 === obj)) remove("linefill", fill);
|
|
60
150
|
}
|
|
61
151
|
}
|
|
152
|
+
function allowance(kind) {
|
|
153
|
+
if (kind === "polyline") return pending.polyline;
|
|
154
|
+
return lastBar && isAllowanceKind(kind) ? lastBar.allowance[kind] : 0;
|
|
155
|
+
}
|
|
156
|
+
function cutOldest(kind, list, obj, only) {
|
|
157
|
+
if (kind === "table") return [];
|
|
158
|
+
const max = limits[kind === "linefill" ? "line" : kind] + allowance(kind);
|
|
159
|
+
if (list.length <= max + SLACK) return [];
|
|
160
|
+
const kept = [];
|
|
161
|
+
const cut = [];
|
|
162
|
+
let excess = list.length - max;
|
|
163
|
+
for (const old of list) {
|
|
164
|
+
if (excess > 0 && old !== obj && (!only || only(old)) && !(kind === "linefill" ? fillProtected(old) : heldBefore(old))) {
|
|
165
|
+
excess--;
|
|
166
|
+
cut.push(old);
|
|
167
|
+
} else kept.push(old);
|
|
168
|
+
}
|
|
169
|
+
if (kind === "linefill" && kept.length > max + SLACK) cut.push(...kept.splice(0, kept.length - max));
|
|
170
|
+
list.length = 0;
|
|
171
|
+
list.push(...kept);
|
|
172
|
+
return cut;
|
|
173
|
+
}
|
|
62
174
|
function register(kind, obj) {
|
|
63
175
|
const list = live[kind];
|
|
176
|
+
if (lastBar && isCounted(kind)) return registerLast(lastBar, kind, obj);
|
|
177
|
+
if (isCounted(kind) && pending[kind] >= PENDING_RESET[kind]) pending[kind] = 0;
|
|
64
178
|
list.push(obj);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
179
|
+
const cut = cutOldest(kind, list, obj);
|
|
180
|
+
if (kind === "polyline") pending.polyline += cut.length;
|
|
181
|
+
for (const old of cut) markDeleted(kind, old, false);
|
|
182
|
+
return obj;
|
|
183
|
+
}
|
|
184
|
+
function registerLast(bar, kind, obj) {
|
|
185
|
+
if (kind === "polyline" && !bar.polyline) {
|
|
186
|
+
bar.polyline = true;
|
|
187
|
+
if (pending.polyline >= PENDING_RESET.polyline) pending.polyline = 0;
|
|
188
|
+
else pending.polyline += bar.carried;
|
|
189
|
+
}
|
|
190
|
+
const list = live[kind];
|
|
191
|
+
list.push(obj);
|
|
192
|
+
const isOld = (old) => bar.old.has(old);
|
|
193
|
+
if (list.some((old) => old !== obj && isOld(old) && !heldBefore(old))) {
|
|
194
|
+
const cut = cutOldest(kind, list, obj, isOld);
|
|
195
|
+
if (kind === "polyline") {
|
|
196
|
+
pending.polyline += cut.length;
|
|
197
|
+
bar.oldPolylinesGone += cut.length;
|
|
198
|
+
}
|
|
199
|
+
for (const old of cut) markDeleted(kind, old, true);
|
|
200
|
+
} else {
|
|
201
|
+
if (kind === "polyline" && pending.polyline < bar.oldPolylinesGone) pending.polyline = bar.oldPolylinesGone;
|
|
202
|
+
const cut = cutOldest(kind, list, obj);
|
|
203
|
+
if (kind === "polyline" && cut.length > 0) pending.polyline = bar.oldPolylinesGone;
|
|
204
|
+
for (const old of cut) markDeleted(kind, old, false);
|
|
69
205
|
}
|
|
70
206
|
return obj;
|
|
71
207
|
}
|
|
72
208
|
function remove(kind, obj) {
|
|
73
209
|
const list = live[kind];
|
|
74
210
|
const index = list.indexOf(obj);
|
|
75
|
-
if (index !== -1)
|
|
211
|
+
if (index !== -1) {
|
|
212
|
+
list.splice(index, 1);
|
|
213
|
+
if (isCounted(kind)) pending[kind]++;
|
|
214
|
+
if (kind === "polyline" && lastBar?.old.has(obj)) lastBar.oldPolylinesGone++;
|
|
215
|
+
}
|
|
76
216
|
if (!deleted.has(obj)) markDeleted(kind, obj, true);
|
|
77
217
|
}
|
|
78
218
|
function isDeleted(obj) {
|
|
@@ -83,6 +223,13 @@ function all(kind) {
|
|
|
83
223
|
}
|
|
84
224
|
function resetDrawings(newLimits = {}) {
|
|
85
225
|
for (const kind of Object.keys(live)) live[kind].length = 0;
|
|
226
|
+
held = /* @__PURE__ */ new WeakMap();
|
|
227
|
+
releasedAt = /* @__PURE__ */ new WeakMap();
|
|
228
|
+
heldAt = /* @__PURE__ */ new WeakMap();
|
|
229
|
+
pending = { line: 0, label: 0, box: 0, polyline: 0 };
|
|
230
|
+
currentBar = null;
|
|
231
|
+
lastBarIndex = null;
|
|
232
|
+
lastBar = null;
|
|
86
233
|
limits = {
|
|
87
234
|
line: newLimits.line ?? DEFAULT_MAX_COUNT,
|
|
88
235
|
label: newLimits.label ?? DEFAULT_MAX_COUNT,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/drawing/registry.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Registry of the live drawing objects (lines, labels, boxes, polylines, linefills, tables), as PineScript\n * keeps them. PineScript rules:\n *\n * - `line.all`, `label.all`, ... list the live objects in creation order (a copy of the list)\n * - `delete` removes an object; the object becomes `na`: its getters return NaN and its setters\n * do nothing. Deleting a line with `line.delete` also deletes the linefills that use it\n * - when a creation brings the count above `max_*_count + 5`, the oldest objects are deleted until\n * `max_*_count` remain (default 50). Copies count as creations. Linefills follow the same rule with\n * `max_lines_count`; lines deleted by this rule do not delete their linefills\n *\n * The script API (`executeScript`) resets the registry at the start of every run and applies the\n * `max_*_count` values of `indicator()`. Outside a script run the registry is global to the module.\n *\n * @module drawing/registry\n */\n\nimport type { Box, Label, Line, Linefill, Polyline, Table } from '../types/index.js';\n\nexport type DrawingKind = 'line' | 'label' | 'box' | 'polyline' | 'linefill' | 'table';\n\ninterface DrawingTypes {\n line: Line;\n label: Label;\n box: Box;\n polyline: Polyline;\n linefill: Linefill;\n table: Table;\n}\n\n/** Default `max_lines_count`, `max_labels_count`, `max_boxes_count`, `max_polylines_count`. */\nexport const DEFAULT_MAX_COUNT = 50;\n/** Objects above the maximum that PineScript keeps before it deletes the oldest ones. */\nconst SLACK = 5;\n\nexport type DrawingLimits = Partial<Record<Exclude<DrawingKind, 'linefill' | 'table'>, number>>;\n\nconst live: { [K in DrawingKind]: Array<DrawingTypes[K]> } = {\n line: [],\n label: [],\n box: [],\n polyline: [],\n linefill: [],\n table: [],\n};\nlet limits: Required<DrawingLimits> = {\n line: DEFAULT_MAX_COUNT,\n label: DEFAULT_MAX_COUNT,\n box: DEFAULT_MAX_COUNT,\n polyline: DEFAULT_MAX_COUNT,\n};\nconst deleted = new WeakSet<object>();\n\n/** Numeric fields that become NaN when an object is deleted, so that its getters return `na`. */\nconst COORDINATES: { [K in DrawingKind]: Array<keyof DrawingTypes[K]> } = {\n line: ['x1', 'y1', 'x2', 'y2'],\n label: ['x', 'y'],\n box: ['left', 'top', 'right', 'bottom'],\n polyline: [],\n linefill: [],\n table: [],\n};\n\nfunction markDeleted<K extends DrawingKind>(kind: K, obj: DrawingTypes[K], explicit: boolean): void {\n deleted.add(obj);\n for (const field of COORDINATES[kind]) (obj as unknown as Record<string, unknown>)[field as string] = NaN;\n if (kind === 'line' && explicit) {\n for (const fill of live.linefill.filter((f) => f.line1 === obj || f.line2 === obj)) remove('linefill', fill);\n }\n}\n\n/** Records a new object and deletes the oldest objects of its kind when the count is too high. */\nexport function register<K extends DrawingKind>(kind: K, obj: DrawingTypes[K]): DrawingTypes[K] {\n const list = live[kind];\n list.push(obj);\n if (kind === 'table') return obj; // tables have no maximum count\n const max = limits[kind === 'linefill' ? 'line' : (kind as keyof DrawingLimits)];\n if (list.length > max + SLACK) {\n for (const old of list.splice(0, list.length - max)) markDeleted(kind, old, false);\n }\n return obj;\n}\n\n/** Deletes an object (no effect when it is already deleted). */\nexport function remove<K extends DrawingKind>(kind: K, obj: DrawingTypes[K]): void {\n const list = live[kind];\n const index = list.indexOf(obj);\n if (index !== -1) list.splice(index, 1);\n if (!deleted.has(obj)) markDeleted(kind, obj, true);\n}\n\n/** True when the object was deleted (by `delete` or by the maximum count). */\nexport function isDeleted(obj: unknown): boolean {\n return typeof obj === 'object' && obj !== null && deleted.has(obj);\n}\n\n/** The live objects of a kind, in creation order (a new array). */\nexport function all<K extends DrawingKind>(kind: K): Array<DrawingTypes[K]> {\n return [...live[kind]] as Array<DrawingTypes[K]>;\n}\n\n/** Forgets all objects (without deleting them) and sets the maximum counts (default 50). */\nexport function resetDrawings(newLimits: DrawingLimits = {}): void {\n for (const kind of Object.keys(live) as DrawingKind[]) live[kind].length = 0;\n limits = {\n line: newLimits.line ?? DEFAULT_MAX_COUNT,\n label: newLimits.label ?? DEFAULT_MAX_COUNT,\n box: newLimits.box ?? DEFAULT_MAX_COUNT,\n polyline: newLimits.polyline ?? DEFAULT_MAX_COUNT,\n };\n}\n\n/** Changes the maximum counts without forgetting the objects (PineScript `indicator(max_*_count)`). */\nexport function setDrawingLimits(newLimits: DrawingLimits): void {\n limits = { ...limits, ...Object.fromEntries(Object.entries(newLimits).filter(([, v]) => v !== undefined)) };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["/**\n * Registry of the live drawing objects (lines, labels, boxes, polylines, linefills, tables), as PineScript\n * keeps them. PineScript rules:\n *\n * - `line.all`, `label.all`, ... list the live objects in creation order (a copy of the list)\n * - `delete` removes an object; the object becomes `na`: its getters return NaN and its setters\n * do nothing. Deleting a line with `line.delete` also deletes the linefills that use it\n * - when a creation brings the count above `max_*_count + 5`, the oldest objects are deleted until\n * `max_*_count` remain (default 50). Copies count as creations. Linefills follow the same rule with\n * `max_lines_count`; lines deleted by this rule do not delete their linefills\n * - the object that was just created is never deleted by this rule\n * - an object that a `var` variable of the drawing type refers to is never deleted by this rule, and it still counts\n * (measured for lines, labels and boxes: with 9 held boxes and a maximum of 50, 9 held + 46 others stay; with 8\n * held lines and a maximum of 5, the 8 and the newest line stay). The protection starts on the bar after the\n * assignment: 12 `var` lines created on the first bar with a maximum of 5 lose the first 6. Only\n * the variable itself protects: an object in a `var` array, in a field of a user type or in a variable that got\n * another object or `na` later is deleted like any other. JavaScript has no `var` declaration to observe, so the\n * script says it: {@link varDrawing} (a variable), or {@link holdDrawing} / {@link releaseDrawing}\n * - linefills have the limit of `max_lines_count` with another rule for the held ones (measured on one script, two\n * long runs): a fill is skipped when a `var` variable holds it or released it less than 5,000 bars ago (the bar\n * of {@link setDrawingBar}); when the count is still above the maximum + 5 after that, the oldest fills are\n * deleted until the maximum remain, the held ones too\n * - the script deletes count (`line.delete`, `label.delete`, ...): each kind has a number `P` of deleted objects. A\n * delete adds 1; a creation first sets `P` to 0 when it is 5 or more (3 or more for polylines)\n * - polylines use `P` on every bar: a creation cuts when the count is above `max_polylines_count + 5 + P`, down to\n * the maximum + `P`, and the polylines of the cut are added to `P`. A script that deletes and creates one polyline\n * per bar therefore sees the cut 0, 1 or 2 bars late\n * - lines, labels and boxes use `P` on the last bar only, with its value at the start of that bar: there the cut is\n * above the maximum + 5 + `P`, down to the maximum + `P` (up to 4 more objects)\n * - the last bar has rules of its own (measured from the count after each creation, on a closed and on an open last\n * bar): a cut deletes the objects of the bars before first, at most those (a line takes its linefills with it);\n * once none is left, a cut deletes objects of the last bar as on any bar. With 10 lines and a maximum of 10, 13\n * lines on the last bar leave these 13: the cut at the 16th line deletes the 10 old ones only. Lines, labels and\n * boxes: equal to PineScript, count after every operation and objects alive at the end, on 72 of 72 runs checked\n * after the rule was written (and 218 of 218 end states before)\n * - polylines on the last bar: the `P` carried from the bar before is counted twice (the first creation adds it once\n * more, unless it sets `P` to 0), later creations do not set `P` to 0, and the polylines of the bars before that a\n * cut deletes are added to `P`. Once none is\n * left, `P` is at least the number of polylines of the bars before deleted on the last bar (by the count or by\n * the script) and a cut deletes polylines of the last bar: a script that deletes its 100 polylines and creates 200\n * on the last bar keeps them all (#176). Equal to PineScript for the polylines alive at the end on 271 of\n * 281 probe runs; the count inside the bar can differ when the script deletes polylines of the last bar\n *\n * - a bar index (`xloc.bar_index`) more than 10,000 bars before the current bar stops the script (runtime error\n * RE10026) in `line.new`, `box.new`, `label.new`, `polyline.new` and the setters of x. The current bar is the one\n * of `eachBar` in a script run; a port with its own bar loop gives it with {@link setDrawingBar}\n *\n * The script API (`executeScript`) resets the registry at the start of every run and applies the\n * `max_*_count` values of `indicator()`. Outside a script run the registry is global to the module.\n *\n * @module drawing/registry\n */\n\nimport type { Box, Label, Line, Linefill, Polyline, Table } from '../types/index.js';\n\nexport type DrawingKind = 'line' | 'label' | 'box' | 'polyline' | 'linefill' | 'table';\n\ninterface DrawingTypes {\n line: Line;\n label: Label;\n box: Box;\n polyline: Polyline;\n linefill: Linefill;\n table: Table;\n}\n\n/** Default `max_lines_count`, `max_labels_count`, `max_boxes_count`, `max_polylines_count`. */\nexport const DEFAULT_MAX_COUNT = 50;\n/** Objects above the maximum that PineScript keeps before it deletes the oldest ones. */\nconst SLACK = 5;\n\nexport type DrawingLimits = Partial<Record<Exclude<DrawingKind, 'linefill' | 'table'>, number>>;\n\nconst live: { [K in DrawingKind]: Array<DrawingTypes[K]> } = {\n line: [],\n label: [],\n box: [],\n polyline: [],\n linefill: [],\n table: [],\n};\nlet limits: Required<DrawingLimits> = {\n line: DEFAULT_MAX_COUNT,\n label: DEFAULT_MAX_COUNT,\n box: DEFAULT_MAX_COUNT,\n polyline: DEFAULT_MAX_COUNT,\n};\nconst deleted = new WeakSet<object>();\n/** Objects held by a `var` variable, with the number of variables that hold them. */\nlet held = new WeakMap<object, number>();\n/** Bar on which the last `var` variable released an object (linefill rule). */\nlet releasedAt = new WeakMap<object, number>();\n/** Bars during which a released linefill is still skipped by the maximum count. */\nconst LINEFILL_RELEASE_BARS = 5000;\n/** Bar on which a `var` variable got an object: the maximum count skips it from the next bar on. */\nlet heldAt = new WeakMap<object, number>();\n/** Kinds with a maximum count of their own. */\ntype CountedKind = 'line' | 'label' | 'box' | 'polyline';\nconst COUNTED_KINDS: readonly CountedKind[] = ['line', 'label', 'box', 'polyline'];\nconst isCounted = (kind: DrawingKind): kind is CountedKind => (COUNTED_KINDS as readonly DrawingKind[]).includes(kind);\n/** `P` of the module notes: objects deleted by the script (for polylines also by the maximum count). */\nlet pending: Record<CountedKind, number> = { line: 0, label: 0, box: 0, polyline: 0 };\n/** A creation sets `P` to 0 from this value on. */\nconst PENDING_RESET: Record<CountedKind, number> = { line: 5, label: 5, box: 5, polyline: 3 };\n\n/**\n * Marks an object as held by a `var` variable (PineScript `var line l = ...` or `l := line.new(...)` on a `var`\n * variable): the maximum count never deletes it, and it still counts. Returns the object.\n */\nexport function holdDrawing<T extends object>(obj: T): T {\n if (!held.has(obj)) {\n if (currentBar === null) heldAt.delete(obj);\n else heldAt.set(obj, currentBar);\n }\n held.set(obj, (held.get(obj) ?? 0) + 1);\n return obj;\n}\n\n/** The `var` variable no longer refers to the object (it got another object or `na`). */\nexport function releaseDrawing(obj: object | null | undefined): void {\n if (!obj) return;\n const count = held.get(obj) ?? 0;\n if (count > 1) held.set(obj, count - 1);\n else if (held.delete(obj) && currentBar !== null) releasedAt.set(obj, currentBar);\n}\n\n/** Held by a `var` variable since a bar before the current one (or outside a bar loop). */\nfunction heldBefore(obj: object): boolean {\n if (!held.has(obj)) return false;\n const bar = heldAt.get(obj);\n return bar === undefined || currentBar === null || bar < currentBar;\n}\n\n/** Linefill rule: held, or released less than 5,000 bars ago. */\nfunction fillProtected(obj: object): boolean {\n if (held.has(obj)) return true;\n const bar = releasedAt.get(obj);\n return bar !== undefined && currentBar !== null && currentBar - bar < LINEFILL_RELEASE_BARS;\n}\n\n/** A `var` variable of a drawing type: see {@link varDrawing}. */\nexport interface DrawingVariable<T extends object> {\n /** The object of the variable; setting it holds the new object and releases the one before */\n value: T | undefined;\n}\n\n/**\n * A PineScript `var` variable of a drawing type (`var line l = na`). The object it refers to is not deleted by the\n * maximum count; assigning another object (or `undefined` for `na`) releases the one before.\n *\n * @example\n * ```typescript\n * // Pine: var line level = na\n * // level := line.new(bar_index, close, bar_index + 1, close)\n * const level = varDrawing<Line>();\n * level.value = line.new(i, close, i + 1, close);\n * ```\n */\nexport function varDrawing<T extends object>(initial?: T): DrawingVariable<T> {\n let current: T | undefined = initial ? holdDrawing(initial) : undefined;\n return {\n get value() {\n return current;\n },\n set value(next: T | undefined) {\n if (next === current) return;\n releaseDrawing(current);\n current = next ? holdDrawing(next) : undefined;\n },\n };\n}\n\n/** Largest distance, in bars, of a bar index before the current bar (PineScript runtime error RE10026 above it). */\nexport const MAX_DRAWING_BARS_BACK = 10000;\n/** Largest distance, in bars, of a bar index after the last bar of the data (PineScript runtime error RE10020 above it). */\nexport const MAX_DRAWING_BARS_FORWARD = 500;\nlet currentBar: number | null = null;\nlet lastBarIndex: number | null = null;\n\n/** Kinds whose allowance on the last bar is the `P` they had when the bar started. */\ntype AllowanceKind = 'line' | 'label' | 'box';\nconst isAllowanceKind = (kind: DrawingKind): kind is AllowanceKind => kind === 'line' || kind === 'label' || kind === 'box';\n\n/** State of the last bar (see the module notes). */\ninterface LastBar {\n bar: number;\n /** The objects alive when the bar started (the objects of the bars before) */\n old: Set<object>;\n /** `P` of lines, labels and boxes when the bar started: their allowance for the whole bar */\n allowance: Record<AllowanceKind, number>;\n /** `P` of polylines when the bar started */\n carried: number;\n /** A polyline was created on this bar */\n polyline: boolean;\n /** Polylines of the bars before deleted on this bar (by the count or by the script) */\n oldPolylinesGone: number;\n}\nlet lastBar: LastBar | null = null;\n\n/**\n * Tells the drawing functions which bar is being calculated (`bar_index`), so that a bar index more than 10,000\n * bars back throws as in PineScript; `null` turns the check off. `eachBar` of the script API calls it.\n *\n * The bar also dates the objects held by a `var` variable (protected from the next bar on). `last` says that it is\n * the last bar of the data, which has rules of its own for the maximum count. `lastIndex` is the bar index of the\n * last bar of the data (PineScript `last_bar_index`): with it, a bar index more than 500 bars after it throws, also\n * on the bars before the last one (RE10020).\n */\nexport function setDrawingBar(barIndex: number | null, last: boolean = false, lastIndex?: number): void {\n if (lastBar && !(last && barIndex === lastBar.bar)) lastBar = null;\n currentBar = barIndex;\n lastBarIndex = barIndex === null ? null : (lastIndex ?? (last ? barIndex : null));\n if (barIndex !== null && last && !lastBar) {\n const start = (kind: AllowanceKind): number => (pending[kind] >= PENDING_RESET[kind] ? 0 : pending[kind]);\n lastBar = {\n bar: barIndex,\n old: new Set<object>([...live.line, ...live.label, ...live.box, ...live.polyline]),\n allowance: { line: start('line'), label: start('label'), box: start('box') },\n carried: pending.polyline,\n polyline: false,\n oldPolylinesGone: 0,\n };\n }\n}\n\n/**\n * Throws the PineScript runtime error RE10026 when `x` is a bar index more than 10,000 bars before the current bar,\n * and RE10020 when it is more than 500 bars after the last bar of the data (when {@link setDrawingBar} knows it).\n * `method` and `variable` are the names of the PineScript message (\"line.new\", \"x1\").\n *\n * Returns `x`, truncated when it is a bar index: PineScript's x is an int (a box from 5537.94 starts on bar 5537,\n * #176).\n */\nexport function checkBarIndex(method: string, variable: string, x: number, xloc: string | undefined): number {\n if ((xloc ?? 'bar_index') !== 'bar_index') return x;\n x = Math.trunc(x);\n if (currentBar === null) return x;\n if (lastBarIndex !== null && x - lastBarIndex > MAX_DRAWING_BARS_FORWARD) {\n throw new Error(\n `Error on bar ${currentBar}: Objects positioned using xloc.bar_index cannot be drawn further than ` +\n `${MAX_DRAWING_BARS_FORWARD} bars into the future.`\n );\n }\n if (currentBar - x > MAX_DRAWING_BARS_BACK) {\n throw new Error(\n `Error on bar ${currentBar}: Bar index value of the \\`${variable}\\` argument (${x}) in \\`${method}()\\` is too far ` +\n 'from the current bar index. Try using `time` instead.'\n );\n }\n return x;\n}\n\n/** Numeric fields that become NaN when an object is deleted, so that its getters return `na`. */\nconst COORDINATES: { [K in DrawingKind]: Array<keyof DrawingTypes[K]> } = {\n line: ['x1', 'y1', 'x2', 'y2'],\n label: ['x', 'y'],\n box: ['left', 'top', 'right', 'bottom'],\n polyline: [],\n linefill: [],\n table: [],\n};\n\nfunction markDeleted<K extends DrawingKind>(kind: K, obj: DrawingTypes[K], explicit: boolean): void {\n deleted.add(obj);\n for (const field of COORDINATES[kind]) (obj as unknown as Record<string, unknown>)[field as string] = NaN;\n if (kind === 'line' && explicit) {\n for (const fill of live.linefill.filter((f) => f.line1 === obj || f.line2 === obj)) remove('linefill', fill);\n }\n}\n\n/** Objects above the maximum that the rule allows for, besides the 5: `P` of the module notes. */\nfunction allowance(kind: DrawingKind): number {\n if (kind === 'polyline') return pending.polyline;\n return lastBar && isAllowanceKind(kind) ? lastBar.allowance[kind] : 0;\n}\n\n/**\n * The maximum count after the creation of `obj`: removes the objects to delete from `list` (the oldest first; the new\n * object and an object held by a `var` variable are skipped and still count) and returns them.\n */\nfunction cutOldest<K extends DrawingKind>(\n kind: K,\n list: Array<DrawingTypes[K]>,\n obj: DrawingTypes[K],\n only?: (old: object) => boolean\n): Array<DrawingTypes[K]> {\n if (kind === 'table') return []; // tables have no maximum count\n const max = limits[kind === 'linefill' ? 'line' : (kind as keyof DrawingLimits)] + allowance(kind);\n if (list.length <= max + SLACK) return [];\n const kept: Array<DrawingTypes[K]> = [];\n const cut: Array<DrawingTypes[K]> = [];\n let excess = list.length - max;\n for (const old of list) {\n if (excess > 0 && old !== obj && (!only || only(old)) && !(kind === 'linefill' ? fillProtected(old) : heldBefore(old))) {\n excess--;\n cut.push(old);\n } else kept.push(old);\n }\n // linefills: still above the maximum + 5, the oldest go, the held ones too\n if (kind === 'linefill' && kept.length > max + SLACK) cut.push(...kept.splice(0, kept.length - max));\n list.length = 0;\n list.push(...kept);\n return cut;\n}\n\n/** Records a new object and deletes the oldest objects of its kind when the count is too high. */\nexport function register<K extends DrawingKind>(kind: K, obj: DrawingTypes[K]): DrawingTypes[K] {\n const list = live[kind];\n if (lastBar && isCounted(kind)) return registerLast(lastBar, kind, obj);\n if (isCounted(kind) && pending[kind] >= PENDING_RESET[kind]) pending[kind] = 0;\n list.push(obj);\n const cut = cutOldest(kind, list, obj);\n if (kind === 'polyline') pending.polyline += cut.length;\n for (const old of cut) markDeleted(kind, old, false);\n return obj;\n}\n\n/** An object created on the last bar (see the module notes). */\nfunction registerLast<K extends DrawingKind>(bar: LastBar, kind: K, obj: DrawingTypes[K]): DrawingTypes[K] {\n if (kind === 'polyline' && !bar.polyline) {\n bar.polyline = true;\n if (pending.polyline >= PENDING_RESET.polyline) pending.polyline = 0;\n else pending.polyline += bar.carried; // counted twice\n }\n const list = live[kind];\n list.push(obj);\n const isOld = (old: object): boolean => bar.old.has(old);\n if (list.some((old) => old !== obj && isOld(old) && !heldBefore(old))) {\n // the objects of the bars before only; a line takes its linefills with it\n const cut = cutOldest(kind, list, obj, isOld);\n if (kind === 'polyline') {\n pending.polyline += cut.length;\n bar.oldPolylinesGone += cut.length;\n }\n for (const old of cut) markDeleted(kind, old, true);\n } else {\n // the polylines of the bars before deleted on this bar count before the cut (#176)\n if (kind === 'polyline' && pending.polyline < bar.oldPolylinesGone) pending.polyline = bar.oldPolylinesGone;\n const cut = cutOldest(kind, list, obj);\n if (kind === 'polyline' && cut.length > 0) pending.polyline = bar.oldPolylinesGone;\n for (const old of cut) markDeleted(kind, old, false);\n }\n return obj;\n}\n\n/** Deletes an object (no effect when it is already deleted). */\nexport function remove<K extends DrawingKind>(kind: K, obj: DrawingTypes[K]): void {\n const list = live[kind];\n const index = list.indexOf(obj);\n if (index !== -1) {\n list.splice(index, 1);\n if (isCounted(kind)) pending[kind]++;\n if (kind === 'polyline' && lastBar?.old.has(obj)) lastBar.oldPolylinesGone++;\n }\n if (!deleted.has(obj)) markDeleted(kind, obj, true);\n}\n\n/** True when the object was deleted (by `delete` or by the maximum count). */\nexport function isDeleted(obj: unknown): boolean {\n return typeof obj === 'object' && obj !== null && deleted.has(obj);\n}\n\n/** The live objects of a kind, in creation order (a new array). */\nexport function all<K extends DrawingKind>(kind: K): Array<DrawingTypes[K]> {\n return [...live[kind]] as Array<DrawingTypes[K]>;\n}\n\n/** Forgets all objects (without deleting them) and sets the maximum counts (default 50). */\nexport function resetDrawings(newLimits: DrawingLimits = {}): void {\n for (const kind of Object.keys(live) as DrawingKind[]) live[kind].length = 0;\n held = new WeakMap();\n releasedAt = new WeakMap();\n heldAt = new WeakMap();\n pending = { line: 0, label: 0, box: 0, polyline: 0 };\n currentBar = null;\n lastBarIndex = null;\n lastBar = null;\n limits = {\n line: newLimits.line ?? DEFAULT_MAX_COUNT,\n label: newLimits.label ?? DEFAULT_MAX_COUNT,\n box: newLimits.box ?? DEFAULT_MAX_COUNT,\n polyline: newLimits.polyline ?? DEFAULT_MAX_COUNT,\n };\n}\n\n/** Changes the maximum counts without forgetting the objects (PineScript `indicator(max_*_count)`). */\nexport function setDrawingLimits(newLimits: DrawingLimits): void {\n limits = { ...limits, ...Object.fromEntries(Object.entries(newLimits).filter(([, v]) => v !== undefined)) };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmEO,MAAM,oBAAoB;AAEjC,MAAM,QAAQ;AAId,MAAM,OAAuD;AAAA,EAC3D,MAAM,CAAC;AAAA,EACP,OAAO,CAAC;AAAA,EACR,KAAK,CAAC;AAAA,EACN,UAAU,CAAC;AAAA,EACX,UAAU,CAAC;AAAA,EACX,OAAO,CAAC;AACV;AACA,IAAI,SAAkC;AAAA,EACpC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,KAAK;AAAA,EAC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AA,IAC1B,KAAK,UAAU,OAAO;AAAA,IACtB,UAAU,UAAU,YAAY;AAAA,EAClC;AACF;AAGO,SAAS,iBAAiB,WAAgC;AAC/D,WAAS,EAAE,GAAG,QAAQ,GAAG,OAAO,YAAY,OAAO,QAAQ,SAAS,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,MAAM,MAAM,MAAS,CAAC,EAAE;AAC5G;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -35,6 +35,12 @@ import * as callsite from './callsite/index.js';
|
|
|
35
35
|
export { taCore, math, array, map, str, color, time, timeframe, matrix, line, box, label, linefill, chartPoint, polyline, table, text, compare, callsite };
|
|
36
36
|
export { drawingOutputs, type DrawingOutputs } from './drawing/output.js';
|
|
37
37
|
export { barInterval, barTime } from './drawing/bar-time.js';
|
|
38
|
+
export { resetDrawings, setDrawingLimits, setDrawingBar, holdDrawing, releaseDrawing, varDrawing, type DrawingLimits, type DrawingVariable, } from './drawing/registry.js';
|
|
39
|
+
export { chartSessions, periodTime, periodClose, tradingDayTime, chartSessionFlags, resampleSession, barTimeAfter, barsUntil, type SessionContext, type ChartSessions, type SessionResample, } from './session/context.js';
|
|
40
|
+
export { TradingCalendar, type SessionSpec } from './session/calendar.js';
|
|
41
|
+
export { SessionBars, sessionFlags, type SessionFlags } from './session/bars.js';
|
|
42
|
+
export { resample, periodsOf, afterCompletion, mapToChart, heikinAshi, type Resampled } from './security/resample.js';
|
|
43
|
+
export { securityOther, securityOtherValues, securityLowerTf, type OtherSymbolChart, type OtherSymbolOptions, type SymbolCalendar, } from './security/other.js';
|
|
38
44
|
export { Series, BarData } from './runtime/series.js';
|
|
39
45
|
export type { SeriesExtractor } from './runtime/series.js';
|
|
40
46
|
import * as ta from './ta-series.js';
|
|
@@ -50,7 +56,7 @@ export { indicator, type IndicatorMetadataConfig, type InputDefinition, type Ind
|
|
|
50
56
|
export { input, type InputValue, type IntInputOptions, type FloatInputOptions, type SourceInputOptions, type BoolInputOptions, type StringInputOptions, type TimeInputOptions, type SourceType, } from './input.js';
|
|
51
57
|
export { plot as plotHelper, createPlot, type Time, type TimeValuePair, type PlotOptions as PlotHelperOptions, type PlotResult, } from './plot.js';
|
|
52
58
|
export { setContext, clearContext, getContext, registerCalculate, recalculate, plot, hline, clearPlots, } from './runtime/runtime.js';
|
|
53
|
-
export { input_int, input_float, input_bool, input_string, input_source, input_timeframe, input_session, input_time, } from './runtime/inputs.js';
|
|
59
|
+
export { input_int, input_float, input_bool, input_string, input_source, input_timeframe, input_session, input_symbol, input_time, } from './runtime/inputs.js';
|
|
54
60
|
export { isInputActive } from './runtime/input-active.js';
|
|
55
61
|
export type { OakScriptContext, ChartAdapter, InputAdapter, SeriesHandle, SeriesOptions, InputConfig, InputCondition, InputOptions, OhlcvData, PlotConfig, HLineConfig, FillConfig, ArrowConfig, CandleConfig, } from './runtime/types.js';
|
|
56
62
|
export { STRATEGY_CONSTANTS, STRATEGY_DEFAULTS, STRATEGY_NUMBER_VARIABLES, STRATEGY_TEXT_VARIABLES, } from './strategy/index.js';
|
|
@@ -58,7 +64,7 @@ export type * from './strategy/index.js';
|
|
|
58
64
|
export { LightweightChartsAdapter } from './runtime/adapters/LightweightChartsAdapter.js';
|
|
59
65
|
export type { LightweightSeriesDefinitions } from './runtime/adapters/LightweightChartsAdapter.js';
|
|
60
66
|
export { SimpleInputAdapter } from './runtime/adapters/SimpleInputAdapter.js';
|
|
61
|
-
export declare const VERSION = "0.
|
|
67
|
+
export declare const VERSION = "0.11.1";
|
|
62
68
|
/**
|
|
63
69
|
* Library information
|
|
64
70
|
*/
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AAGpC,OAAO,KAAK,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C;AAG9E,eAAO,MAAM,OAAO,WAAW,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;CAiBhB,CAAC;AAKF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAE5F"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -36,9 +36,12 @@ __export(index_exports, {
|
|
|
36
36
|
STRATEGY_NUMBER_VARIABLES: () => import_strategy.STRATEGY_NUMBER_VARIABLES,
|
|
37
37
|
STRATEGY_TEXT_VARIABLES: () => import_strategy.STRATEGY_TEXT_VARIABLES,
|
|
38
38
|
Series: () => import_series.Series,
|
|
39
|
+
SessionBars: () => import_bars.SessionBars,
|
|
39
40
|
SimpleInputAdapter: () => import_SimpleInputAdapter.SimpleInputAdapter,
|
|
41
|
+
TradingCalendar: () => import_calendar.TradingCalendar,
|
|
40
42
|
VERSION: () => VERSION,
|
|
41
43
|
abs: () => import_math.abs,
|
|
44
|
+
afterCompletion: () => import_resample.afterCompletion,
|
|
42
45
|
alertcondition: () => alertcondition,
|
|
43
46
|
array: () => array,
|
|
44
47
|
at: () => import_utils.at,
|
|
@@ -46,12 +49,16 @@ __export(index_exports, {
|
|
|
46
49
|
avg: () => import_math.avg,
|
|
47
50
|
barInterval: () => import_bar_time.barInterval,
|
|
48
51
|
barTime: () => import_bar_time.barTime,
|
|
52
|
+
barTimeAfter: () => import_context.barTimeAfter,
|
|
53
|
+
barsUntil: () => import_context.barsUntil,
|
|
49
54
|
bb: () => import_ta_series.bb,
|
|
50
55
|
box: () => box,
|
|
51
56
|
callsite: () => callsite,
|
|
52
57
|
ceil: () => import_math.ceil,
|
|
53
58
|
change: () => import_ta_series.change,
|
|
54
59
|
chartPoint: () => chartPoint,
|
|
60
|
+
chartSessionFlags: () => import_context.chartSessionFlags,
|
|
61
|
+
chartSessions: () => import_context.chartSessions,
|
|
55
62
|
clearContext: () => import_runtime.clearContext,
|
|
56
63
|
clearPlots: () => import_runtime.clearPlots,
|
|
57
64
|
color: () => color,
|
|
@@ -75,7 +82,9 @@ __export(index_exports, {
|
|
|
75
82
|
getOpen: () => import_utils.getOpen,
|
|
76
83
|
getSource: () => import_utils.getSource,
|
|
77
84
|
getSourceSeries: () => import_utils.getSourceSeries,
|
|
85
|
+
heikinAshi: () => import_resample.heikinAshi,
|
|
78
86
|
hline: () => import_runtime.hline,
|
|
87
|
+
holdDrawing: () => import_registry.holdDrawing,
|
|
79
88
|
indicator: () => import_indicator.indicator,
|
|
80
89
|
info: () => info,
|
|
81
90
|
input: () => import_input.input,
|
|
@@ -85,6 +94,7 @@ __export(index_exports, {
|
|
|
85
94
|
input_session: () => import_inputs.input_session,
|
|
86
95
|
input_source: () => import_inputs.input_source,
|
|
87
96
|
input_string: () => import_inputs.input_string,
|
|
97
|
+
input_symbol: () => import_inputs.input_symbol,
|
|
88
98
|
input_time: () => import_inputs.input_time,
|
|
89
99
|
input_timeframe: () => import_inputs.input_timeframe,
|
|
90
100
|
isInputActive: () => import_input_active.isInputActive,
|
|
@@ -94,6 +104,7 @@ __export(index_exports, {
|
|
|
94
104
|
log: () => import_math.log,
|
|
95
105
|
macd: () => import_ta_series.macd,
|
|
96
106
|
map: () => map,
|
|
107
|
+
mapToChart: () => import_resample.mapToChart,
|
|
97
108
|
math: () => math,
|
|
98
109
|
matrix: () => matrix,
|
|
99
110
|
max: () => import_math.max,
|
|
@@ -102,16 +113,29 @@ __export(index_exports, {
|
|
|
102
113
|
new_color: () => import_color.new_color,
|
|
103
114
|
nz: () => import_utils2.nz,
|
|
104
115
|
ohlcFromBars: () => import_utils.ohlcFromBars,
|
|
116
|
+
periodClose: () => import_context.periodClose,
|
|
117
|
+
periodTime: () => import_context.periodTime,
|
|
118
|
+
periodsOf: () => import_resample.periodsOf,
|
|
105
119
|
plot: () => import_runtime.plot,
|
|
106
120
|
plotHelper: () => import_plot.plot,
|
|
107
121
|
polyline: () => polyline,
|
|
108
122
|
pow: () => import_math.pow,
|
|
109
123
|
recalculate: () => import_runtime.recalculate,
|
|
110
124
|
registerCalculate: () => import_runtime.registerCalculate,
|
|
125
|
+
releaseDrawing: () => import_registry.releaseDrawing,
|
|
126
|
+
resample: () => import_resample.resample,
|
|
127
|
+
resampleSession: () => import_context.resampleSession,
|
|
128
|
+
resetDrawings: () => import_registry.resetDrawings,
|
|
111
129
|
rgb: () => import_color.rgb,
|
|
112
130
|
round: () => import_math.round,
|
|
113
131
|
rsi: () => import_ta_series.rsi,
|
|
132
|
+
securityLowerTf: () => import_other.securityLowerTf,
|
|
133
|
+
securityOther: () => import_other.securityOther,
|
|
134
|
+
securityOtherValues: () => import_other.securityOtherValues,
|
|
135
|
+
sessionFlags: () => import_bars.sessionFlags,
|
|
114
136
|
setContext: () => import_runtime.setContext,
|
|
137
|
+
setDrawingBar: () => import_registry.setDrawingBar,
|
|
138
|
+
setDrawingLimits: () => import_registry.setDrawingLimits,
|
|
115
139
|
sin: () => import_math.sin,
|
|
116
140
|
sma: () => import_ta_series.sma,
|
|
117
141
|
sqrt: () => import_math.sqrt,
|
|
@@ -126,6 +150,8 @@ __export(index_exports, {
|
|
|
126
150
|
time: () => time,
|
|
127
151
|
timeframe: () => timeframe,
|
|
128
152
|
tr: () => import_ta_series.tr,
|
|
153
|
+
tradingDayTime: () => import_context.tradingDayTime,
|
|
154
|
+
varDrawing: () => import_registry.varDrawing,
|
|
129
155
|
vwap: () => import_ta_series.vwap
|
|
130
156
|
});
|
|
131
157
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -152,6 +178,12 @@ var compare = __toESM(require("./compare/index.js"), 1);
|
|
|
152
178
|
var callsite = __toESM(require("./callsite/index.js"), 1);
|
|
153
179
|
var import_output = require("./drawing/output.js");
|
|
154
180
|
var import_bar_time = require("./drawing/bar-time.js");
|
|
181
|
+
var import_registry = require("./drawing/registry.js");
|
|
182
|
+
var import_context = require("./session/context.js");
|
|
183
|
+
var import_calendar = require("./session/calendar.js");
|
|
184
|
+
var import_bars = require("./session/bars.js");
|
|
185
|
+
var import_resample = require("./security/resample.js");
|
|
186
|
+
var import_other = require("./security/other.js");
|
|
155
187
|
var import_series = require("./runtime/series.js");
|
|
156
188
|
var ta = __toESM(require("./ta-series.js"), 1);
|
|
157
189
|
var import_ta_series = require("./ta-series.js");
|
|
@@ -169,7 +201,7 @@ var import_input_active = require("./runtime/input-active.js");
|
|
|
169
201
|
var import_strategy = require("./strategy/index.js");
|
|
170
202
|
var import_LightweightChartsAdapter = require("./runtime/adapters/LightweightChartsAdapter.js");
|
|
171
203
|
var import_SimpleInputAdapter = require("./runtime/adapters/SimpleInputAdapter.js");
|
|
172
|
-
const VERSION = "0.
|
|
204
|
+
const VERSION = "0.11.1";
|
|
173
205
|
const info = {
|
|
174
206
|
name: "OakScriptJS",
|
|
175
207
|
version: VERSION,
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * OakScriptJS - Simplified PineScript-like library for JavaScript\n *\n * This library provides Series-based lazy evaluation and technical analysis functions\n * for building trading indicators. The PineScript-style script API is in `oakscriptjs/script`.\n *\n * Key features:\n * - Series class for lazy evaluation and method chaining\n * - Core TA functions (array-based)\n * - TA-Series wrappers (Series-based)\n *\n * @packageDocumentation\n */\n\n// Export all types\nexport * from './types/index.js';\nexport * from './types/metadata.js';\n\n// Export core namespaces (array-based functions)\nimport * as taCore from './ta/index.js';\nimport * as math from './math/index.js';\nimport * as array from './array/index.js';\nimport * as map from './map/index.js';\nimport * as str from './str/index.js';\nimport * as color from './color/index.js';\nimport * as time from './time/index.js';\nimport * as timeframe from './timeframe/index.js';\nimport * as matrix from './matrix/index.js';\nimport * as line from './line/index.js';\nimport * as box from './box/index.js';\nimport * as label from './label/index.js';\nimport * as linefill from './linefill/index.js';\nimport * as chartPoint from './chartpoint/index.js';\nimport * as polyline from './polyline/index.js';\nimport * as table from './table/index.js';\nimport * as text from './text/index.js';\nimport * as compare from './compare/index.js';\nimport * as callsite from './callsite/index.js';\n\nexport { taCore, math, array, map, str, color, time, timeframe, matrix, line, box, label, linefill, chartPoint, polyline, table, text, compare, callsite };\n\n// Renderable drawings (IndicatorResult labels, lines, boxes, linefills, polylines, tables) and future bar times\nexport { drawingOutputs, type DrawingOutputs } from './drawing/output.js';\nexport { barInterval, barTime } from './drawing/bar-time.js';\n\n// Export Series class (self-contained, no context)\nexport { Series, BarData } from './runtime/series.js';\nexport type { SeriesExtractor } from './runtime/series.js';\n\n// Export TA-Series namespace (Series-based wrappers)\nimport * as ta from './ta-series.js';\nexport { ta };\n\n// Export metadata types for indicator return values\nexport type {\n PlotOptions,\n HLineOptions,\n FillOptions,\n InputMetadata,\n PlotMetadata,\n IndicatorMetadata,\n TimeValue,\n PlotData,\n HLineData,\n FillData,\n FillGradient,\n IndicatorResult,\n IndicatorFactory,\n PlotStyle,\n LineStyle,\n PlotDisplay,\n InputType\n} from './types/metadata.js';\n\n// Re-export commonly used functions for convenience\nexport { sma, ema, rsi, macd, bb, stdev, crossover, crossunder, change, tr, atr, cum, vwap } from './ta-series.js';\nexport { abs, ceil, floor, round, max, min, avg, sum, sqrt, pow, exp, log, sin, cos, tan } from './math/index.js';\nexport { rgb, from_hex as color_from_hex, new_color } from './color/index.js';\n\n// Export chart data utilities\nexport { ohlcFromBars, getClose, getHigh, getLow, getOpen, getSource, getSourceSeries, at, div } from './utils/index.js';\n\n// Export libraries (ZigZag, etc.)\nexport * from './lib/index.js';\n\n// Export helper functions for generated indicators (PineScript compatibility)\nexport {isNA as na, nz, fixnan} from './utils/index.js';\n\n// Export indicator infrastructure\nexport {\n indicator,\n type IndicatorMetadataConfig,\n type InputDefinition,\n type IndicatorContext,\n type IndicatorInstance,\n type IndicatorConstructor,\n} from './indicator.js';\n\nexport {\n input,\n type InputValue,\n type IntInputOptions,\n type FloatInputOptions,\n type SourceInputOptions,\n type BoolInputOptions,\n type StringInputOptions,\n type TimeInputOptions,\n type SourceType,\n} from './input.js';\n\nexport {\n plot as plotHelper,\n createPlot,\n type Time,\n type TimeValuePair,\n type PlotOptions as PlotHelperOptions,\n type PlotResult,\n} from './plot.js';\n\n// Runtime exports - global context runtime (setContext, plot, hline) drawing through a ChartAdapter\nexport {\n setContext,\n clearContext,\n getContext,\n registerCalculate,\n recalculate,\n plot,\n hline,\n clearPlots,\n} from './runtime/runtime.js';\n\nexport {\n input_int,\n input_float,\n input_bool,\n input_string,\n input_source,\n input_timeframe,\n input_session,\n input_time,\n} from './runtime/inputs.js';\nexport { isInputActive } from './runtime/input-active.js';\n\nexport type {\n OakScriptContext,\n ChartAdapter,\n InputAdapter,\n SeriesHandle,\n SeriesOptions,\n InputConfig,\n InputCondition,\n InputOptions,\n OhlcvData,\n PlotConfig,\n HLineConfig,\n FillConfig,\n ArrowConfig,\n CandleConfig,\n} from './runtime/types.js';\n\n// Strategy types and constants (the script API forwards strategy.* calls to a host engine)\nexport {\n STRATEGY_CONSTANTS,\n STRATEGY_DEFAULTS,\n STRATEGY_NUMBER_VARIABLES,\n STRATEGY_TEXT_VARIABLES,\n} from './strategy/index.js';\nexport type * from './strategy/index.js';\n\nexport { LightweightChartsAdapter } from './runtime/adapters/LightweightChartsAdapter.js';\nexport type { LightweightSeriesDefinitions } from './runtime/adapters/LightweightChartsAdapter.js';\nexport { SimpleInputAdapter } from './runtime/adapters/SimpleInputAdapter.js';\n\n// Version\nexport const VERSION = '0.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,0BAAc,6BAfd;AAgBA,0BAAc,gCAhBd;AAmBA,aAAwB;AACxB,WAAsB;AACtB,YAAuB;AACvB,UAAqB;AACrB,UAAqB;AACrB,YAAuB;AACvB,WAAsB;AACtB,gBAA2B;AAC3B,aAAwB;AACxB,WAAsB;AACtB,UAAqB;AACrB,YAAuB;AACvB,eAA0B;AAC1B,iBAA4B;AAC5B,eAA0B;AAC1B,YAAuB;AACvB,WAAsB;AACtB,cAAyB;AACzB,eAA0B;AAK1B,oBAAoD;AACpD,sBAAqC;AAGrC,oBAAgC;AAIhC,SAAoB;AAyBpB,uBAAkG;AAClG,kBAAgG;AAChG,mBAA2D;AAG3D,mBAAsG;AAGtG,0BAAc,
|
|
4
|
+
"sourcesContent": ["/**\n * OakScriptJS - Simplified PineScript-like library for JavaScript\n *\n * This library provides Series-based lazy evaluation and technical analysis functions\n * for building trading indicators. The PineScript-style script API is in `oakscriptjs/script`.\n *\n * Key features:\n * - Series class for lazy evaluation and method chaining\n * - Core TA functions (array-based)\n * - TA-Series wrappers (Series-based)\n *\n * @packageDocumentation\n */\n\n// Export all types\nexport * from './types/index.js';\nexport * from './types/metadata.js';\n\n// Export core namespaces (array-based functions)\nimport * as taCore from './ta/index.js';\nimport * as math from './math/index.js';\nimport * as array from './array/index.js';\nimport * as map from './map/index.js';\nimport * as str from './str/index.js';\nimport * as color from './color/index.js';\nimport * as time from './time/index.js';\nimport * as timeframe from './timeframe/index.js';\nimport * as matrix from './matrix/index.js';\nimport * as line from './line/index.js';\nimport * as box from './box/index.js';\nimport * as label from './label/index.js';\nimport * as linefill from './linefill/index.js';\nimport * as chartPoint from './chartpoint/index.js';\nimport * as polyline from './polyline/index.js';\nimport * as table from './table/index.js';\nimport * as text from './text/index.js';\nimport * as compare from './compare/index.js';\nimport * as callsite from './callsite/index.js';\n\nexport { taCore, math, array, map, str, color, time, timeframe, matrix, line, box, label, linefill, chartPoint, polyline, table, text, compare, callsite };\n\n// Renderable drawings (IndicatorResult labels, lines, boxes, linefills, polylines, tables) and future bar times\nexport { drawingOutputs, type DrawingOutputs } from './drawing/output.js';\nexport { barInterval, barTime } from './drawing/bar-time.js';\n\n// Drawing registry limits (PineScript indicator(max_lines_count / max_labels_count / max_boxes_count / max_polylines_count))\nexport {\n resetDrawings,\n setDrawingLimits,\n setDrawingBar,\n holdDrawing,\n releaseDrawing,\n varDrawing,\n type DrawingLimits,\n type DrawingVariable,\n} from './drawing/registry.js';\n\n// The session of a chart context without a script run: time(tf), time_close(tf), time_tradingday, session.* flags,\n// request.security periods with the session and holidays, and bars after the last bar on the trading calendar\nexport {\n chartSessions,\n periodTime,\n periodClose,\n tradingDayTime,\n chartSessionFlags,\n resampleSession,\n barTimeAfter,\n barsUntil,\n type SessionContext,\n type ChartSessions,\n type SessionResample,\n} from './session/context.js';\nexport { TradingCalendar, type SessionSpec } from './session/calendar.js';\nexport { SessionBars, sessionFlags, type SessionFlags } from './session/bars.js';\n\n// Same-symbol request.security on a higher timeframe (completion and lookahead rules) and ticker.heikinashi\nexport { resample, periodsOf, afterCompletion, mapToChart, heikinAshi, type Resampled } from './security/resample.js';\n// request.security of another symbol: which bar of the other symbol each chart bar shows (#179)\nexport {\n securityOther,\n securityOtherValues,\n securityLowerTf,\n type OtherSymbolChart,\n type OtherSymbolOptions,\n type SymbolCalendar,\n} from './security/other.js';\n\n// Export Series class (self-contained, no context)\nexport { Series, BarData } from './runtime/series.js';\nexport type { SeriesExtractor } from './runtime/series.js';\n\n// Export TA-Series namespace (Series-based wrappers)\nimport * as ta from './ta-series.js';\nexport { ta };\n\n// Export metadata types for indicator return values\nexport type {\n PlotOptions,\n HLineOptions,\n FillOptions,\n InputMetadata,\n PlotMetadata,\n IndicatorMetadata,\n TimeValue,\n PlotData,\n HLineData,\n FillData,\n FillGradient,\n IndicatorResult,\n IndicatorFactory,\n PlotStyle,\n LineStyle,\n PlotDisplay,\n InputType\n} from './types/metadata.js';\n\n// Re-export commonly used functions for convenience\nexport { sma, ema, rsi, macd, bb, stdev, crossover, crossunder, change, tr, atr, cum, vwap } from './ta-series.js';\nexport { abs, ceil, floor, round, max, min, avg, sum, sqrt, pow, exp, log, sin, cos, tan } from './math/index.js';\nexport { rgb, from_hex as color_from_hex, new_color } from './color/index.js';\n\n// Export chart data utilities\nexport { ohlcFromBars, getClose, getHigh, getLow, getOpen, getSource, getSourceSeries, at, div } from './utils/index.js';\n\n// Export libraries (ZigZag, etc.)\nexport * from './lib/index.js';\n\n// Export helper functions for generated indicators (PineScript compatibility)\nexport {isNA as na, nz, fixnan} from './utils/index.js';\n\n// Export indicator infrastructure\nexport {\n indicator,\n type IndicatorMetadataConfig,\n type InputDefinition,\n type IndicatorContext,\n type IndicatorInstance,\n type IndicatorConstructor,\n} from './indicator.js';\n\nexport {\n input,\n type InputValue,\n type IntInputOptions,\n type FloatInputOptions,\n type SourceInputOptions,\n type BoolInputOptions,\n type StringInputOptions,\n type TimeInputOptions,\n type SourceType,\n} from './input.js';\n\nexport {\n plot as plotHelper,\n createPlot,\n type Time,\n type TimeValuePair,\n type PlotOptions as PlotHelperOptions,\n type PlotResult,\n} from './plot.js';\n\n// Runtime exports - global context runtime (setContext, plot, hline) drawing through a ChartAdapter\nexport {\n setContext,\n clearContext,\n getContext,\n registerCalculate,\n recalculate,\n plot,\n hline,\n clearPlots,\n} from './runtime/runtime.js';\n\nexport {\n input_int,\n input_float,\n input_bool,\n input_string,\n input_source,\n input_timeframe,\n input_session,\n input_symbol,\n input_time,\n} from './runtime/inputs.js';\nexport { isInputActive } from './runtime/input-active.js';\n\nexport type {\n OakScriptContext,\n ChartAdapter,\n InputAdapter,\n SeriesHandle,\n SeriesOptions,\n InputConfig,\n InputCondition,\n InputOptions,\n OhlcvData,\n PlotConfig,\n HLineConfig,\n FillConfig,\n ArrowConfig,\n CandleConfig,\n} from './runtime/types.js';\n\n// Strategy types and constants (the script API forwards strategy.* calls to a host engine)\nexport {\n STRATEGY_CONSTANTS,\n STRATEGY_DEFAULTS,\n STRATEGY_NUMBER_VARIABLES,\n STRATEGY_TEXT_VARIABLES,\n} from './strategy/index.js';\nexport type * from './strategy/index.js';\n\nexport { LightweightChartsAdapter } from './runtime/adapters/LightweightChartsAdapter.js';\nexport type { LightweightSeriesDefinitions } from './runtime/adapters/LightweightChartsAdapter.js';\nexport { SimpleInputAdapter } from './runtime/adapters/SimpleInputAdapter.js';\n\n// Version\nexport const VERSION = '0.11.1';\n\n/**\n * Library information\n */\nexport const info = {\n name: 'OakScriptJS',\n version: VERSION,\n description: 'Simplified PineScript-like library - Series + TA functions',\n features: {\n series: 'Lazy evaluation with Series class',\n ta: 'Technical analysis functions (Series and array-based)',\n script: 'PineScript-style script API (oakscriptjs/script): indicator, strategy, inputs, plots, request.security',\n runtime: 'Global context runtime drawing through a ChartAdapter',\n indicator: 'Indicator function with automatic pane management'\n },\n namespaces: {\n core: ['ta', 'math', 'array', 'map', 'str', 'color', 'time', 'timeframe', 'matrix'],\n drawing: ['line', 'box', 'label', 'linefill', 'chartPoint', 'polyline', 'table', 'text'],\n runtime: ['setContext', 'plot', 'hline', 'input_*'],\n indicator: ['indicator', 'input', 'plotHelper', 'createPlot']\n }\n};\n\n// PineScript compatibility stubs - functions that have no runtime effect\n// These are no-ops so that PineScript-style code runs without modification\n\n/**\n * alertcondition() - Stub for PineScript alert configuration\n * In PineScript, this registers an alert condition. In oakscriptjs, it's a no-op\n * since alert configuration is handled by the host application.\n */\nexport function alertcondition(_condition: unknown, _title?: string, _message?: string): void {\n // No-op: Alert conditions are handled by the host application\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,0BAAc,6BAfd;AAgBA,0BAAc,gCAhBd;AAmBA,aAAwB;AACxB,WAAsB;AACtB,YAAuB;AACvB,UAAqB;AACrB,UAAqB;AACrB,YAAuB;AACvB,WAAsB;AACtB,gBAA2B;AAC3B,aAAwB;AACxB,WAAsB;AACtB,UAAqB;AACrB,YAAuB;AACvB,eAA0B;AAC1B,iBAA4B;AAC5B,eAA0B;AAC1B,YAAuB;AACvB,WAAsB;AACtB,cAAyB;AACzB,eAA0B;AAK1B,oBAAoD;AACpD,sBAAqC;AAGrC,sBASO;AAIP,qBAYO;AACP,sBAAkD;AAClD,kBAA6D;AAG7D,sBAA6F;AAE7F,mBAOO;AAGP,oBAAgC;AAIhC,SAAoB;AAyBpB,uBAAkG;AAClG,kBAAgG;AAChG,mBAA2D;AAG3D,mBAAsG;AAGtG,0BAAc,2BA7Hd;AAgIA,IAAAA,gBAAqC;AAGrC,uBAOO;AAEP,mBAUO;AAEP,kBAOO;AAGP,qBASO;AAEP,oBAUO;AACP,0BAA8B;AAoB9B,sBAKO;AAGP,sCAAyC;AAEzC,gCAAmC;AAG5B,MAAM,UAAU;AAKhB,MAAM,OAAO;AAAA,EAClB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,aAAa;AAAA,EACb,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,WAAW;AAAA,EACb;AAAA,EACA,YAAY;AAAA,IACV,MAAM,CAAC,MAAM,QAAQ,SAAS,OAAO,OAAO,SAAS,QAAQ,aAAa,QAAQ;AAAA,IAClF,SAAS,CAAC,QAAQ,OAAO,SAAS,YAAY,cAAc,YAAY,SAAS,MAAM;AAAA,IACvF,SAAS,CAAC,cAAc,QAAQ,SAAS,SAAS;AAAA,IAClD,WAAW,CAAC,aAAa,SAAS,cAAc,YAAY;AAAA,EAC9D;AACF;AAUO,SAAS,eAAe,YAAqB,QAAiB,UAAyB;AAE9F;",
|
|
6
6
|
"names": ["import_utils"]
|
|
7
7
|
}
|
package/dist/cjs/input.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export interface InputValue<T> {
|
|
10
10
|
/** Input type identifier */
|
|
11
|
-
type: 'int' | 'float' | 'source' | 'bool' | 'string' | 'timeframe' | 'session' | 'time';
|
|
11
|
+
type: 'int' | 'float' | 'source' | 'bool' | 'string' | 'timeframe' | 'session' | 'time' | 'symbol';
|
|
12
12
|
/** Default value */
|
|
13
13
|
defaultValue: T;
|
|
14
14
|
/** Current value (initially equals defaultValue) */
|
|
@@ -179,6 +179,14 @@ export declare const input: {
|
|
|
179
179
|
* ```
|
|
180
180
|
*/
|
|
181
181
|
session(defaultValue: string, options?: StringInputOptions): InputValue<string>;
|
|
182
|
+
/**
|
|
183
|
+
* Create a symbol input parameter (PineScript `input.symbol`): a ticker id ("NASDAQ:MSFT") that an application can
|
|
184
|
+
* edit with a symbol picker (#180)
|
|
185
|
+
* @param defaultValue - Default ticker id
|
|
186
|
+
* @param options - Additional options (title, options for dropdown)
|
|
187
|
+
* @returns Input value object
|
|
188
|
+
*/
|
|
189
|
+
symbol(defaultValue: string, options?: StringInputOptions): InputValue<string>;
|
|
182
190
|
/**
|
|
183
191
|
* Create a date/time input parameter (PineScript `input.time`)
|
|
184
192
|
* @param defaultValue - Default UNIX time in milliseconds, e.g. `time.timestamp('2024-01-01')`
|
package/dist/cjs/input.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/input.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,4BAA4B;IAC5B,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/input.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,4BAA4B;IAC5B,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IACnG,oBA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AE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhG;;GAEG;AACH,eAAO,MAAM,KAAK;IAChB;;;;;;;;;;;OAWG;sBACe,MAAM,YAAW,eAAe,GAAQ,UAAU,CAAC,MAAM,CAAC;IAY5E;;;;;;;;;;;OAWG;wBACiB,MAAM,YAAW,iBAAiB,GAAQ,UAAU,CAAC,MAAM,CAAC;IAYhF;;;;;;;;;;;OAWG;0BACkB,UAAU,YAAqB,kBAAkB,GAAQ,UAAU,CAAC,UAAU,CAAC;IAUpG;;;;;;;;;;;OAWG;uBACgB,OAAO,YAAW,gBAAgB,GAAQ,UAAU,CAAC,OAAO,CAAC;IAShF;;;;;;;;;;;OAWG;yBACkB,MAAM,YAAW,kBAAkB,GAAQ,UAAU,CAAC,MAAM,CAAC;IAUlF;;;;;;;;;;;OAWG;4BACqB,MAAM,YAAW,kBAAkB,GAAQ,UAAU,CAAC,MAAM,CAAC;IAUrF;;;;;;;;;;;OAWG;0BACmB,MAAM,YAAW,kBAAkB,GAAQ,UAAU,CAAC,MAAM,CAAC;IAUnF;;;;;;OAMG;yBACkB,MAAM,YAAW,kBAAkB,GAAQ,UAAU,CAAC,MAAM,CAAC;IAUlF;;;;;;;;;;;OAWG;uBACgB,MAAM,YAAW,gBAAgB,GAAQ,UAAU,CAAC,MAAM,CAAC;CAQ/E,CAAC"}
|
package/dist/cjs/input.js
CHANGED
|
@@ -172,6 +172,22 @@ const input = {
|
|
|
172
172
|
options: options.options
|
|
173
173
|
};
|
|
174
174
|
},
|
|
175
|
+
/**
|
|
176
|
+
* Create a symbol input parameter (PineScript `input.symbol`): a ticker id ("NASDAQ:MSFT") that an application can
|
|
177
|
+
* edit with a symbol picker (#180)
|
|
178
|
+
* @param defaultValue - Default ticker id
|
|
179
|
+
* @param options - Additional options (title, options for dropdown)
|
|
180
|
+
* @returns Input value object
|
|
181
|
+
*/
|
|
182
|
+
symbol(defaultValue, options = {}) {
|
|
183
|
+
return {
|
|
184
|
+
type: "symbol",
|
|
185
|
+
defaultValue,
|
|
186
|
+
value: defaultValue,
|
|
187
|
+
title: options.title,
|
|
188
|
+
options: options.options
|
|
189
|
+
};
|
|
190
|
+
},
|
|
175
191
|
/**
|
|
176
192
|
* Create a date/time input parameter (PineScript `input.time`)
|
|
177
193
|
* @param defaultValue - Default UNIX time in milliseconds, e.g. `time.timestamp('2024-01-01')`
|
package/dist/cjs/input.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/input.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @fileoverview Input helper functions for indicator parameters\n * These functions create input definitions that can be used with the indicator system.\n * @module input\n */\n\n/**\n * Input value with its configuration\n */\nexport interface InputValue<T> {\n /** Input type identifier */\n type: 'int' | 'float' | 'source' | 'bool' | 'string' | 'timeframe' | 'session' | 'time';\n /** Default value */\n defaultValue: T;\n /** Current value (initially equals defaultValue) */\n value: T;\n /** Display title */\n title?: string;\n /** Minimum value (for numeric inputs) */\n min?: number;\n /** Maximum value (for numeric inputs) */\n max?: number;\n /** Step size (for numeric inputs) */\n step?: number;\n /** Available options (for source/string/timeframe/session types) */\n options?: string[];\n}\n\n/**\n * Options for integer input\n */\nexport interface IntInputOptions {\n /** Minimum value */\n min?: number;\n /** Maximum value */\n max?: number;\n /** Step size */\n step?: number;\n /** Display title */\n title?: string;\n}\n\n/**\n * Options for float input\n */\nexport interface FloatInputOptions {\n /** Minimum value */\n min?: number;\n /** Maximum value */\n max?: number;\n /** Step size */\n step?: number;\n /** Display title */\n title?: string;\n}\n\n/**\n * Options for source input\n */\nexport interface SourceInputOptions {\n /** Display title */\n title?: string;\n}\n\n/**\n * Options for boolean input\n */\nexport interface BoolInputOptions {\n /** Display title */\n title?: string;\n}\n\n/**\n * Options for string input\n */\nexport interface StringInputOptions {\n /** Display title */\n title?: string;\n /** Available options for dropdown */\n options?: string[];\n}\n\n/**\n * Options for time input\n */\nexport interface TimeInputOptions {\n /** Display title */\n title?: string;\n}\n\n/**\n * Source type for price data\n */\nexport type SourceType = 'open' | 'high' | 'low' | 'close' | 'hl2' | 'hlc3' | 'ohlc4' | 'hlcc4';\n\n/**\n * Input helper functions for creating indicator parameters\n */\nexport const input = {\n /**\n * Create an integer input parameter\n * @param defaultValue - Default value for the input\n * @param options - Additional options (min, max, step, title)\n * @returns Input value object\n * \n * @example\n * ```typescript\n * const length = input.int(14, { min: 1, max: 500, title: 'Length' });\n * console.log(length.value); // 14\n * ```\n */\n int(defaultValue: number, options: IntInputOptions = {}): InputValue<number> {\n return {\n type: 'int' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n min: options.min,\n max: options.max,\n step: options.step ?? 1,\n };\n },\n\n /**\n * Create a float input parameter\n * @param defaultValue - Default value for the input\n * @param options - Additional options (min, max, step, title)\n * @returns Input value object\n * \n * @example\n * ```typescript\n * const multiplier = input.float(2.5, { min: 0.1, max: 10, step: 0.1, title: 'Multiplier' });\n * console.log(multiplier.value); // 2.5\n * ```\n */\n float(defaultValue: number, options: FloatInputOptions = {}): InputValue<number> {\n return {\n type: 'float' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n min: options.min,\n max: options.max,\n step: options.step ?? 0.1,\n };\n },\n\n /**\n * Create a source input parameter (for selecting price data type)\n * @param defaultValue - Default source type (default: 'close')\n * @param options - Additional options (title)\n * @returns Input value object\n * \n * @example\n * ```typescript\n * const src = input.source('close', { title: 'Source' });\n * console.log(src.value); // 'close'\n * ```\n */\n source(defaultValue: SourceType = 'close', options: SourceInputOptions = {}): InputValue<SourceType> {\n return {\n type: 'source' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n options: ['open', 'high', 'low', 'close', 'hl2', 'hlc3', 'ohlc4', 'hlcc4'],\n };\n },\n\n /**\n * Create a boolean input parameter\n * @param defaultValue - Default value for the input\n * @param options - Additional options (title)\n * @returns Input value object\n * \n * @example\n * ```typescript\n * const showSignal = input.bool(true, { title: 'Show Signal' });\n * console.log(showSignal.value); // true\n * ```\n */\n bool(defaultValue: boolean, options: BoolInputOptions = {}): InputValue<boolean> {\n return {\n type: 'bool' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n };\n },\n\n /**\n * Create a string input parameter\n * @param defaultValue - Default value for the input\n * @param options - Additional options (title, options for dropdown)\n * @returns Input value object\n * \n * @example\n * ```typescript\n * const maType = input.string('SMA', { title: 'MA Type', options: ['SMA', 'EMA', 'WMA'] });\n * console.log(maType.value); // 'SMA'\n * ```\n */\n string(defaultValue: string, options: StringInputOptions = {}): InputValue<string> {\n return {\n type: 'string' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n options: options.options,\n };\n },\n\n /**\n * Create a timeframe input parameter (PineScript `input.timeframe`)\n * @param defaultValue - Default timeframe string (\"60\", \"1D\", \"W\"); \"\" means the chart timeframe\n * @param options - Additional options (title, options for dropdown)\n * @returns Input value object\n *\n * @example\n * ```typescript\n * const htf = input.timeframe('1D', { title: 'Higher timeframe' });\n * console.log(htf.value); // '1D'\n * ```\n */\n timeframe(defaultValue: string, options: StringInputOptions = {}): InputValue<string> {\n return {\n type: 'timeframe' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n options: options.options,\n };\n },\n\n /**\n * Create a session input parameter (PineScript `input.session`)\n * @param defaultValue - Default session string (\"0930-1600\", \"0930-1600:23456\")\n * @param options - Additional options (title, options for dropdown)\n * @returns Input value object\n *\n * @example\n * ```typescript\n * const rth = input.session('0930-1600', { title: 'Regular hours' });\n * console.log(rth.value); // '0930-1600'\n * ```\n */\n session(defaultValue: string, options: StringInputOptions = {}): InputValue<string> {\n return {\n type: 'session' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n options: options.options,\n };\n },\n\n /**\n * Create a date/time input parameter (PineScript `input.time`)\n * @param defaultValue - Default UNIX time in milliseconds, e.g. `time.timestamp('2024-01-01')`\n * @param options - Additional options (title)\n * @returns Input value object\n *\n * @example\n * ```typescript\n * const start = input.time(time.timestamp('2024-01-01'), { title: 'Start' });\n * console.log(start.value); // 1704067200000\n * ```\n */\n time(defaultValue: number, options: TimeInputOptions = {}): InputValue<number> {\n return {\n type: 'time' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n };\n },\n};\n\n// Freeze the input object to prevent accidental modifications\nObject.freeze(input);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkGO,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAanB,IAAI,cAAsB,UAA2B,CAAC,GAAuB;AAC3E,WAAO;AAAA,MACL,MAAM;AAAA,MACN;AAAA,MACA,OAAO;AAAA,MACP,OAAO,QAAQ;AAAA,MACf,KAAK,QAAQ;AAAA,MACb,KAAK,QAAQ;AAAA,MACb,MAAM,QAAQ,QAAQ;AAAA,IACxB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,MAAM,cAAsB,UAA6B,CAAC,GAAuB;AAC/E,WAAO;AAAA,MACL,MAAM;AAAA,MACN;AAAA,MACA,OAAO;AAAA,MACP,OAAO,QAAQ;AAAA,MACf,KAAK,QAAQ;AAAA,MACb,KAAK,QAAQ;AAAA,MACb,MAAM,QAAQ,QAAQ;AAAA,IACxB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,OAAO,eAA2B,SAAS,UAA8B,CAAC,GAA2B;AACnG,WAAO;AAAA,MACL,MAAM;AAAA,MACN;AAAA,MACA,OAAO;AAAA,MACP,OAAO,QAAQ;AAAA,MACf,SAA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AAO,QAAQ;AAAA,IACjB;AAAA,EACF;AACF;AAGA,OAAO,OAAO,KAAK;",
|
|
4
|
+
"sourcesContent": ["/**\n * @fileoverview Input helper functions for indicator parameters\n * These functions create input definitions that can be used with the indicator system.\n * @module input\n */\n\n/**\n * Input value with its configuration\n */\nexport interface InputValue<T> {\n /** Input type identifier */\n type: 'int' | 'float' | 'source' | 'bool' | 'string' | 'timeframe' | 'session' | 'time' | 'symbol';\n /** Default value */\n defaultValue: T;\n /** Current value (initially equals defaultValue) */\n value: T;\n /** Display title */\n title?: string;\n /** Minimum value (for numeric inputs) */\n min?: number;\n /** Maximum value (for numeric inputs) */\n max?: number;\n /** Step size (for numeric inputs) */\n step?: number;\n /** Available options (for source/string/timeframe/session types) */\n options?: string[];\n}\n\n/**\n * Options for integer input\n */\nexport interface IntInputOptions {\n /** Minimum value */\n min?: number;\n /** Maximum value */\n max?: number;\n /** Step size */\n step?: number;\n /** Display title */\n title?: string;\n}\n\n/**\n * Options for float input\n */\nexport interface FloatInputOptions {\n /** Minimum value */\n min?: number;\n /** Maximum value */\n max?: number;\n /** Step size */\n step?: number;\n /** Display title */\n title?: string;\n}\n\n/**\n * Options for source input\n */\nexport interface SourceInputOptions {\n /** Display title */\n title?: string;\n}\n\n/**\n * Options for boolean input\n */\nexport interface BoolInputOptions {\n /** Display title */\n title?: string;\n}\n\n/**\n * Options for string input\n */\nexport interface StringInputOptions {\n /** Display title */\n title?: string;\n /** Available options for dropdown */\n options?: string[];\n}\n\n/**\n * Options for time input\n */\nexport interface TimeInputOptions {\n /** Display title */\n title?: string;\n}\n\n/**\n * Source type for price data\n */\nexport type SourceType = 'open' | 'high' | 'low' | 'close' | 'hl2' | 'hlc3' | 'ohlc4' | 'hlcc4';\n\n/**\n * Input helper functions for creating indicator parameters\n */\nexport const input = {\n /**\n * Create an integer input parameter\n * @param defaultValue - Default value for the input\n * @param options - Additional options (min, max, step, title)\n * @returns Input value object\n * \n * @example\n * ```typescript\n * const length = input.int(14, { min: 1, max: 500, title: 'Length' });\n * console.log(length.value); // 14\n * ```\n */\n int(defaultValue: number, options: IntInputOptions = {}): InputValue<number> {\n return {\n type: 'int' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n min: options.min,\n max: options.max,\n step: options.step ?? 1,\n };\n },\n\n /**\n * Create a float input parameter\n * @param defaultValue - Default value for the input\n * @param options - Additional options (min, max, step, title)\n * @returns Input value object\n * \n * @example\n * ```typescript\n * const multiplier = input.float(2.5, { min: 0.1, max: 10, step: 0.1, title: 'Multiplier' });\n * console.log(multiplier.value); // 2.5\n * ```\n */\n float(defaultValue: number, options: FloatInputOptions = {}): InputValue<number> {\n return {\n type: 'float' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n min: options.min,\n max: options.max,\n step: options.step ?? 0.1,\n };\n },\n\n /**\n * Create a source input parameter (for selecting price data type)\n * @param defaultValue - Default source type (default: 'close')\n * @param options - Additional options (title)\n * @returns Input value object\n * \n * @example\n * ```typescript\n * const src = input.source('close', { title: 'Source' });\n * console.log(src.value); // 'close'\n * ```\n */\n source(defaultValue: SourceType = 'close', options: SourceInputOptions = {}): InputValue<SourceType> {\n return {\n type: 'source' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n options: ['open', 'high', 'low', 'close', 'hl2', 'hlc3', 'ohlc4', 'hlcc4'],\n };\n },\n\n /**\n * Create a boolean input parameter\n * @param defaultValue - Default value for the input\n * @param options - Additional options (title)\n * @returns Input value object\n * \n * @example\n * ```typescript\n * const showSignal = input.bool(true, { title: 'Show Signal' });\n * console.log(showSignal.value); // true\n * ```\n */\n bool(defaultValue: boolean, options: BoolInputOptions = {}): InputValue<boolean> {\n return {\n type: 'bool' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n };\n },\n\n /**\n * Create a string input parameter\n * @param defaultValue - Default value for the input\n * @param options - Additional options (title, options for dropdown)\n * @returns Input value object\n * \n * @example\n * ```typescript\n * const maType = input.string('SMA', { title: 'MA Type', options: ['SMA', 'EMA', 'WMA'] });\n * console.log(maType.value); // 'SMA'\n * ```\n */\n string(defaultValue: string, options: StringInputOptions = {}): InputValue<string> {\n return {\n type: 'string' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n options: options.options,\n };\n },\n\n /**\n * Create a timeframe input parameter (PineScript `input.timeframe`)\n * @param defaultValue - Default timeframe string (\"60\", \"1D\", \"W\"); \"\" means the chart timeframe\n * @param options - Additional options (title, options for dropdown)\n * @returns Input value object\n *\n * @example\n * ```typescript\n * const htf = input.timeframe('1D', { title: 'Higher timeframe' });\n * console.log(htf.value); // '1D'\n * ```\n */\n timeframe(defaultValue: string, options: StringInputOptions = {}): InputValue<string> {\n return {\n type: 'timeframe' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n options: options.options,\n };\n },\n\n /**\n * Create a session input parameter (PineScript `input.session`)\n * @param defaultValue - Default session string (\"0930-1600\", \"0930-1600:23456\")\n * @param options - Additional options (title, options for dropdown)\n * @returns Input value object\n *\n * @example\n * ```typescript\n * const rth = input.session('0930-1600', { title: 'Regular hours' });\n * console.log(rth.value); // '0930-1600'\n * ```\n */\n session(defaultValue: string, options: StringInputOptions = {}): InputValue<string> {\n return {\n type: 'session' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n options: options.options,\n };\n },\n\n /**\n * Create a symbol input parameter (PineScript `input.symbol`): a ticker id (\"NASDAQ:MSFT\") that an application can\n * edit with a symbol picker (#180)\n * @param defaultValue - Default ticker id\n * @param options - Additional options (title, options for dropdown)\n * @returns Input value object\n */\n symbol(defaultValue: string, options: StringInputOptions = {}): InputValue<string> {\n return {\n type: 'symbol' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n options: options.options,\n };\n },\n\n /**\n * Create a date/time input parameter (PineScript `input.time`)\n * @param defaultValue - Default UNIX time in milliseconds, e.g. `time.timestamp('2024-01-01')`\n * @param options - Additional options (title)\n * @returns Input value object\n *\n * @example\n * ```typescript\n * const start = input.time(time.timestamp('2024-01-01'), { title: 'Start' });\n * console.log(start.value); // 1704067200000\n * ```\n */\n time(defaultValue: number, options: TimeInputOptions = {}): InputValue<number> {\n return {\n type: 'time' as const,\n defaultValue,\n value: defaultValue,\n title: options.title,\n };\n },\n};\n\n// Freeze the input object to prevent accidental modifications\nObject.freeze(input);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkGO,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAanB,IAAI,cAAsB,UAA2B,CAAC,GAAuB;AAC3E,WAAO;AAAA,MACL,MAAM;AAAA,MACN;AAAA,MACA,OAAO;AAAA,MACP,OAAO,QAAQ;AAAA,MACf,KAAK,QAAQ;AAAA,MACb,KAAK,QAAQ;AAAA,MACb,MAAM,QAAQ,QAAQ;AAAA,IACxB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,MAAM,cAAsB,UAA6B,CAAC,GAAuB;AAC/E,WAAO;AAAA,MACL,MAAM;AAAA,MACN;AAAA,MACA,OAAO;AAAA,MACP,OAAO,QAAQ;AAAA,MACf,KAAK,QAAQ;AAAA,MACb,KAAK,QAAQ;AAAA,MACb,MAAM,QAAQ,QAAQ;AAAA,IACxB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,OAAO,eAA2B,SAAS,UAA8B,CAAC,GAA2B;AACnG,WAAO;AAAA,MACL,MAAM;AAAA,MACN;AAAA,MACA,OAAO;AAAA,MACP,OAAO,QAAQ;AAAA,MACf,SAAS,CAAC,QAAQ,QAAQ,OAAO,SAAS,OAAO,QAAQ,SAAS,OAAO;AAAA,IAC3E;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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