openplanter 0.2.3 → 0.2.5
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/README.md +290 -50
- package/dist/investigation-tools/asx-calendar-fetcher.d.ts +3 -16
- package/dist/investigation-tools/asx-calendar-fetcher.d.ts.map +1 -1
- package/dist/investigation-tools/asx-calendar-fetcher.js +121 -129
- package/dist/investigation-tools/asx-calendar-fetcher.js.map +1 -1
- package/dist/investigation-tools/bulk-asx-announcements.d.ts +2 -26
- package/dist/investigation-tools/bulk-asx-announcements.d.ts.map +1 -1
- package/dist/investigation-tools/bulk-asx-announcements.js +48 -95
- package/dist/investigation-tools/bulk-asx-announcements.js.map +1 -1
- package/dist/investigation-tools/price-fetcher.d.ts +1 -27
- package/dist/investigation-tools/price-fetcher.d.ts.map +1 -1
- package/dist/investigation-tools/price-fetcher.js +39 -76
- package/dist/investigation-tools/price-fetcher.js.map +1 -1
- package/dist/investigation-tools/shared.d.ts +2 -1
- package/dist/investigation-tools/shared.d.ts.map +1 -1
- package/dist/investigation-tools/shared.js +5 -1
- package/dist/investigation-tools/shared.js.map +1 -1
- package/dist/investigation-tools/volume-scanner.d.ts +0 -31
- package/dist/investigation-tools/volume-scanner.d.ts.map +1 -1
- package/dist/investigation-tools/volume-scanner.js +24 -86
- package/dist/investigation-tools/volume-scanner.js.map +1 -1
- package/package.json +3 -2
|
@@ -2,23 +2,20 @@
|
|
|
2
2
|
* bulk-asx-announcements.ts — Bulk ASX Announcement Fetcher
|
|
3
3
|
*
|
|
4
4
|
* Fetches recent ASX announcements (Appendix 3Y director trades, 4C cashflow
|
|
5
|
-
* reports, 3B issue of securities) for multiple tickers
|
|
6
|
-
*
|
|
5
|
+
* reports, 3B issue of securities) for multiple tickers via the ASX Markit
|
|
6
|
+
* Digital API. Returns structured announcement records.
|
|
7
7
|
*/
|
|
8
|
-
import { fetchJson, normalizeTicker, sleep, DEFAULT_USER_AGENT, } from "./shared.js";
|
|
8
|
+
import { fetchJson, normalizeTicker, isValidTicker, sleep, DEFAULT_USER_AGENT, } from "./shared.js";
|
|
9
9
|
// ── Constants ───────────────────────────────────────────────────
|
|
10
|
-
const
|
|
11
|
-
const ASX_BASE_URL = "https://www.asx.com.au";
|
|
10
|
+
const ASX_MARKIT_API = "https://asx.api.markitdigital.com/asx-research/1.0/companies/{ticker}/announcements";
|
|
12
11
|
const REQUEST_DELAY_MS = 1000;
|
|
13
|
-
const MAX_PAGES_PER_TICKER =
|
|
12
|
+
const MAX_PAGES_PER_TICKER = 5;
|
|
14
13
|
const PAGE_SIZE = 20;
|
|
15
|
-
/** All supported type codes. */
|
|
16
14
|
export const ALL_TYPE_CODES = [
|
|
17
15
|
"3Y",
|
|
18
16
|
"4C",
|
|
19
17
|
"3B",
|
|
20
18
|
];
|
|
21
|
-
/** Mapping of announcement type codes to search keywords. */
|
|
22
19
|
const TYPE_KEYWORDS = {
|
|
23
20
|
"3Y": ["appendix 3y", "change of director", "director's interest"],
|
|
24
21
|
"4C": [
|
|
@@ -29,71 +26,43 @@ const TYPE_KEYWORDS = {
|
|
|
29
26
|
],
|
|
30
27
|
"3B": ["appendix 3b", "issue of securities", "new issue"],
|
|
31
28
|
};
|
|
29
|
+
const TYPE_ANNOUNCEMENT_TYPES = {
|
|
30
|
+
"3Y": ["DIRECTOR APPOINTMENT/RESIGNATION", "CHANGE IN SUBSTANTIAL HOLDING"],
|
|
31
|
+
"4C": ["QUARTERLY ACTIVITIES REPORT", "QUARTERLY CASHFLOW REPORT"],
|
|
32
|
+
"3B": ["ISSUE OF SECURITIES"],
|
|
33
|
+
};
|
|
32
34
|
// ── Helpers ─────────────────────────────────────────────────────
|
|
33
|
-
/**
|
|
34
|
-
* Parse common ASX date strings into YYYY-MM-DD format.
|
|
35
|
-
* Returns the original string if no format matches.
|
|
36
|
-
*/
|
|
37
35
|
function isoDate(raw) {
|
|
38
36
|
const trimmed = raw.trim();
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
parse: (m) => new Date(trimmed),
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
re: /^(\d{4})-(\d{2})-(\d{2})$/,
|
|
46
|
-
parse: (m) => new Date(+m[1], +m[2] - 1, +m[3]),
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
re: /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/,
|
|
50
|
-
parse: (m) => new Date(+m[3], +m[2] - 1, +m[1]),
|
|
51
|
-
},
|
|
52
|
-
];
|
|
53
|
-
for (const fmt of formats) {
|
|
54
|
-
const m = trimmed.match(fmt.re);
|
|
55
|
-
if (m) {
|
|
56
|
-
const d = fmt.parse(m);
|
|
57
|
-
if (!isNaN(d.getTime())) {
|
|
58
|
-
return d.toISOString().slice(0, 10);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
37
|
+
const d = new Date(trimmed);
|
|
38
|
+
if (!isNaN(d.getTime())) {
|
|
39
|
+
return d.toISOString().slice(0, 10);
|
|
61
40
|
}
|
|
62
41
|
return trimmed;
|
|
63
42
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*/
|
|
68
|
-
function matchAnnouncementType(title, requestedTypes) {
|
|
69
|
-
const lower = title.toLowerCase();
|
|
43
|
+
function matchAnnouncementType(headline, announcementType, requestedTypes) {
|
|
44
|
+
const lowerHeadline = headline.toLowerCase();
|
|
45
|
+
const upperType = announcementType.toUpperCase();
|
|
70
46
|
for (const typeCode of requestedTypes) {
|
|
47
|
+
const typeMatches = TYPE_ANNOUNCEMENT_TYPES[typeCode] ?? [];
|
|
48
|
+
for (const tm of typeMatches) {
|
|
49
|
+
if (upperType.includes(tm))
|
|
50
|
+
return typeCode;
|
|
51
|
+
}
|
|
71
52
|
const keywords = TYPE_KEYWORDS[typeCode] ?? [];
|
|
72
53
|
for (const kw of keywords) {
|
|
73
|
-
if (
|
|
54
|
+
if (lowerHeadline.includes(kw))
|
|
74
55
|
return typeCode;
|
|
75
56
|
}
|
|
76
57
|
}
|
|
77
58
|
return null;
|
|
78
59
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
* Returns the URL as-is if it is already absolute.
|
|
82
|
-
*/
|
|
83
|
-
function resolveUrl(docUrl) {
|
|
84
|
-
if (!docUrl)
|
|
60
|
+
function buildDocumentUrl(documentKey) {
|
|
61
|
+
if (!documentKey)
|
|
85
62
|
return "";
|
|
86
|
-
|
|
87
|
-
return docUrl;
|
|
88
|
-
return ASX_BASE_URL + docUrl;
|
|
63
|
+
return `https://www.asx.com.au/asx/v2/statistics/displayAnnouncement.do?display=pdf&idsId=${documentKey}`;
|
|
89
64
|
}
|
|
90
65
|
// ── Core Fetching ───────────────────────────────────────────────
|
|
91
|
-
/**
|
|
92
|
-
* Fetch announcements for a single ticker from the ASX API.
|
|
93
|
-
*
|
|
94
|
-
* Paginates up to {@link MAX_PAGES_PER_TICKER} pages and returns records
|
|
95
|
-
* whose titles match the requested types within the date window.
|
|
96
|
-
*/
|
|
97
66
|
export async function fetchAnnouncementsForTicker(ticker, opts = {}) {
|
|
98
67
|
const requestedTypes = opts.types ?? [...ALL_TYPE_CODES];
|
|
99
68
|
const daysBack = opts.daysBack ?? 90;
|
|
@@ -101,73 +70,61 @@ export async function fetchAnnouncementsForTicker(ticker, opts = {}) {
|
|
|
101
70
|
const cutoff = new Date(Date.now() - daysBack * 24 * 60 * 60 * 1000);
|
|
102
71
|
const results = [];
|
|
103
72
|
const normalised = normalizeTicker(ticker);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
const fullUrl = `${url}?${params.toString()}`;
|
|
73
|
+
if (!isValidTicker(normalised)) {
|
|
74
|
+
console.warn(`[warn] Skipping invalid ticker: ${ticker}`);
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
const baseUrl = ASX_MARKIT_API.replace("{ticker}", normalised);
|
|
78
|
+
for (let page = 0; page < MAX_PAGES_PER_TICKER; page++) {
|
|
79
|
+
const start = page * PAGE_SIZE;
|
|
80
|
+
const url = `${baseUrl}?count=${PAGE_SIZE}&start=${start}`;
|
|
114
81
|
let data;
|
|
115
82
|
try {
|
|
116
|
-
data = await fetchJson(
|
|
83
|
+
data = await fetchJson(url, {
|
|
117
84
|
delay: delayMs / 1000,
|
|
118
85
|
userAgent: DEFAULT_USER_AGENT,
|
|
119
86
|
});
|
|
120
87
|
}
|
|
121
88
|
catch {
|
|
122
|
-
// API error – stop paging for this ticker
|
|
123
89
|
break;
|
|
124
90
|
}
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
: data.data ?? [];
|
|
128
|
-
if (announcements.length === 0)
|
|
91
|
+
const items = data.data?.items ?? [];
|
|
92
|
+
if (items.length === 0)
|
|
129
93
|
break;
|
|
130
94
|
let reachedCutoff = false;
|
|
131
|
-
for (const
|
|
132
|
-
const annDateRaw =
|
|
95
|
+
for (const item of items) {
|
|
96
|
+
const annDateRaw = item.date ?? "";
|
|
133
97
|
const annDate = isoDate(annDateRaw);
|
|
134
|
-
const
|
|
135
|
-
const
|
|
136
|
-
|
|
98
|
+
const headline = item.headline ?? "";
|
|
99
|
+
const annType = item.announcementType ?? "";
|
|
100
|
+
const docKey = item.documentKey ?? "";
|
|
101
|
+
const docUrl = item.url || buildDocumentUrl(docKey);
|
|
137
102
|
const annDt = new Date(annDate);
|
|
138
103
|
if (!isNaN(annDt.getTime()) && annDt < cutoff) {
|
|
139
104
|
reachedCutoff = true;
|
|
140
105
|
break;
|
|
141
106
|
}
|
|
142
|
-
|
|
143
|
-
const matchedType = matchAnnouncementType(title, requestedTypes);
|
|
107
|
+
const matchedType = matchAnnouncementType(headline, annType, requestedTypes);
|
|
144
108
|
if (matchedType === null)
|
|
145
109
|
continue;
|
|
146
|
-
const fileSize =
|
|
110
|
+
const fileSize = item.fileSize ?? null;
|
|
147
111
|
results.push({
|
|
148
112
|
ticker: normalised,
|
|
149
113
|
announcement_type: matchedType,
|
|
150
114
|
date: annDate || null,
|
|
151
|
-
title,
|
|
115
|
+
title: headline,
|
|
152
116
|
url: docUrl,
|
|
153
|
-
file_size: fileSize
|
|
117
|
+
file_size: fileSize,
|
|
154
118
|
});
|
|
155
119
|
}
|
|
156
|
-
if (reachedCutoff ||
|
|
120
|
+
if (reachedCutoff || items.length < PAGE_SIZE)
|
|
157
121
|
break;
|
|
158
|
-
|
|
159
|
-
if (page < MAX_PAGES_PER_TICKER) {
|
|
122
|
+
if (page < MAX_PAGES_PER_TICKER - 1) {
|
|
160
123
|
await sleep(delayMs);
|
|
161
124
|
}
|
|
162
125
|
}
|
|
163
126
|
return results;
|
|
164
127
|
}
|
|
165
|
-
/**
|
|
166
|
-
* Bulk-fetch announcements for multiple tickers.
|
|
167
|
-
*
|
|
168
|
-
* Fetches sequentially with rate-limiting between tickers to respect
|
|
169
|
-
* ASX API fair-use expectations.
|
|
170
|
-
*/
|
|
171
128
|
export async function fetchBulkAnnouncements(tickers, opts = {}) {
|
|
172
129
|
const delayMs = opts.delayMs ?? REQUEST_DELAY_MS;
|
|
173
130
|
const allRecords = [];
|
|
@@ -184,16 +141,12 @@ export async function fetchBulkAnnouncements(tickers, opts = {}) {
|
|
|
184
141
|
if (opts.onProgress) {
|
|
185
142
|
opts.onProgress(ticker, records.length, allRecords.length);
|
|
186
143
|
}
|
|
187
|
-
// Rate limit between tickers
|
|
188
144
|
if (i < tickers.length - 1) {
|
|
189
145
|
await sleep(delayMs);
|
|
190
146
|
}
|
|
191
147
|
}
|
|
192
148
|
return allRecords;
|
|
193
149
|
}
|
|
194
|
-
/**
|
|
195
|
-
* Parse a comma-separated ticker string into an array of normalised tickers.
|
|
196
|
-
*/
|
|
197
150
|
export function parseTickers(raw) {
|
|
198
151
|
return raw
|
|
199
152
|
.split(",")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk-asx-announcements.js","sourceRoot":"","sources":["../../src/investigation-tools/bulk-asx-announcements.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,SAAS,EACT,eAAe,
|
|
1
|
+
{"version":3,"file":"bulk-asx-announcements.js","sourceRoot":"","sources":["../../src/investigation-tools/bulk-asx-announcements.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,KAAK,EACL,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,mEAAmE;AAEnE,MAAM,cAAc,GAClB,qFAAqF,CAAC;AAExF,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,SAAS,GAAG,EAAE,CAAC;AAIrB,MAAM,CAAC,MAAM,cAAc,GAAuC;IAChE,IAAI;IACJ,IAAI;IACJ,IAAI;CACI,CAAC;AAEX,MAAM,aAAa,GAA8C;IAC/D,IAAI,EAAE,CAAC,aAAa,EAAE,oBAAoB,EAAE,qBAAqB,CAAC;IAClE,IAAI,EAAE;QACJ,aAAa;QACb,qBAAqB;QACrB,oBAAoB;QACpB,sBAAsB;KACvB;IACD,IAAI,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,WAAW,CAAC;CAC1D,CAAC;AAEF,MAAM,uBAAuB,GAA8C;IACzE,IAAI,EAAE,CAAC,kCAAkC,EAAE,+BAA+B,CAAC;IAC3E,IAAI,EAAE,CAAC,6BAA6B,EAAE,2BAA2B,CAAC;IAClE,IAAI,EAAE,CAAC,qBAAqB,CAAC;CAC9B,CAAC;AA2CF,mEAAmE;AAEnE,SAAS,OAAO,CAAC,GAAW;IAC1B,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5B,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QACxB,O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ahoo-finance2 for Australian (ASX)
|
|
5
5
|
* tickers, computes derived metrics, and flags trading anomalies.
|
|
6
6
|
*/
|
|
7
|
-
/** Raw OHLCV bar from Yahoo Finance. */
|
|
8
7
|
export interface OhlcvBar {
|
|
9
8
|
date: string;
|
|
10
9
|
open: number;
|
|
@@ -13,7 +12,6 @@ export interface OhlcvBar {
|
|
|
13
12
|
close: number;
|
|
14
13
|
volume: number;
|
|
15
14
|
}
|
|
16
|
-
/** OHLCV bar with computed metrics and anomaly flags. */
|
|
17
15
|
export interface PriceMetrics {
|
|
18
16
|
ticker: string;
|
|
19
17
|
date: string;
|
|
@@ -28,7 +26,6 @@ export interface PriceMetrics {
|
|
|
28
26
|
gapPct: number | null;
|
|
29
27
|
anomalyFlags: string[];
|
|
30
28
|
}
|
|
31
|
-
/** Per-ticker summary of the requested period. */
|
|
32
29
|
export interface TickerSummary {
|
|
33
30
|
ticker: string;
|
|
34
31
|
avgVolume: number;
|
|
@@ -51,31 +48,8 @@ export declare const ROLLING_VOLATILITY_WINDOW = 20;
|
|
|
51
48
|
export declare const VOLATILITY_BASELINE_WINDOW = 60;
|
|
52
49
|
export declare const VALID_PERIODS: Set<string>;
|
|
53
50
|
export declare const VALID_INTERVALS: Set<string>;
|
|
54
|
-
/**
|
|
55
|
-
* Fetch OHLCV data from Yahoo Finance for the given ASX tickers.
|
|
56
|
-
*
|
|
57
|
-
* Each ticker is automatically suffixed with `.AX` if needed.
|
|
58
|
-
* Returns a mapping of clean ticker → OhlcvBar[].
|
|
59
|
-
*/
|
|
60
51
|
export declare function fetchOhlcv(tickers: string[], period?: string, interval?: string): Promise<Map<string, OhlcvBar[]>>;
|
|
61
|
-
/**
|
|
62
|
-
* Compute derived metrics and anomaly flags for an array of OHLCV bars.
|
|
63
|
-
*
|
|
64
|
-
* Metrics:
|
|
65
|
-
* - `dailyReturnPct`: percentage change in close vs previous close
|
|
66
|
-
* - `volumeRatio`: current volume / 20-day rolling mean volume
|
|
67
|
-
* - `volatility`: 20-day rolling sample std of daily returns
|
|
68
|
-
* - `gapPct`: percentage gap between open and previous close
|
|
69
|
-
* - `anomalyFlags`: list of triggered threshold names
|
|
70
|
-
*/
|
|
71
52
|
export declare function computeMetrics(ticker: string, bars: OhlcvBar[]): PriceMetrics[];
|
|
72
|
-
/**
|
|
73
|
-
* Merge per-ticker data into a flat array of PriceMetrics.
|
|
74
|
-
* Optionally filter to only rows with at least one anomaly flag.
|
|
75
|
-
*/
|
|
76
53
|
export declare function buildOutput(allData: Map<string, OhlcvBar[]>, anomaliesOnly?: boolean): PriceMetrics[];
|
|
77
|
-
/**
|
|
78
|
-
* Produce a per-ticker summary from OHLCV data.
|
|
79
|
-
*/
|
|
80
54
|
export declare function buildSummary(allData: Map<string, OhlcvBar[]>): TickerSummary[];
|
|
81
55
|
//# sourceMappingURL=price-fetcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"price-fetcher.d.ts","sourceRoot":"","sources":["../../src/investigation-tools/price-fetcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"price-fetcher.d.ts","sourceRoot":"","sources":["../../src/investigation-tools/price-fetcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,G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|
2
2
|
* price-fetcher.ts – ASX OHLCV price fetcher with anomaly detection.
|
|
3
3
|
*
|
|
4
|
-
* Fetches historical OHLCV data
|
|
4
|
+
* Fetches historical OHLCV data via yahoo-finance2 for Australian (ASX)
|
|
5
5
|
* tickers, computes derived metrics, and flags trading anomalies.
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import YahooFinance from "yahoo-finance2";
|
|
8
|
+
import { yahooTicker, normalizeTicker, isValidTicker, } from "./shared.js";
|
|
9
|
+
const yf = new YahooFinance();
|
|
8
10
|
// ── Constants ────────────────────────────────────────────────────
|
|
9
11
|
export const ANOMALY_THRESHOLDS = {
|
|
10
12
|
volume_spike: 2.0,
|
|
@@ -25,10 +27,6 @@ export const VALID_INTERVALS = new Set([
|
|
|
25
27
|
"1d", "5d", "1wk", "1mo", "3mo",
|
|
26
28
|
]);
|
|
27
29
|
// ── Rolling window helpers ───────────────────────────────────────
|
|
28
|
-
/**
|
|
29
|
-
* Compute the rolling mean over the last `window` entries ending at `index`.
|
|
30
|
-
* Uses min_periods=1 (returns a value as long as at least one valid entry exists).
|
|
31
|
-
*/
|
|
32
30
|
function rollingMean(values, index, window) {
|
|
33
31
|
const start = Math.max(0, index - window + 1);
|
|
34
32
|
let sum = 0;
|
|
@@ -42,10 +40,6 @@ function rollingMean(values, index, window) {
|
|
|
42
40
|
}
|
|
43
41
|
return count > 0 ? sum / count : null;
|
|
44
42
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Compute the rolling sample standard deviation over the last `window`
|
|
47
|
-
* entries ending at `index`. Requires at least 2 valid values (ddof=1).
|
|
48
|
-
*/
|
|
49
43
|
function rollingStd(values, index, window) {
|
|
50
44
|
const start = Math.max(0, index - window + 1);
|
|
51
45
|
const valid = [];
|
|
@@ -68,57 +62,49 @@ function round4(n) {
|
|
|
68
62
|
return Math.round(n * 10000) / 10000;
|
|
69
63
|
}
|
|
70
64
|
// ── Data fetching ────────────────────────────────────────────────
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const bars = [];
|
|
81
|
-
for (let i = 0; i < timestamp.length; i++) {
|
|
82
|
-
const o = quote.open[i];
|
|
83
|
-
const h = quote.high[i];
|
|
84
|
-
const l = quote.low[i];
|
|
85
|
-
const c = quote.close[i];
|
|
86
|
-
const v = quote.volume[i];
|
|
87
|
-
// Skip bars with any null OHLCV value
|
|
88
|
-
if (o == null || h == null || l == null || c == null || v == null)
|
|
89
|
-
continue;
|
|
90
|
-
const dt = new Date(timestamp[i] * 1000);
|
|
91
|
-
bars.push({
|
|
92
|
-
date: dt.toISOString().slice(0, 10),
|
|
93
|
-
open: o,
|
|
94
|
-
high: h,
|
|
95
|
-
low: l,
|
|
96
|
-
close: c,
|
|
97
|
-
volume: v,
|
|
98
|
-
});
|
|
65
|
+
function periodToDate(period) {
|
|
66
|
+
const now = new Date();
|
|
67
|
+
const map = {
|
|
68
|
+
"1d": 1, "5d": 5, "1mo": 30, "3mo": 90, "6mo": 180,
|
|
69
|
+
"1y": 365, "2y": 730, "5y": 1825, "10y": 3650,
|
|
70
|
+
};
|
|
71
|
+
const days = map[period];
|
|
72
|
+
if (days) {
|
|
73
|
+
return new Date(now.getTime() - days * 24 * 60 * 60 * 1000);
|
|
99
74
|
}
|
|
100
|
-
|
|
75
|
+
if (period === "ytd") {
|
|
76
|
+
return new Date(now.getFullYear(), 0, 1);
|
|
77
|
+
}
|
|
78
|
+
// "max"
|
|
79
|
+
return new Date("1970-01-01");
|
|
101
80
|
}
|
|
102
|
-
/**
|
|
103
|
-
* Fetch OHLCV data from Yahoo Finance for the given ASX tickers.
|
|
104
|
-
*
|
|
105
|
-
* Each ticker is automatically suffixed with `.AX` if needed.
|
|
106
|
-
* Returns a mapping of clean ticker → OhlcvBar[].
|
|
107
|
-
*/
|
|
108
81
|
export async function fetchOhlcv(tickers, period = "3mo", interval = "1d") {
|
|
109
82
|
const results = new Map();
|
|
110
83
|
for (const raw of tickers) {
|
|
84
|
+
if (!isValidTicker(raw)) {
|
|
85
|
+
console.warn(`[warn] Skipping invalid ticker: ${raw}`);
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
111
88
|
const symbol = yahooTicker(raw);
|
|
112
89
|
const clean = normalizeTicker(raw);
|
|
113
|
-
const url = `https://query1.finance.yahoo.com/v8/finance/chart/${encodeURIComponent(symbol)}` +
|
|
114
|
-
`?range=${period}&interval=${interval}`;
|
|
115
90
|
try {
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
91
|
+
const chartResult = await yf.chart(symbol, {
|
|
92
|
+
period1: periodToDate(period),
|
|
93
|
+
interval: interval,
|
|
94
|
+
});
|
|
95
|
+
const bars = [];
|
|
96
|
+
for (const q of chartResult.quotes) {
|
|
97
|
+
if (q.open == null || q.high == null || q.low == null || q.close == null || q.volume == null)
|
|
98
|
+
continue;
|
|
99
|
+
bars.push({
|
|
100
|
+
date: q.date.toISOString().slice(0, 10),
|
|
101
|
+
open: q.open,
|
|
102
|
+
high: q.high,
|
|
103
|
+
low: q.low,
|
|
104
|
+
close: q.close,
|
|
105
|
+
volume: q.volume,
|
|
106
|
+
});
|
|
120
107
|
}
|
|
121
|
-
const bars = parseChartResponse(data);
|
|
122
108
|
if (bars.length === 0) {
|
|
123
109
|
console.warn(`[warn] No data returned for ${symbol}. Skipping.`);
|
|
124
110
|
continue;
|
|
@@ -126,33 +112,21 @@ export async function fetchOhlcv(tickers, period = "3mo", interval = "1d") {
|
|
|
126
112
|
results.set(clean, bars);
|
|
127
113
|
}
|
|
128
114
|
catch (err) {
|
|
129
|
-
console.warn(`[
|
|
115
|
+
console.warn(`[warn] Failed to fetch ${symbol}: ${err}`);
|
|
130
116
|
}
|
|
131
117
|
}
|
|
132
118
|
return results;
|
|
133
119
|
}
|
|
134
120
|
// ── Derived metrics & anomaly detection ──────────────────────────
|
|
135
|
-
/**
|
|
136
|
-
* Compute derived metrics and anomaly flags for an array of OHLCV bars.
|
|
137
|
-
*
|
|
138
|
-
* Metrics:
|
|
139
|
-
* - `dailyReturnPct`: percentage change in close vs previous close
|
|
140
|
-
* - `volumeRatio`: current volume / 20-day rolling mean volume
|
|
141
|
-
* - `volatility`: 20-day rolling sample std of daily returns
|
|
142
|
-
* - `gapPct`: percentage gap between open and previous close
|
|
143
|
-
* - `anomalyFlags`: list of triggered threshold names
|
|
144
|
-
*/
|
|
145
121
|
export function computeMetrics(ticker, bars) {
|
|
146
122
|
if (bars.length === 0)
|
|
147
123
|
return [];
|
|
148
|
-
// Pre-compute daily return percentages
|
|
149
124
|
const dailyReturns = bars.map((bar, i) => {
|
|
150
125
|
if (i === 0)
|
|
151
126
|
return null;
|
|
152
127
|
const prev = bars[i - 1].close;
|
|
153
128
|
return prev !== 0 ? ((bar.close - prev) / prev) * 100.0 : null;
|
|
154
129
|
});
|
|
155
|
-
// Pre-compute gap percentages
|
|
156
130
|
const gapPcts = bars.map((bar, i) => {
|
|
157
131
|
if (i === 0)
|
|
158
132
|
return null;
|
|
@@ -161,11 +135,8 @@ export function computeMetrics(ticker, bars) {
|
|
|
161
135
|
? ((bar.open - prevClose) / prevClose) * 100.0
|
|
162
136
|
: null;
|
|
163
137
|
});
|
|
164
|
-
// Volume array for rolling calculations
|
|
165
138
|
const volumes = bars.map((b) => b.volume);
|
|
166
|
-
// Volatilities (rolling std of daily returns)
|
|
167
139
|
const volatilities = bars.map((_, i) => rollingStd(dailyReturns, i, ROLLING_VOLATILITY_WINDOW));
|
|
168
|
-
// Volatility baseline (60-day rolling mean of volatilities)
|
|
169
140
|
const volBaseline = bars.map((_, i) => rollingMean(volatilities, i, VOLATILITY_BASELINE_WINDOW));
|
|
170
141
|
return bars.map((bar, i) => {
|
|
171
142
|
const ret = dailyReturns[i];
|
|
@@ -174,7 +145,6 @@ export function computeMetrics(ticker, bars) {
|
|
|
174
145
|
const vol = volatilities[i];
|
|
175
146
|
const gp = gapPcts[i];
|
|
176
147
|
const volBl = volBaseline[i];
|
|
177
|
-
// Anomaly flags
|
|
178
148
|
const flags = [];
|
|
179
149
|
if (isFiniteNum(volumeRatio) &&
|
|
180
150
|
volumeRatio > ANOMALY_THRESHOLDS.volume_spike) {
|
|
@@ -215,10 +185,6 @@ export function computeMetrics(ticker, bars) {
|
|
|
215
185
|
});
|
|
216
186
|
}
|
|
217
187
|
// ── Output builders ──────────────────────────────────────────────
|
|
218
|
-
/**
|
|
219
|
-
* Merge per-ticker data into a flat array of PriceMetrics.
|
|
220
|
-
* Optionally filter to only rows with at least one anomaly flag.
|
|
221
|
-
*/
|
|
222
188
|
export function buildOutput(allData, anomaliesOnly = false) {
|
|
223
189
|
const rows = [];
|
|
224
190
|
for (const [ticker, bars] of allData) {
|
|
@@ -229,9 +195,6 @@ export function buildOutput(allData, anomaliesOnly = false) {
|
|
|
229
195
|
}
|
|
230
196
|
return rows;
|
|
231
197
|
}
|
|
232
|
-
/**
|
|
233
|
-
* Produce a per-ticker summary from OHLCV data.
|
|
234
|
-
*/
|
|
235
198
|
export function buildSummary(allData) {
|
|
236
199
|
const summaries = [];
|
|
237
200
|
for (const [ticker, bars] of allData) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"price-fetcher.js","sourceRoot":"","sources":["../../src/investigation-tools/price-fetcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"price-fetcher.js","sourceRoot":"","sources":["../../src/investigation-tools/price-fetcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,WAAW,EACX,eAAe,EACf,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,MAAM,EAAE,GAAG,IAAI,YAAY,EAAE,CAAC;AAsC9B,oEAAoE;AAEpE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,YAAY,EAAE,GAAG;IACj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Score(text: string): number;
|
|
|
10
10
|
export declare function sentimentLabel(score: number): string;
|
|
11
11
|
export declare function isRumor(text: string): boolean;
|
|
12
12
|
export declare function normalizeTicker(ticker: string): string;
|
|
13
|
+
export declare function isValidTicker(ticker: string): boolean;
|
|
13
14
|
export declare function yahooTicker(ticker: string): string;
|
|
14
15
|
export declare function normalizeCompany(name: string): string;
|
|
15
16
|
export declare function normalizePerson(name: string): string;
|
|
@@ -20,7 +21,7 @@ export declare function isAbn(value: string): boolean;
|
|
|
20
21
|
export declare function levenshtein(a: string, b: string): number;
|
|
21
22
|
export declare function fuzzyRatio(a: string, b: string): number;
|
|
22
23
|
export declare function tokenSortRatio(a: string, b: string): number;
|
|
23
|
-
export declare const DEFAULT_USER_AGENT = "Mozilla/5.0 (
|
|
24
|
+
export declare const DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36";
|
|
24
25
|
export declare function fetchWithDelay(url: string, opts?: {
|
|
25
26
|
delay?: number;
|
|
26
27
|
userAgent?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/investigation-tools/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAkCxD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAWnD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAE7C;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAIpD;AAID,eAAO,MAAM,gBAAgB,UAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAG5B,CAAC;AAE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