@tidal-ts/core 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/studyCatalog.d.ts +3 -0
- package/dist/studyCatalog.js +65 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ export { snapshotToTimeSeries, appendToRows, type PondSnapshot, type PondAppend,
|
|
|
9
9
|
export { exactSessionSegments, inferBarMs, sessionOpenLine, sessionSegments, shiftKeys, sliceBySegments, type Segment, type SessionSegmentOptions, } from './sessions.js';
|
|
10
10
|
export { monthlyExpirations, thirdFriday } from './expirations.js';
|
|
11
11
|
export { holdVolAcrossGrid } from './regrid.js';
|
|
12
|
-
export { ADOPTED_STUDIES, adoptable, isBandShape, outputMark, studyNeedsColumns, } from './studyCatalog.js';
|
|
12
|
+
export { ADOPTED_STUDIES, adoptable, isBandShape, outputMark, studyLevels, studyNeedsColumns, } from './studyCatalog.js';
|
|
13
13
|
export { DATA_TIME_ZONE, LOCAL_ZONE, TIME_ZONE_CHOICES, resolveTimeZone, timeZoneLabel, type TimeZoneChoice, } from './timeZone.js';
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,6 @@ export { monthlyExpirations, thirdFriday } from './expirations.js';
|
|
|
11
11
|
export { holdVolAcrossGrid } from './regrid.js';
|
|
12
12
|
// The corpus adoption (TDL-STUDYCAT). `ADOPTED_STUDIES` is exported so the
|
|
13
13
|
// count is assertable and a widening of `adoptable` is a visible edit.
|
|
14
|
-
export { ADOPTED_STUDIES, adoptable, isBandShape, outputMark, studyNeedsColumns, } from './studyCatalog.js';
|
|
14
|
+
export { ADOPTED_STUDIES, adoptable, isBandShape, outputMark, studyLevels, studyNeedsColumns, } from './studyCatalog.js';
|
|
15
15
|
// The two zones: what the data IS, and what the axis reads in (TDL-TZAXIS).
|
|
16
16
|
export { DATA_TIME_ZONE, LOCAL_ZONE, TIME_ZONE_CHOICES, resolveTimeZone, timeZoneLabel, } from './timeZone.js';
|
package/dist/studyCatalog.d.ts
CHANGED
|
@@ -70,6 +70,9 @@ export declare const PRIMARY_SUFFIX = "Value";
|
|
|
70
70
|
/** How one declared output should be drawn. `'line'` unless the overlay says
|
|
71
71
|
* otherwise — see {@link OUTPUT_MARKS}. */
|
|
72
72
|
export declare function outputMark(op: string, suffix: string): 'line' | 'bar';
|
|
73
|
+
/** The guide levels to draw on a study's own axis — see {@link STUDY_LEVELS}.
|
|
74
|
+
* Empty when the study has none. */
|
|
75
|
+
export declare function studyLevels(op: string): readonly number[];
|
|
73
76
|
/**
|
|
74
77
|
* True if the outputs are a band **Tidal's `band` style can actually read**.
|
|
75
78
|
*
|
package/dist/studyCatalog.js
CHANGED
|
@@ -145,6 +145,71 @@ const OUTPUT_MARKS = {
|
|
|
145
145
|
export function outputMark(op, suffix) {
|
|
146
146
|
return OUTPUT_MARKS[op]?.[suffix] ?? 'line';
|
|
147
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* An oscillator's conventional GUIDE LEVELS — RSI's 30/70, a stochastic's
|
|
150
|
+
* 20/80, the zero line a MACD crosses — where the catalog cannot say.
|
|
151
|
+
*
|
|
152
|
+
* The descriptor carries `unit`, which places a study on its own axis, but no
|
|
153
|
+
* reference levels, so every consumer re-types them by hand. That is the
|
|
154
|
+
* F-charts-26 addendum (2026-09-26), and this table is the workaround it asks
|
|
155
|
+
* to delete: an optional `levels` on the descriptor would replace it.
|
|
156
|
+
*
|
|
157
|
+
* Each entry was checked against the study's MEASURED range on the fixture
|
|
158
|
+
* series (500 bars, three instruments, 2026-10-02) rather than against the
|
|
159
|
+
* textbook, because a scale is a convention: Williams %R runs −100…0 here, %B
|
|
160
|
+
* 0…1, and a stochastic 0…100, not 0…1. A study whose outputs do not share
|
|
161
|
+
* one scale (`aroon`'s Up/Down against its Osc) is left out rather than given
|
|
162
|
+
* levels that suit half of it.
|
|
163
|
+
*/
|
|
164
|
+
const STUDY_LEVELS = {
|
|
165
|
+
// Bounded 0…100, overbought / oversold.
|
|
166
|
+
rsi: [30, 70],
|
|
167
|
+
stochastic: [20, 80],
|
|
168
|
+
stochasticRsi: [20, 80],
|
|
169
|
+
moneyFlowIndex: [20, 80],
|
|
170
|
+
ultimateOscillator: [30, 70],
|
|
171
|
+
intradayMomentumIndex: [30, 70],
|
|
172
|
+
schaffTrendCycle: [25, 75],
|
|
173
|
+
psychologicalLine: [25, 75],
|
|
174
|
+
// Choppy above 61.8, trending below 38.2.
|
|
175
|
+
choppinessIndex: [38.2, 61.8],
|
|
176
|
+
// Other bounded scales.
|
|
177
|
+
williamsR: [-80, -20],
|
|
178
|
+
stochasticMomentumIndex: [-40, 40],
|
|
179
|
+
chandeMomentum: [-50, 50],
|
|
180
|
+
commodityChannelIndex: [-100, 100],
|
|
181
|
+
bollingerPercentB: [0, 1],
|
|
182
|
+
// The reversal bulge: up through 27, back under 26.5.
|
|
183
|
+
massIndex: [26.5, 27],
|
|
184
|
+
vortex: [1],
|
|
185
|
+
zScore: [-2, 0, 2],
|
|
186
|
+
// Centred on zero: the crossing is the reading.
|
|
187
|
+
macd: [0],
|
|
188
|
+
trix: [0],
|
|
189
|
+
coppock: [0],
|
|
190
|
+
kst: [0],
|
|
191
|
+
priceMomentumOscillator: [0],
|
|
192
|
+
momentum: [0],
|
|
193
|
+
percentChange: [0],
|
|
194
|
+
awesomeOscillator: [0],
|
|
195
|
+
fisherTransform: [0],
|
|
196
|
+
prettyGoodOscillator: [0],
|
|
197
|
+
primeNumberOscillator: [0],
|
|
198
|
+
relativeVigorIndex: [0],
|
|
199
|
+
chandeForecastOscillator: [0],
|
|
200
|
+
trueStrengthIndex: [0],
|
|
201
|
+
elderRay: [0],
|
|
202
|
+
chaikinMoneyFlow: [0],
|
|
203
|
+
chaikinOscillator: [0],
|
|
204
|
+
twiggsMoneyFlow: [0],
|
|
205
|
+
forceIndex: [0],
|
|
206
|
+
klinger: [0],
|
|
207
|
+
};
|
|
208
|
+
/** The guide levels to draw on a study's own axis — see {@link STUDY_LEVELS}.
|
|
209
|
+
* Empty when the study has none. */
|
|
210
|
+
export function studyLevels(op) {
|
|
211
|
+
return STUDY_LEVELS[op] ?? [];
|
|
212
|
+
}
|
|
148
213
|
/** The output suffixes, which is also the order {@link catalogRun} returns them
|
|
149
214
|
* in — the engine pairs them positionally. */
|
|
150
215
|
const suffixes = (d) => d.outputs.map((o) => o.id);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tidal-ts/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Financial time-series vocabulary on pond-ts: the study/derive seam, the vol schema, bar windows, the columnar adapter and session helpers.",
|
|
6
6
|
"license": "MIT",
|