@adaptic/utils 0.0.1031 → 0.0.1032
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.cjs +306 -133
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +303 -134
- package/dist/index.mjs.map +1 -1
- package/dist/types/__tests__/indicator-parity/generate.d.ts +64 -0
- package/dist/types/__tests__/indicator-parity/generate.d.ts.map +1 -0
- package/dist/types/__tests__/indicator-parity/record.d.ts +144 -0
- package/dist/types/__tests__/indicator-parity/record.d.ts.map +1 -0
- package/dist/types/__tests__/indicator-parity/reference.d.ts +92 -0
- package/dist/types/__tests__/indicator-parity/reference.d.ts.map +1 -0
- package/dist/types/__tests__/indicator-parity/series.d.ts +64 -0
- package/dist/types/__tests__/indicator-parity/series.d.ts.map +1 -0
- package/dist/types/__tests__/indicator-parity/subjects.d.ts +55 -0
- package/dist/types/__tests__/indicator-parity/subjects.d.ts.map +1 -0
- package/dist/types/__tests__/support/statistic.d.ts +18 -0
- package/dist/types/__tests__/support/statistic.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/metrics-calcs.d.ts +25 -0
- package/dist/types/metrics-calcs.d.ts.map +1 -1
- package/dist/types/performance-metrics.d.ts +16 -4
- package/dist/types/performance-metrics.d.ts.map +1 -1
- package/dist/types/sample-statistic.d.ts +123 -0
- package/dist/types/sample-statistic.d.ts.map +1 -0
- package/dist/types/strategy-metrics.d.ts +38 -16
- package/dist/types/strategy-metrics.d.ts.map +1 -1
- package/dist/types/types/alpaca-types.d.ts +26 -2
- package/dist/types/types/alpaca-types.d.ts.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the prefix-parity golden master by running BOTH the production
|
|
3
|
+
* indicators and the independent references over every (series, prefix) pair.
|
|
4
|
+
*
|
|
5
|
+
* The fixture is never generated from production alone. Each point carries the
|
|
6
|
+
* reference outcome beside the production outcome and a `deviates` flag, so a
|
|
7
|
+
* disagreement is recorded as a disagreement rather than silently becoming the
|
|
8
|
+
* expected answer — which is the failure mode a golden master most easily
|
|
9
|
+
* introduces.
|
|
10
|
+
*
|
|
11
|
+
* Generation and verification share this module, so the record can never be
|
|
12
|
+
* produced by a different code path from the one that checks it.
|
|
13
|
+
*/
|
|
14
|
+
import { type Outcome, type ParityFixture, type ParityTrack } from "./record";
|
|
15
|
+
import { type ParityBar, type ParitySeriesId } from "./series";
|
|
16
|
+
import { type ParitySubject } from "./subjects";
|
|
17
|
+
/**
|
|
18
|
+
* Run one implementation and capture what it did, value or throw alike.
|
|
19
|
+
*
|
|
20
|
+
* A thrown error is a first-class recorded outcome. "This input must raise" is
|
|
21
|
+
* a contract, and an implementation that quietly begins returning a number for
|
|
22
|
+
* a malformed request has changed that contract just as surely as one that
|
|
23
|
+
* changes a value.
|
|
24
|
+
*
|
|
25
|
+
* @param invoke - The implementation to run.
|
|
26
|
+
* @param bars - The prefix to run it over.
|
|
27
|
+
* @returns The outcome, as stored in the fixture.
|
|
28
|
+
*/
|
|
29
|
+
export declare function captureOutcome(invoke: (bars: readonly ParityBar[]) => ReturnType<ParitySubject["production"]>, bars: readonly ParityBar[]): Outcome;
|
|
30
|
+
/**
|
|
31
|
+
* Record one subject against one series, at every prefix length.
|
|
32
|
+
*
|
|
33
|
+
* @param subject - The indicator configuration.
|
|
34
|
+
* @param seriesId - The adversarial series.
|
|
35
|
+
* @returns The recorded track.
|
|
36
|
+
*/
|
|
37
|
+
export declare function buildTrack(subject: ParitySubject, seriesId: ParitySeriesId): ParityTrack;
|
|
38
|
+
/**
|
|
39
|
+
* Build the whole golden master from the current tree.
|
|
40
|
+
*
|
|
41
|
+
* @returns The fixture, ready to serialise or to compare against the stored one.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildFixture(): ParityFixture;
|
|
44
|
+
/**
|
|
45
|
+
* Where the golden master lives, relative to the package root.
|
|
46
|
+
*
|
|
47
|
+
* Declared once so the generator and the test cannot drift onto two different
|
|
48
|
+
* files — a check that reads a fixture nobody writes passes forever.
|
|
49
|
+
*/
|
|
50
|
+
export declare const FIXTURE_PATH_FROM_PACKAGE_ROOT = "src/__tests__/fixtures/indicator-prefix-parity.json";
|
|
51
|
+
/**
|
|
52
|
+
* Serialise the fixture the way it is stored on disk.
|
|
53
|
+
*
|
|
54
|
+
* One recorded point per line, hand-assembled rather than handed to
|
|
55
|
+
* `JSON.stringify(..., 2)`. Fully indented output runs to tens of thousands of
|
|
56
|
+
* lines for the same data, which makes a diff unreadable and a review
|
|
57
|
+
* impossible — and an unreviewable golden master is a golden master nobody
|
|
58
|
+
* checks. The output is still ordinary JSON.
|
|
59
|
+
*
|
|
60
|
+
* @param fixture - The fixture to serialise.
|
|
61
|
+
* @returns JSON with one point per line and a trailing newline.
|
|
62
|
+
*/
|
|
63
|
+
export declare function serialiseFixture(fixture: ParityFixture): string;
|
|
64
|
+
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/indicator-parity/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,aAAa,EAElB,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,KAAK,UAAU,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,EAC/E,IAAI,EAAE,SAAS,SAAS,EAAE,GACzB,OAAO,CAST;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,cAAc,GACvB,WAAW,CAYb;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,aAAa,CAY5C;AAED;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,wDACY,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAuB/D"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The golden-master record shape, its JSON codec, and the inventory of places
|
|
3
|
+
* where production is KNOWN to disagree with the independent reference.
|
|
4
|
+
*
|
|
5
|
+
* The deviation inventory is the mechanism that keeps this fixture honest. A
|
|
6
|
+
* golden master recorded from current output silently promotes every live
|
|
7
|
+
* defect to a specification; recording production AND an independent reference,
|
|
8
|
+
* and requiring every disagreement between them to be declared here with its
|
|
9
|
+
* mechanism, means a new disagreement fails the suite instead of being
|
|
10
|
+
* absorbed. Removing an entry from this list is how a fix gets proven.
|
|
11
|
+
*/
|
|
12
|
+
import type { ParitySeriesId } from "./series";
|
|
13
|
+
/**
|
|
14
|
+
* A number as stored in JSON. `NaN` and the infinities have no JSON literal, so
|
|
15
|
+
* they are tagged strings; every other value is the double itself, which
|
|
16
|
+
* `JSON.stringify` round-trips exactly.
|
|
17
|
+
*/
|
|
18
|
+
export type EncodedNumber = number | "NaN" | "Infinity" | "-Infinity";
|
|
19
|
+
/** Encode a number for storage. */
|
|
20
|
+
export declare function encodeNumber(value: number): EncodedNumber;
|
|
21
|
+
/** Decode a stored number. */
|
|
22
|
+
export declare function decodeNumber(value: EncodedNumber): number;
|
|
23
|
+
/**
|
|
24
|
+
* One emitted indicator reading: which bar it describes, and each component it
|
|
25
|
+
* carries. `null` marks a component the indicator did not produce for that bar.
|
|
26
|
+
*/
|
|
27
|
+
export interface IndicatorEntry {
|
|
28
|
+
readonly barIndex: number;
|
|
29
|
+
readonly components: Readonly<Record<string, number | null>>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* What an indicator did when fed one prefix.
|
|
33
|
+
*
|
|
34
|
+
* `count` and `firstBarIndex` pin the SHAPE of the warm-up — how many values
|
|
35
|
+
* came out and which bar the first one describes — which is precisely what a
|
|
36
|
+
* restart-shaped history corrupts. `tail` pins the newest value, the one a live
|
|
37
|
+
* consumer reads. Recording the tail at every prefix length from the shortest
|
|
38
|
+
* upward covers every value the indicator ever emits, with no redundancy.
|
|
39
|
+
*/
|
|
40
|
+
export interface Reading {
|
|
41
|
+
readonly count: number;
|
|
42
|
+
readonly firstBarIndex: number | null;
|
|
43
|
+
readonly tailBarIndex: number | null;
|
|
44
|
+
readonly tail: Readonly<Record<string, EncodedNumber | null>> | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The outcome of one invocation. A throw is recorded as tightly as a value:
|
|
48
|
+
* "this input must raise" is part of the contract, and an implementation that
|
|
49
|
+
* quietly starts returning a number instead has changed its contract.
|
|
50
|
+
*/
|
|
51
|
+
export type Outcome = {
|
|
52
|
+
readonly kind: "reading";
|
|
53
|
+
readonly reading: Reading;
|
|
54
|
+
} | {
|
|
55
|
+
readonly kind: "throws";
|
|
56
|
+
readonly message: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Production and reference outcomes for one (subject, series, prefix).
|
|
60
|
+
*
|
|
61
|
+
* `reference` is stored ONLY when it differs from `production`. Agreement is
|
|
62
|
+
* the common case and storing it twice would bury the disagreements — which
|
|
63
|
+
* are the rows a reviewer needs to see — under thousands of identical lines.
|
|
64
|
+
* An absent `reference` means "identical to production", and `deviates` states
|
|
65
|
+
* which case this is so the file can be read without inferring it.
|
|
66
|
+
*/
|
|
67
|
+
export interface ParityPoint {
|
|
68
|
+
readonly prefix: number;
|
|
69
|
+
readonly production: Outcome;
|
|
70
|
+
/** Present only when it differs from `production`; every such row must be declared below. */
|
|
71
|
+
readonly reference?: Outcome;
|
|
72
|
+
/** True exactly when `reference` is present. */
|
|
73
|
+
readonly deviates: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The reference outcome for a point, reconstructing the agreement case.
|
|
77
|
+
*
|
|
78
|
+
* @param point - The recorded point.
|
|
79
|
+
* @returns What the independent reference produced.
|
|
80
|
+
*/
|
|
81
|
+
export declare function referenceOf(point: ParityPoint): Outcome;
|
|
82
|
+
/** Every recorded point for one subject on one series. */
|
|
83
|
+
export interface ParityTrack {
|
|
84
|
+
readonly subjectId: string;
|
|
85
|
+
readonly seriesId: ParitySeriesId;
|
|
86
|
+
readonly points: readonly ParityPoint[];
|
|
87
|
+
}
|
|
88
|
+
/** The whole golden master. */
|
|
89
|
+
export interface ParityFixture {
|
|
90
|
+
/** Bumped when the record SHAPE changes, so a stale fixture fails loudly. */
|
|
91
|
+
readonly formatVersion: number;
|
|
92
|
+
readonly seriesLength: number;
|
|
93
|
+
readonly tracks: readonly ParityTrack[];
|
|
94
|
+
}
|
|
95
|
+
/** Current record shape. */
|
|
96
|
+
export declare const FIXTURE_FORMAT_VERSION = 1;
|
|
97
|
+
/**
|
|
98
|
+
* A known, mechanism-explained disagreement between production and the
|
|
99
|
+
* reference. Each entry is a live defect this harness has pinned rather than
|
|
100
|
+
* hidden.
|
|
101
|
+
*/
|
|
102
|
+
export interface DeclaredDeviation {
|
|
103
|
+
readonly subjectId: string;
|
|
104
|
+
readonly seriesIds: readonly ParitySeriesId[];
|
|
105
|
+
/** Stable id, quotable in a report or a follow-up item. */
|
|
106
|
+
readonly finding: string;
|
|
107
|
+
/** What the implementation does differently, and why that is wrong. */
|
|
108
|
+
readonly mechanism: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Every disagreement this repository knows about, with its mechanism.
|
|
112
|
+
*
|
|
113
|
+
* An undeclared disagreement fails the suite. A declared one that stops
|
|
114
|
+
* occurring also fails it, so a fix cannot land without deleting its entry —
|
|
115
|
+
* the list cannot rot in either direction.
|
|
116
|
+
*/
|
|
117
|
+
export declare const DECLARED_DEVIATIONS: readonly DeclaredDeviation[];
|
|
118
|
+
/**
|
|
119
|
+
* Whether a disagreement on this (subject, series) pair has been declared.
|
|
120
|
+
*
|
|
121
|
+
* @param subjectId - The indicator configuration under test.
|
|
122
|
+
* @param seriesId - The adversarial series.
|
|
123
|
+
* @returns The declaration, or `undefined` when the pair is undeclared.
|
|
124
|
+
*/
|
|
125
|
+
export declare function declaredDeviationFor(subjectId: string, seriesId: ParitySeriesId): DeclaredDeviation | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Reduce a list of emitted entries to the recorded {@link Reading}.
|
|
128
|
+
*
|
|
129
|
+
* @param entries - Everything the indicator emitted for this prefix.
|
|
130
|
+
* @returns The shape-plus-tail summary stored in the fixture.
|
|
131
|
+
*/
|
|
132
|
+
export declare function toReading(entries: readonly IndicatorEntry[]): Reading;
|
|
133
|
+
/**
|
|
134
|
+
* Whether two outcomes are identical, comparing `NaN` as equal to itself.
|
|
135
|
+
*
|
|
136
|
+
* `NaN !== NaN` would make every corrupted-series record permanently unequal to
|
|
137
|
+
* itself, which would turn the most important rows in this fixture into noise.
|
|
138
|
+
*
|
|
139
|
+
* @param a - First outcome.
|
|
140
|
+
* @param b - Second outcome.
|
|
141
|
+
* @returns Whether they describe the same result.
|
|
142
|
+
*/
|
|
143
|
+
export declare function outcomesEqual(a: Outcome, b: Outcome): boolean;
|
|
144
|
+
//# sourceMappingURL=record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/indicator-parity/record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,GAAG,WAAW,CAAC;AAEtE,mCAAmC;AACnC,wBAAgB,YAAY,CAAC,KAAK,EAA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AAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;CACzC;AAED,+BAA+B;AAC/B,MAAM,WAAW,aAAa;IAC5B,6EAA6E;IAC7E,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;CACzC;AAED,4BAA4B;AAC5B,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IAC9C,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,iBAAiB,EAoE3D,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,cAAc,GACvB,iBAAiB,GAAG,SAAS,CAI/B;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,GAAG,OAAO,CAerE;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAuB7D"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Independent reference implementations of the recursive indicators.
|
|
3
|
+
*
|
|
4
|
+
* These are written from each indicator's DEFINITION, not from the production
|
|
5
|
+
* code, and exist so the golden master is anchored to something outside the
|
|
6
|
+
* implementation it is meant to protect. A fixture generated from current
|
|
7
|
+
* output pins today's defects as the specification; a fixture checked against
|
|
8
|
+
* an independent derivation turns a defect into a visible, enumerated
|
|
9
|
+
* disagreement instead.
|
|
10
|
+
*
|
|
11
|
+
* Every function here applies the recurrence to the numbers it is given and
|
|
12
|
+
* nothing else. In particular it does NOT special-case non-finite input: if a
|
|
13
|
+
* bar is `NaN`, the recurrence carries `NaN` forward, because that is what the
|
|
14
|
+
* arithmetic says. Where production returns a plausible number from the same
|
|
15
|
+
* input, the disagreement is the finding.
|
|
16
|
+
*
|
|
17
|
+
* Each series is returned indexed by BAR, with `null` before the warm-up ends,
|
|
18
|
+
* so a value can always be traced to the bar that produced it.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Exponential moving average, seeded with the simple mean of the first
|
|
22
|
+
* `period` values and smoothed thereafter by `2 / (period + 1)`.
|
|
23
|
+
*
|
|
24
|
+
* @param values - The input series.
|
|
25
|
+
* @param period - Lookback; must be a positive integer.
|
|
26
|
+
* @returns One entry per input index; `null` before index `period - 1`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function referenceEma(values: readonly number[], period: number): (number | null)[];
|
|
29
|
+
/** One MACD reading, tied to the bar that produced it. */
|
|
30
|
+
export interface ReferenceMacdEntry {
|
|
31
|
+
/** Index of the bar this reading describes. */
|
|
32
|
+
readonly barIndex: number;
|
|
33
|
+
/** Fast EMA minus slow EMA. */
|
|
34
|
+
readonly macd: number;
|
|
35
|
+
/** EMA of the MACD line over `signalPeriod`. */
|
|
36
|
+
readonly signal: number;
|
|
37
|
+
/** `macd - signal`. */
|
|
38
|
+
readonly histogram: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* MACD from two EMAs of the closes plus an EMA of their difference.
|
|
42
|
+
*
|
|
43
|
+
* The signal line is seeded with the simple mean of the first `signalPeriod`
|
|
44
|
+
* MACD values, which is the same seeding rule the two price EMAs use — the
|
|
45
|
+
* definition is one rule applied three times, not three rules.
|
|
46
|
+
*
|
|
47
|
+
* @param closes - Close series.
|
|
48
|
+
* @param shortPeriod - Fast EMA lookback.
|
|
49
|
+
* @param longPeriod - Slow EMA lookback.
|
|
50
|
+
* @param signalPeriod - Signal EMA lookback.
|
|
51
|
+
* @returns One entry per bar that has a signal value; empty when the series is too short.
|
|
52
|
+
*/
|
|
53
|
+
export declare function referenceMacd(closes: readonly number[], shortPeriod: number, longPeriod: number, signalPeriod: number): ReferenceMacdEntry[];
|
|
54
|
+
/**
|
|
55
|
+
* Wilder's Relative Strength Index.
|
|
56
|
+
*
|
|
57
|
+
* The totality rule — a window with no losses scores 100, a window with neither
|
|
58
|
+
* gains nor losses scores the neutral 50 — is taken from the production
|
|
59
|
+
* module's own stated contract rather than invented here, since the textbook
|
|
60
|
+
* formula leaves `0 / 0` undefined. That makes agreement on the FLAT series
|
|
61
|
+
* weaker evidence than agreement on the drifting ones: it confirms the
|
|
62
|
+
* documented rule is implemented, not that the rule is the only correct one.
|
|
63
|
+
*
|
|
64
|
+
* Non-finite changes are carried forward as non-finite. A bar the feed
|
|
65
|
+
* corrupted is not a bar with zero change.
|
|
66
|
+
*
|
|
67
|
+
* @param closes - Close series.
|
|
68
|
+
* @param period - Wilder lookback.
|
|
69
|
+
* @returns One entry per bar; `null` before index `period`.
|
|
70
|
+
*/
|
|
71
|
+
export declare function referenceRsi(closes: readonly number[], period: number): (number | null)[];
|
|
72
|
+
/**
|
|
73
|
+
* Wilder's Average True Range, seeded with the simple mean of the first
|
|
74
|
+
* `period` true ranges and smoothed by `(prior * (period - 1) + tr) / period`.
|
|
75
|
+
*
|
|
76
|
+
* @param highs - High series.
|
|
77
|
+
* @param lows - Low series.
|
|
78
|
+
* @param closes - Close series.
|
|
79
|
+
* @param period - Wilder lookback.
|
|
80
|
+
* @returns One entry per bar; `null` before index `period` (the first bar has no prior close).
|
|
81
|
+
*/
|
|
82
|
+
export declare function referenceAtr(highs: readonly number[], lows: readonly number[], closes: readonly number[], period: number): (number | null)[];
|
|
83
|
+
/**
|
|
84
|
+
* RiskMetrics-style EWMA volatility: the square root of a variance seeded with
|
|
85
|
+
* the first squared return and decayed by `lambda` thereafter.
|
|
86
|
+
*
|
|
87
|
+
* @param returns - Period returns.
|
|
88
|
+
* @param lambda - Decay factor in (0, 1).
|
|
89
|
+
* @returns The EWMA standard deviation, or `null` on empty input.
|
|
90
|
+
*/
|
|
91
|
+
export declare function referenceEwmaVolatility(returns: readonly number[], lambda: number): number | null;
|
|
92
|
+
//# sourceMappingURL=reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/indicator-parity/reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,MAAM,EAAE,MAAM,GACb,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAWnB;AAED,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,uBAAuB;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,kBAAkB,EAAE,CA8BtB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,MAAM,EAAE,MAAM,GACb,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAsCnB;AAwBD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,MAAM,EAAE,MAAM,GACb,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAanB;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,MAAM,EAAE,MAAM,GACb,MAAM,GAAG,IAAI,CAOf"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The adversarial bar series the prefix-parity golden master is recorded over.
|
|
3
|
+
*
|
|
4
|
+
* Every value here is produced by integer arithmetic scaled by an exact power
|
|
5
|
+
* of two, so each close is exactly representable as a double and the series is
|
|
6
|
+
* byte-identical on every platform and every engine version. A fixture whose
|
|
7
|
+
* inputs drift is not a golden master; it is a slow-moving flake.
|
|
8
|
+
*
|
|
9
|
+
* The four shapes are chosen for what they do to a RECURSION, not for realism:
|
|
10
|
+
* a constant series drives every difference-based indicator onto its `0 / 0`
|
|
11
|
+
* branch, a jump series makes the warm-up window decide the answer, and the
|
|
12
|
+
* non-finite series ask whether a corrupted bar propagates loudly or is
|
|
13
|
+
* silently absorbed into a plausible number.
|
|
14
|
+
*/
|
|
15
|
+
import type { MassivePriceData } from "../../types/massive-types";
|
|
16
|
+
/**
|
|
17
|
+
* One bar of the synthetic series.
|
|
18
|
+
*
|
|
19
|
+
* This is the production bar type, not a local stand-in: an indicator that
|
|
20
|
+
* silently started reading a field the harness does not populate would be
|
|
21
|
+
* caught by the compiler here rather than by a wrong number in a fixture. The
|
|
22
|
+
* `date` carries the bar's index (`d<index>`) so an emitted value can be traced
|
|
23
|
+
* back to the bar that produced it.
|
|
24
|
+
*/
|
|
25
|
+
export type ParityBar = MassivePriceData;
|
|
26
|
+
/** Identifier of one adversarial series. */
|
|
27
|
+
export type ParitySeriesId = "flat" | "gaps" | "nan" | "inf";
|
|
28
|
+
/** Bars in the longest series recorded. Prefixes are taken from its front. */
|
|
29
|
+
export declare const SERIES_LENGTH = 60;
|
|
30
|
+
/** Shortest prefix recorded. Below this no indicator under test emits anything. */
|
|
31
|
+
export declare const MIN_PREFIX = 5;
|
|
32
|
+
/**
|
|
33
|
+
* Build the full bar series for one adversarial shape.
|
|
34
|
+
*
|
|
35
|
+
* High and low are derived from the close by exact eighths, so a corrupted
|
|
36
|
+
* close corrupts the whole bar — which is what a corrupted feed actually does,
|
|
37
|
+
* and what makes the true-range recursions see the same defect the close-based
|
|
38
|
+
* ones see.
|
|
39
|
+
*
|
|
40
|
+
* @param id - Which series to build.
|
|
41
|
+
* @returns `SERIES_LENGTH` bars.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildSeries(id: ParitySeriesId): ParityBar[];
|
|
44
|
+
/** Every adversarial series, in recording order. */
|
|
45
|
+
export declare const PARITY_SERIES_IDS: readonly ParitySeriesId[];
|
|
46
|
+
/**
|
|
47
|
+
* Every prefix length recorded, shortest first.
|
|
48
|
+
*
|
|
49
|
+
* @returns Lengths from {@link MIN_PREFIX} through {@link SERIES_LENGTH}.
|
|
50
|
+
*/
|
|
51
|
+
export declare function prefixLengths(): number[];
|
|
52
|
+
/**
|
|
53
|
+
* Simple period returns from a close series, used by the volatility recursion.
|
|
54
|
+
*
|
|
55
|
+
* A zero prior close would make the return undefined; none of these series
|
|
56
|
+
* contains one, and the guard states that rather than silently substituting a
|
|
57
|
+
* value if a future series ever does.
|
|
58
|
+
*
|
|
59
|
+
* @param closes - The close series.
|
|
60
|
+
* @returns `closes.length - 1` returns.
|
|
61
|
+
* @throws When a prior close is exactly zero.
|
|
62
|
+
*/
|
|
63
|
+
export declare function simpleReturns(closes: readonly number[]): number[];
|
|
64
|
+
//# sourceMappingURL=series.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"series.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/indicator-parity/series.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAEzC,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAE7D,8EAA8E;AAC9E,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC,mFAAmF;AACnF,eAAO,MAAM,UAAU,IAAI,CAAC;AA6F5B;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,cAAc,GAAG,SAAS,EAAE,CAyB3D;AAED,oDAAoD;AACpD,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAKtD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAIxC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAUjE"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The inventory of recursive indicators under prefix-parity protection.
|
|
3
|
+
*
|
|
4
|
+
* "Recursive" here means the value at bar N is computed from the indicator's
|
|
5
|
+
* own value at bar N-1. That property is what makes these functions sensitive
|
|
6
|
+
* to how much history they are handed: a restart that refills a short buffer
|
|
7
|
+
* seeds the recursion somewhere else, and the value that comes out is a
|
|
8
|
+
* different number with the same name. Window statistics (Bollinger,
|
|
9
|
+
* Stochastic, realized volatility) recompute from scratch over a fixed slice
|
|
10
|
+
* and are deliberately out of scope.
|
|
11
|
+
*
|
|
12
|
+
* Each subject exposes the production call and the independent reference call
|
|
13
|
+
* in one shape — bar index plus named components — so the two can be compared
|
|
14
|
+
* row for row.
|
|
15
|
+
*
|
|
16
|
+
* The output QUANTISER is shared with production on purpose. `roundToPriceScale`
|
|
17
|
+
* and the RSI's two-decimal rounding are presentation decisions the production
|
|
18
|
+
* module states explicitly; reproducing them in the reference keeps the
|
|
19
|
+
* comparison about the recursion rather than about display precision, which is
|
|
20
|
+
* the part a warm-up defect actually corrupts.
|
|
21
|
+
*/
|
|
22
|
+
import type { IndicatorEntry } from "./record";
|
|
23
|
+
import { type ParityBar } from "./series";
|
|
24
|
+
/** One indicator configuration, with both implementations of it. */
|
|
25
|
+
export interface ParitySubject {
|
|
26
|
+
/** Stable id used by the fixture and the deviation inventory. */
|
|
27
|
+
readonly id: string;
|
|
28
|
+
/** What this configuration is and why it is recorded. */
|
|
29
|
+
readonly description: string;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the call emits one entry per bar (true) or only the newest value
|
|
32
|
+
* (false).
|
|
33
|
+
*
|
|
34
|
+
* Only a bar-indexed series can be checked for prefix parity positionally: a
|
|
35
|
+
* scalar call attributes its single reading to whatever the last bar of the
|
|
36
|
+
* prefix happens to be, so its entry list shifts with the prefix by design.
|
|
37
|
+
* Scalar subjects are checked instead against the series primitive they
|
|
38
|
+
* delegate to.
|
|
39
|
+
*/
|
|
40
|
+
readonly emitsSeries: boolean;
|
|
41
|
+
/** The production call. May throw; a throw is part of the record. */
|
|
42
|
+
readonly production: (bars: readonly ParityBar[]) => IndicatorEntry[];
|
|
43
|
+
/** The independent reference call. May throw. */
|
|
44
|
+
readonly reference: (bars: readonly ParityBar[]) => IndicatorEntry[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Every recursive indicator configuration recorded by the golden master.
|
|
48
|
+
*
|
|
49
|
+
* Both a defect-free configuration and the defaults consumers actually use are
|
|
50
|
+
* recorded for the EMA and MACD families, because the warm-up defect only
|
|
51
|
+
* appears when one period is shorter than the other — recording only the clean
|
|
52
|
+
* configuration would leave the live one unprotected.
|
|
53
|
+
*/
|
|
54
|
+
export declare const PARITY_SUBJECTS: readonly ParitySubject[];
|
|
55
|
+
//# sourceMappingURL=subjects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subjects.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/indicator-parity/subjects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAiBH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAiDzD,oEAAoE;AACpE,MAAM,WAAW,aAAa;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,qEAAqE;IACrE,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,KAAK,cAAc,EAAE,CAAC;IACtE,iDAAiD;IACjD,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,KAAK,cAAc,EAAE,CAAC;CACtE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EA6NnD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-side accessors for {@link SampleStatistic} results.
|
|
3
|
+
*
|
|
4
|
+
* The union deliberately has no way to read a value without first proving the
|
|
5
|
+
* statistic exists. These helpers keep that proof in one place so assertions
|
|
6
|
+
* stay about the arithmetic, and so a test that expected a measurement and got
|
|
7
|
+
* an absence fails on that fact rather than on a downstream `undefined`.
|
|
8
|
+
*/
|
|
9
|
+
import type { SampleStatistic } from "../../sample-statistic";
|
|
10
|
+
/**
|
|
11
|
+
* The measured value, or a failure naming why there was none.
|
|
12
|
+
*
|
|
13
|
+
* @param statistic - The result under test.
|
|
14
|
+
* @returns The measured value.
|
|
15
|
+
* @throws When the statistic is the unavailable branch.
|
|
16
|
+
*/
|
|
17
|
+
export declare function measured<T>(statistic: SampleStatistic<T>): T;
|
|
18
|
+
//# sourceMappingURL=statistic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statistic.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/support/statistic.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAO5D"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export declare const createAlpacaMarketDataAPI: () => AlpacaMarketDataAPI;
|
|
|
43
43
|
export * from "./alpaca";
|
|
44
44
|
export { createBrokerClient, type BrokerClientConfig, type BrokerTradingClient, type BrokerValidatedCredentials, } from "./broker";
|
|
45
45
|
export * as tradingPolicy from "./trading-policy";
|
|
46
|
+
export { availableStatistic, isAvailable, sampleCohort, unavailableStatistic, type AvailableStatistic, type SampleCohort, type SampleStatistic, type StatisticUnavailableReason, type UnavailableStatistic, } from "./sample-statistic";
|
|
46
47
|
export * as atr from "./atr";
|
|
47
48
|
export * as volatility from "./volatility";
|
|
48
49
|
export * as risk from "./risk-metrics";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,iBAAiB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iD;;QAEjD,8BAA8B;;QAE9B,+BAA+B;;QAE/B,4CAA4C;;;;;;;QAE5C,mDAAmD;;;;;QAEnD,+CAA+C;;QAI/C,+CAA+C;;;;;;;;QAQ/C,wCAAwC;;QAExC,+DAA+D;;QAE/D,mEAAmE;;QAEnE,sEAAsE;;QAEtE,kDAAkD;;;;QAIlD,4CAA4C;;;;;;;kBAvVlC,CAAC;;;iBA2HiB,CAAC;eACnB,CAAC;iBAAiB,CAAC;kBAClB,CAAC;gBACT,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAyJoD,CAAC;;;kBA2Lu7a,CAAC;oBAAsB,CAAC;sBAAyB,CAAC;;;kBA/Flhb,CAAC;;;kBA+F0V,CAAC;;;kBAAq9oB,CAAC;qBAAuB,CAAC;uBAAkC,CAAC;wBAAmC,CAAC;uBAAkC,CAAC;wBAAmC,CAAC;iBAA4B,CAAC;iBAA2B,CAAC;gBAAkB,CAAC;;;;;eAAhniB,CAAC;;;iBAAiE,CAAC;oBAAsB,CAAC;;kBAAoC,CAAC;;;;;eAA+1M,CAAC;;;iBAAiE,CAAC;oBAAsB,CAAC;;kBAAoC,CAAC;;;;;kBAAghO,CAAC;oBAAsB,CAAC;;;;;;kBAvXtjjB,CAAC;;;kBAsEjB,CAAC;;;kBAkDC,CAAC;;;kBAyDH,CAAC;;;kBA6CoB,CAAC;gBAClB,CAAC;iBACP,CAAC;iBAAmB,CAAC;gBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAoIzC;;;WAGG;;QAEH;;;;WAIG;;;;;;;;;;;CASqB,CAAC"}
|
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import { Bar, BenchmarkBar } from "./types/alpaca-types";
|
|
2
2
|
import { types } from "@adaptic/backend";
|
|
3
3
|
import { CalculateBetaResult, TradeMetrics } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Beta of a portfolio against a benchmark, from paired period returns.
|
|
6
|
+
*
|
|
7
|
+
* Non-finite rows are dropped pairwise — a return that is `NaN` on either leg
|
|
8
|
+
* cannot contribute to a covariance — and the count that survives is reported
|
|
9
|
+
* as the cohort rather than discarded. That reporting is the point: silently
|
|
10
|
+
* computing a beta on the 12 rows that happened to be clean, and returning it
|
|
11
|
+
* with the same shape as a beta over all 900, is how a statistic measured on
|
|
12
|
+
* one population gets applied to another.
|
|
13
|
+
*
|
|
14
|
+
* When beta cannot be computed the result is the unavailable branch, never a
|
|
15
|
+
* numeric stand-in. A beta of `0` asserts that the portfolio does not move with
|
|
16
|
+
* the market, which is a strong and consequential claim; emitting it to mean
|
|
17
|
+
* "we could not tell" makes every alpha derived from it wrong by the whole
|
|
18
|
+
* benchmark term.
|
|
19
|
+
*
|
|
20
|
+
* @param portfolioReturns - Portfolio period returns.
|
|
21
|
+
* @param benchmarkReturns - Benchmark period returns, index-aligned to the portfolio.
|
|
22
|
+
* @returns The beta components with their cohort, or a typed unavailable result.
|
|
23
|
+
* @example
|
|
24
|
+
* const result = calculateBetaFromReturns([0.05, -0.02, 0.03], [0.03, -0.01, 0.02]);
|
|
25
|
+
* if (result.available) {
|
|
26
|
+
* // result.value.beta, alongside result.sampleCount and result.coverage
|
|
27
|
+
* }
|
|
28
|
+
*/
|
|
4
29
|
export declare function calculateBetaFromReturns(portfolioReturns: number[], benchmarkReturns: number[]): CalculateBetaResult;
|
|
5
30
|
/**
|
|
6
31
|
* Calculate max drawdown taking position type into account
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-calcs.d.ts","sourceRoot":"","sources":["../../src/metrics-calcs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"metrics-calcs.d.ts","sourceRoot":"","sources":["../../src/metrics-calcs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA0I5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,wBAAwB,CACtC,gBAAgB,EAAE,MAAM,EAAE,EAC1B,gBAAgB,EAAE,MAAM,EAAE,GACzB,mBAAmB,CA6FrB;AA6QD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,GAAG,EAAE,EAChB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,MAAM,CAAC,CAmCjB;AA8CD,wBAA8B,iBAAiB,CAC7C,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,GAAG,EAAE,EAChB,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,YAAY,CAAC,CA0DvB"}
|
|
@@ -78,10 +78,22 @@ export declare function alignReturnsByDate(portfolioHistory: PortfolioHistory, b
|
|
|
78
78
|
alignedBenchmarkReturns: number[];
|
|
79
79
|
};
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
81
|
+
* Beta of a portfolio against a benchmark, from paired period returns.
|
|
82
|
+
*
|
|
83
|
+
* The two series are index-aligned pairs by contract: every mean, covariance
|
|
84
|
+
* and variance below is taken over the SAME row set. A length mismatch is
|
|
85
|
+
* therefore reported as invalid input rather than absorbed, because dividing
|
|
86
|
+
* one series' sum by the other series' length produces a mean of a population
|
|
87
|
+
* that does not exist — a number with no cohort, which is the failure this
|
|
88
|
+
* return type exists to make impossible.
|
|
89
|
+
*
|
|
90
|
+
* An uncomputable beta is returned as the unavailable branch, never as `0`.
|
|
91
|
+
* Zero beta is a claim of no market exposure, and downstream alpha attributes
|
|
92
|
+
* the entire benchmark move to the strategy when it believes that claim.
|
|
93
|
+
*
|
|
94
|
+
* @param portfolioReturns - Portfolio period returns.
|
|
95
|
+
* @param benchmarkReturns - Benchmark period returns, index-aligned to the portfolio.
|
|
96
|
+
* @returns The beta components with their cohort, or a typed unavailable result.
|
|
85
97
|
*/
|
|
86
98
|
export declare function calculateBetaFromReturns(portfolioReturns: number[], benchmarkReturns: number[]): CalculateBetaResult;
|
|
87
99
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performance-metrics.d.ts","sourceRoot":"","sources":["../../src/performance-metrics.ts"],"names":[],"mappings":"AASA,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACZ,mBAAmB,EAEnB,uBAAuB,EACvB,UAAU,EAEX,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"performance-metrics.d.ts","sourceRoot":"","sources":["../../src/performance-metrics.ts"],"names":[],"mappings":"AASA,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACZ,mBAAmB,EAEnB,uBAAuB,EACvB,UAAU,EAEX,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;AAqD/B;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,SAAS,EACT,MAAM,EACN,aAAa,GACd,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiF3C;AAwBD;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,MAAM,CAAC,CA2CjB;AAqMD;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,gBAAgB,EAAE,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