@tidal-ts/core 0.12.0 → 0.12.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/derive.d.ts +14 -4
- package/dist/derive.js +18 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/derive.d.ts
CHANGED
|
@@ -374,10 +374,9 @@ export interface PairPart {
|
|
|
374
374
|
* Such a leg has no single metric to name, so the panel degrades to rendering
|
|
375
375
|
* it flat rather than inventing a decomposition.
|
|
376
376
|
*
|
|
377
|
-
* "Study" here
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
* `RV · SMA(20)` reads as one metric with one study rather than two studies.
|
|
377
|
+
* "Study" here is {@link isStudyOp} — the same discriminator the config layer
|
|
378
|
+
* uses (`isStudySeries`). A derived METRIC (`realizedVol`) terminates the walk,
|
|
379
|
+
* so `RV · SMA(20)` reads as one metric with one study rather than two studies.
|
|
381
380
|
*/
|
|
382
381
|
export declare function readPart(input: DeriveInput): PairPart | null;
|
|
383
382
|
/**
|
|
@@ -474,6 +473,17 @@ export interface OpParam {
|
|
|
474
473
|
/** The useful range a control should be drawn on, when narrower than legal. */
|
|
475
474
|
suggest?: readonly [number, number];
|
|
476
475
|
}
|
|
476
|
+
/**
|
|
477
|
+
* Whether an op is a STUDY — something laid on a series and read as such —
|
|
478
|
+
* rather than a derived METRIC (the realized-vol line, a catalog entry).
|
|
479
|
+
*
|
|
480
|
+
* A corpus study is a study even with nothing to tune. "Has it params?" was the
|
|
481
|
+
* test, and it read the twelve parameterless corpus studies (a Price Momentum
|
|
482
|
+
* Oscillator, an OBV, Typical Price…) as metrics: named after their family
|
|
483
|
+
* ("Price"), never nested under the series they study, and offered nothing in
|
|
484
|
+
* their properties but "Nothing to set on Price" (Peter, 2026-10-13).
|
|
485
|
+
*/
|
|
486
|
+
export declare function isStudyOp(op: DeriveOp): boolean;
|
|
477
487
|
/**
|
|
478
488
|
* An op's numeric params, in declaration order.
|
|
479
489
|
*
|
package/dist/derive.js
CHANGED
|
@@ -453,10 +453,9 @@ function unCompare(input) {
|
|
|
453
453
|
* Such a leg has no single metric to name, so the panel degrades to rendering
|
|
454
454
|
* it flat rather than inventing a decomposition.
|
|
455
455
|
*
|
|
456
|
-
* "Study" here
|
|
457
|
-
*
|
|
458
|
-
*
|
|
459
|
-
* `RV · SMA(20)` reads as one metric with one study rather than two studies.
|
|
456
|
+
* "Study" here is {@link isStudyOp} — the same discriminator the config layer
|
|
457
|
+
* uses (`isStudySeries`). A derived METRIC (`realizedVol`) terminates the walk,
|
|
458
|
+
* so `RV · SMA(20)` reads as one metric with one study rather than two studies.
|
|
460
459
|
*/
|
|
461
460
|
export function readPart(input) {
|
|
462
461
|
const studies = [];
|
|
@@ -470,7 +469,7 @@ export function readPart(input) {
|
|
|
470
469
|
// multi-output study can be picked from, and a MACD's knobs are
|
|
471
470
|
// `fastPeriod`/`slowPeriod`/`signalPeriod`. Requiring `period` left a pair
|
|
472
471
|
// over an SMA of a MACD's Line rendering flat (tidal #210 review).
|
|
473
|
-
if (!isSpecLike(node) || (!picked && !
|
|
472
|
+
if (!isSpecLike(node) || (!picked && !isStudyOp(node.op))) {
|
|
474
473
|
if (picked)
|
|
475
474
|
return null; // a pick of garbage: refuse, as below
|
|
476
475
|
break;
|
|
@@ -637,6 +636,20 @@ export function applyDerived(series, specs, units) {
|
|
|
637
636
|
export function opHasPeriod(op) {
|
|
638
637
|
return TIDAL_OPS.describe().some((d) => d.name === op && 'period' in d.params);
|
|
639
638
|
}
|
|
639
|
+
/**
|
|
640
|
+
* Whether an op is a STUDY — something laid on a series and read as such —
|
|
641
|
+
* rather than a derived METRIC (the realized-vol line, a catalog entry).
|
|
642
|
+
*
|
|
643
|
+
* A corpus study is a study even with nothing to tune. "Has it params?" was the
|
|
644
|
+
* test, and it read the twelve parameterless corpus studies (a Price Momentum
|
|
645
|
+
* Oscillator, an OBV, Typical Price…) as metrics: named after their family
|
|
646
|
+
* ("Price"), never nested under the series they study, and offered nothing in
|
|
647
|
+
* their properties but "Nothing to set on Price" (Peter, 2026-10-13).
|
|
648
|
+
*/
|
|
649
|
+
export function isStudyOp(op) {
|
|
650
|
+
return opParams(op).length > 0 || CORPUS_OPS.has(op);
|
|
651
|
+
}
|
|
652
|
+
const CORPUS_OPS = new Set(ADOPTED_STUDIES.map((d) => d.name));
|
|
640
653
|
/**
|
|
641
654
|
* An op's numeric params, in declaration order.
|
|
642
655
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { BAR_INTERVAL_MS, type Instrument, type InstrumentKind, type BarInterval
|
|
|
2
2
|
export { generatePriceSeries, buildPriceSeries, DEMO_INSTRUMENTS, PRICE_SCHEMA, type PriceSeriesOptions, type PriceSeries, type PriceRow, } from './fixture.js';
|
|
3
3
|
export { generateVolSeries, buildVolSeries, VOL_SCHEMA, VOL_TENORS, DEFAULT_VOL_TENOR, impliedCol, hvCol, rvCol, rvCenCol, skewCol, type VolSeries, type VolColumns, type VolTenor, type VolSeriesOptions, } from './vol.js';
|
|
4
4
|
export { aggregateColumn, floorToWindow, liveWindowMs, ohlcWindow, sessionGrid, WINDOW_MS, WINDOW_LADDER, MIN_BAR_PX, autoBarWindow, type BarReducer, type SeriesWindow, } from './aggregate.js';
|
|
5
|
-
export { applyDerived, applyDerivedReport, COMPARE_PREFIX, deriveId, deriveLineage, inputNames, substituteInput, hasPairOp, isBrokenId, isPairOp, isValidSpec, opHasPeriod, PERIOD_BOUNDS, readNumericColumn, partStudyLabel, readPart, readPairParts, specUnit, studyCatalog, TIDAL_OPS, BAND_OUTPUTS, opParams, studyTag, opIsBand, opInputs, opIsMulti, opOutputs, primaryOutput, studyInputOf, studyPick, fanPick, withFanOutput, withStudyOutput, studyColumn, BAR_PRICE_COLUMNS, withStudyColumn, type StudyPick, isPickedInput, opNeedsColumns, TARGET_ROLES, opSharesSourceAxis, type OpParam, usesCompare, type DeriveSkip, type PairPart, type PartStudy, type StudyOption, type NumericColumnReader, DEFAULT_PERIOD, type DeriveInput, type PickedDeriveOutput, type DeriveSpec, type DeriveOp, type TidalOp, type PairOp, } from './derive.js';
|
|
5
|
+
export { applyDerived, applyDerivedReport, COMPARE_PREFIX, deriveId, deriveLineage, inputNames, substituteInput, hasPairOp, isBrokenId, isPairOp, isValidSpec, opHasPeriod, PERIOD_BOUNDS, readNumericColumn, partStudyLabel, readPart, readPairParts, specUnit, studyCatalog, TIDAL_OPS, BAND_OUTPUTS, opParams, isStudyOp, studyTag, opIsBand, opInputs, opIsMulti, opOutputs, primaryOutput, studyInputOf, studyPick, fanPick, withFanOutput, withStudyOutput, studyColumn, BAR_PRICE_COLUMNS, withStudyColumn, type StudyPick, isPickedInput, opNeedsColumns, TARGET_ROLES, opSharesSourceAxis, type OpParam, usesCompare, type DeriveSkip, type PairPart, type PartStudy, type StudyOption, type NumericColumnReader, DEFAULT_PERIOD, type DeriveInput, type PickedDeriveOutput, type DeriveSpec, type DeriveOp, type TidalOp, type PairOp, } from './derive.js';
|
|
6
6
|
export { joinUnderPrefix } from './join.js';
|
|
7
7
|
export { columnExtent } from './extent.js';
|
|
8
8
|
export { snapshotToTimeSeries, appendToRows, type PondSnapshot, type PondAppend, type PondValue, type WireColumnSpec, } from './columnar.js';
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { BAR_INTERVAL_MS, } from './types.js';
|
|
|
2
2
|
export { generatePriceSeries, buildPriceSeries, DEMO_INSTRUMENTS, PRICE_SCHEMA, } from './fixture.js';
|
|
3
3
|
export { generateVolSeries, buildVolSeries, VOL_SCHEMA, VOL_TENORS, DEFAULT_VOL_TENOR, impliedCol, hvCol, rvCol, rvCenCol, skewCol, } from './vol.js';
|
|
4
4
|
export { aggregateColumn, floorToWindow, liveWindowMs, ohlcWindow, sessionGrid, WINDOW_MS, WINDOW_LADDER, MIN_BAR_PX, autoBarWindow, } from './aggregate.js';
|
|
5
|
-
export { applyDerived, applyDerivedReport, COMPARE_PREFIX, deriveId, deriveLineage, inputNames, substituteInput, hasPairOp, isBrokenId, isPairOp, isValidSpec, opHasPeriod, PERIOD_BOUNDS, readNumericColumn, partStudyLabel, readPart, readPairParts, specUnit, studyCatalog, TIDAL_OPS, BAND_OUTPUTS, opParams, studyTag, opIsBand, opInputs, opIsMulti, opOutputs, primaryOutput, studyInputOf, studyPick, fanPick, withFanOutput, withStudyOutput, studyColumn, BAR_PRICE_COLUMNS, withStudyColumn, isPickedInput, opNeedsColumns, TARGET_ROLES, opSharesSourceAxis, usesCompare, DEFAULT_PERIOD, } from './derive.js';
|
|
5
|
+
export { applyDerived, applyDerivedReport, COMPARE_PREFIX, deriveId, deriveLineage, inputNames, substituteInput, hasPairOp, isBrokenId, isPairOp, isValidSpec, opHasPeriod, PERIOD_BOUNDS, readNumericColumn, partStudyLabel, readPart, readPairParts, specUnit, studyCatalog, TIDAL_OPS, BAND_OUTPUTS, opParams, isStudyOp, studyTag, opIsBand, opInputs, opIsMulti, opOutputs, primaryOutput, studyInputOf, studyPick, fanPick, withFanOutput, withStudyOutput, studyColumn, BAR_PRICE_COLUMNS, withStudyColumn, isPickedInput, opNeedsColumns, TARGET_ROLES, opSharesSourceAxis, usesCompare, DEFAULT_PERIOD, } from './derive.js';
|
|
6
6
|
export { joinUnderPrefix } from './join.js';
|
|
7
7
|
export { columnExtent } from './extent.js';
|
|
8
8
|
export { snapshotToTimeSeries, appendToRows, } from './columnar.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tidal-ts/core",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1",
|
|
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",
|