@adaptic/utils 0.1.43 → 0.1.45
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 +61 -153
- package/dist/index.cjs +5356 -60315
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5356 -60054
- package/dist/index.mjs.map +1 -1
- package/dist/test.js +361 -824
- package/dist/test.js.map +1 -1
- package/dist/types/adaptic.d.ts +2 -2
- package/dist/types/adaptic.d.ts.map +1 -1
- package/dist/types/alpaca-functions.d.ts +233 -0
- package/dist/types/alpaca-functions.d.ts.map +1 -0
- package/dist/types/alpaca-market-data-api.d.ts +9 -24
- package/dist/types/alpaca-market-data-api.d.ts.map +1 -1
- package/dist/types/alpaca-trading-api.d.ts +12 -12
- package/dist/types/alpaca-trading-api.d.ts.map +1 -1
- package/dist/types/alphavantage.d.ts +1 -1
- package/dist/types/alphavantage.d.ts.map +1 -1
- package/dist/types/asset-allocation-algorithm.d.ts +1 -7
- package/dist/types/asset-allocation-algorithm.d.ts.map +1 -1
- package/dist/types/cache/stampede-protected-cache.d.ts.map +1 -1
- package/dist/types/crypto.d.ts +4 -4
- package/dist/types/crypto.d.ts.map +1 -1
- package/dist/types/display-manager.d.ts +1 -1
- package/dist/types/display-manager.d.ts.map +1 -1
- package/dist/types/examples/asset-allocation-example.d.ts +6 -7
- package/dist/types/examples/asset-allocation-example.d.ts.map +1 -1
- package/dist/types/format-tools.d.ts.map +1 -1
- package/dist/types/index.d.ts +55 -393
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logging.d.ts +1 -1
- package/dist/types/logging.d.ts.map +1 -1
- package/dist/types/market-hours.d.ts.map +1 -1
- package/dist/types/market-time.d.ts +13 -75
- package/dist/types/market-time.d.ts.map +1 -1
- package/dist/types/metrics-calcs.d.ts.map +1 -1
- package/dist/types/misc-utils.d.ts +1 -4
- package/dist/types/misc-utils.d.ts.map +1 -1
- package/dist/types/performance-metrics.d.ts +6 -6
- package/dist/types/performance-metrics.d.ts.map +1 -1
- package/dist/types/polygon-indices.d.ts +3 -3
- package/dist/types/polygon-indices.d.ts.map +1 -1
- package/dist/types/polygon.d.ts +1 -1
- package/dist/types/polygon.d.ts.map +1 -1
- package/dist/types/price-utils.d.ts.map +1 -1
- package/dist/types/technical-analysis.d.ts +9 -9
- package/dist/types/technical-analysis.d.ts.map +1 -1
- package/dist/types/time-utils.d.ts.map +1 -1
- package/dist/types/types/adaptic-types.d.ts +1 -1
- package/dist/types/types/adaptic-types.d.ts.map +1 -1
- package/dist/types/types/alpaca-types.d.ts +89 -252
- package/dist/types/types/alpaca-types.d.ts.map +1 -1
- package/dist/types/types/alphavantage-types.d.ts +2 -2
- package/dist/types/types/asset-allocation-types.d.ts +11 -11
- package/dist/types/types/index.d.ts +8 -8
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/logging-types.d.ts +2 -2
- package/dist/types/types/logging-types.d.ts.map +1 -1
- package/dist/types/types/market-time-types.d.ts +4 -4
- package/dist/types/types/market-time-types.d.ts.map +1 -1
- package/dist/types/types/metrics-types.d.ts +4 -4
- package/dist/types/types/metrics-types.d.ts.map +1 -1
- package/dist/types/types/polygon-indices-types.d.ts +6 -6
- package/dist/types/types/polygon-types.d.ts +3 -3
- package/dist/types/types/ta-types.d.ts +3 -3
- package/package.json +6 -24
- package/dist/types/__tests__/alpaca-functions.test.d.ts +0 -2
- package/dist/types/__tests__/alpaca-functions.test.d.ts.map +0 -1
- package/dist/types/__tests__/api-endpoints.test.d.ts +0 -2
- package/dist/types/__tests__/api-endpoints.test.d.ts.map +0 -1
- package/dist/types/__tests__/asset-allocation.test.d.ts +0 -2
- package/dist/types/__tests__/asset-allocation.test.d.ts.map +0 -1
- package/dist/types/__tests__/auth-validator.test.d.ts +0 -2
- package/dist/types/__tests__/auth-validator.test.d.ts.map +0 -1
- package/dist/types/__tests__/cache.test.d.ts +0 -2
- package/dist/types/__tests__/cache.test.d.ts.map +0 -1
- package/dist/types/__tests__/errors.test.d.ts +0 -2
- package/dist/types/__tests__/errors.test.d.ts.map +0 -1
- package/dist/types/__tests__/financial-regression.test.d.ts +0 -2
- package/dist/types/__tests__/financial-regression.test.d.ts.map +0 -1
- package/dist/types/__tests__/format-tools.test.d.ts +0 -2
- package/dist/types/__tests__/format-tools.test.d.ts.map +0 -1
- package/dist/types/__tests__/http-keep-alive.test.d.ts +0 -2
- package/dist/types/__tests__/http-keep-alive.test.d.ts.map +0 -1
- package/dist/types/__tests__/http-timeout.test.d.ts +0 -2
- package/dist/types/__tests__/http-timeout.test.d.ts.map +0 -1
- package/dist/types/__tests__/logger.test.d.ts +0 -2
- package/dist/types/__tests__/logger.test.d.ts.map +0 -1
- package/dist/types/__tests__/market-time.test.d.ts +0 -2
- package/dist/types/__tests__/market-time.test.d.ts.map +0 -1
- package/dist/types/__tests__/misc-utils.test.d.ts +0 -2
- package/dist/types/__tests__/misc-utils.test.d.ts.map +0 -1
- package/dist/types/__tests__/paginator.test.d.ts +0 -2
- package/dist/types/__tests__/paginator.test.d.ts.map +0 -1
- package/dist/types/__tests__/performance-metrics.test.d.ts +0 -2
- package/dist/types/__tests__/performance-metrics.test.d.ts.map +0 -1
- package/dist/types/__tests__/polygon.test.d.ts +0 -2
- package/dist/types/__tests__/polygon.test.d.ts.map +0 -1
- package/dist/types/__tests__/price-utils.test.d.ts +0 -2
- package/dist/types/__tests__/price-utils.test.d.ts.map +0 -1
- package/dist/types/__tests__/property-based-financial.test.d.ts +0 -2
- package/dist/types/__tests__/property-based-financial.test.d.ts.map +0 -1
- package/dist/types/__tests__/rate-limiter.test.d.ts +0 -2
- package/dist/types/__tests__/rate-limiter.test.d.ts.map +0 -1
- package/dist/types/__tests__/schema-validation.test.d.ts +0 -2
- package/dist/types/__tests__/schema-validation.test.d.ts.map +0 -1
- package/dist/types/__tests__/technical-analysis.test.d.ts +0 -2
- package/dist/types/__tests__/technical-analysis.test.d.ts.map +0 -1
- package/dist/types/__tests__/time-utils.test.d.ts +0 -2
- package/dist/types/__tests__/time-utils.test.d.ts.map +0 -1
- package/dist/types/alpaca/client.d.ts +0 -95
- package/dist/types/alpaca/client.d.ts.map +0 -1
- package/dist/types/alpaca/crypto/data.d.ts +0 -281
- package/dist/types/alpaca/crypto/data.d.ts.map +0 -1
- package/dist/types/alpaca/crypto/index.d.ts +0 -75
- package/dist/types/alpaca/crypto/index.d.ts.map +0 -1
- package/dist/types/alpaca/crypto/orders.d.ts +0 -221
- package/dist/types/alpaca/crypto/orders.d.ts.map +0 -1
- package/dist/types/alpaca/index.d.ts +0 -205
- package/dist/types/alpaca/index.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/account.d.ts +0 -34
- package/dist/types/alpaca/legacy/account.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/assets.d.ts +0 -13
- package/dist/types/alpaca/legacy/assets.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/auth.d.ts +0 -18
- package/dist/types/alpaca/legacy/auth.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/index.d.ts +0 -15
- package/dist/types/alpaca/legacy/index.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/market-data.d.ts +0 -32
- package/dist/types/alpaca/legacy/market-data.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/orders.d.ts +0 -84
- package/dist/types/alpaca/legacy/orders.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/positions.d.ts +0 -66
- package/dist/types/alpaca/legacy/positions.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/utils.d.ts +0 -18
- package/dist/types/alpaca/legacy/utils.d.ts.map +0 -1
- package/dist/types/alpaca/market-data/bars.d.ts +0 -142
- package/dist/types/alpaca/market-data/bars.d.ts.map +0 -1
- package/dist/types/alpaca/market-data/index.d.ts +0 -13
- package/dist/types/alpaca/market-data/index.d.ts.map +0 -1
- package/dist/types/alpaca/market-data/news.d.ts +0 -87
- package/dist/types/alpaca/market-data/news.d.ts.map +0 -1
- package/dist/types/alpaca/market-data/quotes.d.ts +0 -85
- package/dist/types/alpaca/market-data/quotes.d.ts.map +0 -1
- package/dist/types/alpaca/market-data/trades.d.ts +0 -98
- package/dist/types/alpaca/market-data/trades.d.ts.map +0 -1
- package/dist/types/alpaca/options/contracts.d.ts +0 -279
- package/dist/types/alpaca/options/contracts.d.ts.map +0 -1
- package/dist/types/alpaca/options/data.d.ts +0 -126
- package/dist/types/alpaca/options/data.d.ts.map +0 -1
- package/dist/types/alpaca/options/index.d.ts +0 -17
- package/dist/types/alpaca/options/index.d.ts.map +0 -1
- package/dist/types/alpaca/options/orders.d.ts +0 -366
- package/dist/types/alpaca/options/orders.d.ts.map +0 -1
- package/dist/types/alpaca/options/strategies.d.ts +0 -224
- package/dist/types/alpaca/options/strategies.d.ts.map +0 -1
- package/dist/types/alpaca/streams/base-stream.d.ts +0 -143
- package/dist/types/alpaca/streams/base-stream.d.ts.map +0 -1
- package/dist/types/alpaca/streams/crypto-stream.d.ts +0 -173
- package/dist/types/alpaca/streams/crypto-stream.d.ts.map +0 -1
- package/dist/types/alpaca/streams/index.d.ts +0 -54
- package/dist/types/alpaca/streams/index.d.ts.map +0 -1
- package/dist/types/alpaca/streams/option-stream.d.ts +0 -167
- package/dist/types/alpaca/streams/option-stream.d.ts.map +0 -1
- package/dist/types/alpaca/streams/stock-stream.d.ts +0 -176
- package/dist/types/alpaca/streams/stock-stream.d.ts.map +0 -1
- package/dist/types/alpaca/streams/stream-manager.d.ts +0 -277
- package/dist/types/alpaca/streams/stream-manager.d.ts.map +0 -1
- package/dist/types/alpaca/streams/trading-stream.d.ts +0 -186
- package/dist/types/alpaca/streams/trading-stream.d.ts.map +0 -1
- package/dist/types/alpaca/streams.d.ts +0 -88
- package/dist/types/alpaca/streams.d.ts.map +0 -1
- package/dist/types/alpaca/test-imports.d.ts +0 -7
- package/dist/types/alpaca/test-imports.d.ts.map +0 -1
- package/dist/types/alpaca/trading/account.d.ts +0 -198
- package/dist/types/alpaca/trading/account.d.ts.map +0 -1
- package/dist/types/alpaca/trading/bracket-orders.d.ts +0 -162
- package/dist/types/alpaca/trading/bracket-orders.d.ts.map +0 -1
- package/dist/types/alpaca/trading/clock.d.ts +0 -99
- package/dist/types/alpaca/trading/clock.d.ts.map +0 -1
- package/dist/types/alpaca/trading/index.d.ts +0 -15
- package/dist/types/alpaca/trading/index.d.ts.map +0 -1
- package/dist/types/alpaca/trading/oco-orders.d.ts +0 -203
- package/dist/types/alpaca/trading/oco-orders.d.ts.map +0 -1
- package/dist/types/alpaca/trading/order-utils.d.ts +0 -404
- package/dist/types/alpaca/trading/order-utils.d.ts.map +0 -1
- package/dist/types/alpaca/trading/orders.d.ts +0 -199
- package/dist/types/alpaca/trading/orders.d.ts.map +0 -1
- package/dist/types/alpaca/trading/oto-orders.d.ts +0 -282
- package/dist/types/alpaca/trading/oto-orders.d.ts.map +0 -1
- package/dist/types/alpaca/trading/positions.d.ts +0 -389
- package/dist/types/alpaca/trading/positions.d.ts.map +0 -1
- package/dist/types/alpaca/trading/smart-orders.d.ts +0 -301
- package/dist/types/alpaca/trading/smart-orders.d.ts.map +0 -1
- package/dist/types/alpaca/trading/trailing-stops.d.ts +0 -240
- package/dist/types/alpaca/trading/trailing-stops.d.ts.map +0 -1
- package/dist/types/config/api-endpoints.d.ts +0 -94
- package/dist/types/config/api-endpoints.d.ts.map +0 -1
- package/dist/types/errors/index.d.ts +0 -130
- package/dist/types/errors/index.d.ts.map +0 -1
- package/dist/types/examples/rate-limiter-example.d.ts +0 -7
- package/dist/types/examples/rate-limiter-example.d.ts.map +0 -1
- package/dist/types/http-timeout.d.ts +0 -37
- package/dist/types/http-timeout.d.ts.map +0 -1
- package/dist/types/logger.d.ts +0 -56
- package/dist/types/logger.d.ts.map +0 -1
- package/dist/types/rate-limiter.d.ts +0 -171
- package/dist/types/rate-limiter.d.ts.map +0 -1
- package/dist/types/schemas/alpaca-schemas.d.ts +0 -779
- package/dist/types/schemas/alpaca-schemas.d.ts.map +0 -1
- package/dist/types/schemas/alphavantage-schemas.d.ts +0 -255
- package/dist/types/schemas/alphavantage-schemas.d.ts.map +0 -1
- package/dist/types/schemas/index.d.ts +0 -21
- package/dist/types/schemas/index.d.ts.map +0 -1
- package/dist/types/schemas/polygon-schemas.d.ts +0 -551
- package/dist/types/schemas/polygon-schemas.d.ts.map +0 -1
- package/dist/types/schemas/validate-response.d.ts +0 -88
- package/dist/types/schemas/validate-response.d.ts.map +0 -1
- package/dist/types/utils/auth-validator.d.ts +0 -32
- package/dist/types/utils/auth-validator.d.ts.map +0 -1
- package/dist/types/utils/http-keep-alive.d.ts +0 -110
- package/dist/types/utils/http-keep-alive.d.ts.map +0 -1
- package/dist/types/utils/paginator.d.ts +0 -154
- package/dist/types/utils/paginator.d.ts.map +0 -1
- package/dist/types/utils/retry.d.ts +0 -78
- package/dist/types/utils/retry.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/logging.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;;;;;;;GAQG;AACH,wBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/logging.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,UAA+C,GAAG,IAAI,CAGnG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"market-hours.d.ts","sourceRoot":"","sources":["../../src/market-hours.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,CAAC;CACvC;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,CAAC;CACvC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IAChC,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACpC;AAED,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"market-hours.d.ts","sourceRoot":"","sources":["../../src/market-hours.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,CAAC;CACvC;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,CAAC;CACvC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IAChC,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACpC;AAED,eAAO,MAAM,cAAc,EAAE,cAsC5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,iBA6D/B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IntradayReporting, PeriodDates, MarketTimeParams, MarketOpenCloseResult, MarketStatus, MarketTimesConfig } from
|
|
1
|
+
import { IntradayReporting, PeriodDates, MarketTimeParams, MarketOpenCloseResult, MarketStatus, MarketTimesConfig } from './types/market-time-types';
|
|
2
2
|
/**
|
|
3
3
|
* Market times for NYSE
|
|
4
4
|
* Regular market hours are 9:30am-4:00pm
|
|
@@ -28,83 +28,33 @@ export declare class MarketTimeUtil {
|
|
|
28
28
|
*/
|
|
29
29
|
private validateTimezone;
|
|
30
30
|
private formatDate;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* Expects a date already converted to market timezone via toZonedTime.
|
|
34
|
-
* @param nyDate - Date in market timezone representation
|
|
35
|
-
* @returns true if the date is Saturday or Sunday
|
|
36
|
-
*/
|
|
37
|
-
private isWeekendZoned;
|
|
38
|
-
/**
|
|
39
|
-
* Checks if a NY-zoned date falls on a market holiday.
|
|
40
|
-
* Expects a date already converted to market timezone via toZonedTime.
|
|
41
|
-
* @param nyDate - Date in market timezone representation
|
|
42
|
-
* @returns true if the date is a holiday
|
|
43
|
-
*/
|
|
44
|
-
private isHolidayZoned;
|
|
45
|
-
/**
|
|
46
|
-
* Checks if a NY-zoned date is an early close day.
|
|
47
|
-
* Expects a date already converted to market timezone via toZonedTime.
|
|
48
|
-
* @param nyDate - Date in market timezone representation
|
|
49
|
-
* @returns true if the date is an early close day
|
|
50
|
-
*/
|
|
51
|
-
private isEarlyCloseDayZoned;
|
|
52
|
-
/**
|
|
53
|
-
* Gets the early close time for a NY-zoned date.
|
|
54
|
-
* Expects a date already converted to market timezone via toZonedTime.
|
|
55
|
-
* @param nyDate - Date in market timezone representation
|
|
56
|
-
* @returns The early close time in minutes from midnight, or null if not an early close day
|
|
57
|
-
*/
|
|
58
|
-
private getEarlyCloseTimeZoned;
|
|
59
|
-
/**
|
|
60
|
-
* Checks if a NY-zoned date is a market day (not weekend, not holiday).
|
|
61
|
-
* Expects a date already converted to market timezone via toZonedTime.
|
|
62
|
-
* @param nyDate - Date in market timezone representation
|
|
63
|
-
* @returns true if the date is a market day
|
|
64
|
-
*/
|
|
65
|
-
private isMarketDayZoned;
|
|
66
|
-
/**
|
|
67
|
-
* Check if a given date is an early close day.
|
|
68
|
-
* Handles timezone conversion from any input date.
|
|
69
|
-
* @param date - The date to check (any timezone)
|
|
70
|
-
* @returns true if the date is an early close day
|
|
71
|
-
*/
|
|
31
|
+
private isWeekend;
|
|
32
|
+
private isHoliday;
|
|
72
33
|
isEarlyCloseDay(date: Date): boolean;
|
|
73
34
|
/**
|
|
74
|
-
* Get the early close time for a given date
|
|
75
|
-
*
|
|
76
|
-
* @param date - The date to check (any timezone)
|
|
35
|
+
* Get the early close time for a given date
|
|
36
|
+
* @param date - The date to get the early close time for
|
|
77
37
|
* @returns The early close time in minutes from midnight, or null if there is no early close
|
|
78
38
|
*/
|
|
79
39
|
getEarlyCloseTime(date: Date): number | null;
|
|
80
40
|
/**
|
|
81
|
-
* Check if a given date is a market day
|
|
82
|
-
*
|
|
83
|
-
* @param date - The date to check (any timezone)
|
|
41
|
+
* Check if a given date is a market day
|
|
42
|
+
* @param date - The date to check
|
|
84
43
|
* @returns true if the date is a market day, false otherwise
|
|
85
44
|
*/
|
|
86
45
|
isMarketDay(date: Date): boolean;
|
|
87
46
|
/**
|
|
88
|
-
* Check if a given date is within market hours
|
|
89
|
-
*
|
|
90
|
-
* @param date - The date to check (any timezone)
|
|
47
|
+
* Check if a given date is within market hours
|
|
48
|
+
* @param date - The date to check
|
|
91
49
|
* @returns true if the date is within market hours, false otherwise
|
|
92
50
|
*/
|
|
93
51
|
isWithinMarketHours(date: Date): boolean;
|
|
94
52
|
/**
|
|
95
|
-
* Check if a
|
|
96
|
-
*
|
|
97
|
-
* @param nyDate - Date in market timezone representation
|
|
98
|
-
* @returns true if the date is within market hours, false otherwise
|
|
99
|
-
*/
|
|
100
|
-
private isWithinMarketHoursZoned;
|
|
101
|
-
/**
|
|
102
|
-
* Check if a NY-zoned date is before market hours.
|
|
103
|
-
* Expects a date already converted to market timezone via toZonedTime.
|
|
104
|
-
* @param nyDate - Date in market timezone representation
|
|
53
|
+
* Check if a given date is before market hours
|
|
54
|
+
* @param date - The date to check
|
|
105
55
|
* @returns true if the date is before market hours, false otherwise
|
|
106
56
|
*/
|
|
107
|
-
private
|
|
57
|
+
private isBeforeMarketHours;
|
|
108
58
|
/**
|
|
109
59
|
* Get the last trading date, i.e. the last date that was a market day
|
|
110
60
|
* @param currentDate - The current date
|
|
@@ -122,18 +72,6 @@ export declare class MarketTimeUtil {
|
|
|
122
72
|
* @property {string} yyyymmdd - The date in YYYY-MM-DD format
|
|
123
73
|
* @property {string} dateISOString - Full ISO date string
|
|
124
74
|
*/
|
|
125
|
-
/**
|
|
126
|
-
* Gets the next market day from a date already in market timezone.
|
|
127
|
-
* @param nyDate - Date in market timezone representation
|
|
128
|
-
* @returns The next market day in market timezone representation
|
|
129
|
-
*/
|
|
130
|
-
private getNextMarketDayZoned;
|
|
131
|
-
/**
|
|
132
|
-
* Gets the next market day from a reference date.
|
|
133
|
-
* Handles timezone conversion from any input date.
|
|
134
|
-
* @param date - The reference date (any timezone)
|
|
135
|
-
* @returns The next market day as a Date (note: internally represented in market timezone)
|
|
136
|
-
*/
|
|
137
75
|
getNextMarketDay(date: Date): Date;
|
|
138
76
|
private getDayBoundaries;
|
|
139
77
|
private calculatePeriodStartDate;
|
|
@@ -200,7 +138,7 @@ export declare function getLastFullTradingDate(currentDate?: Date): {
|
|
|
200
138
|
* @property {string} yyyymmdd - The date in YYYY-MM-DD format
|
|
201
139
|
* @property {string} dateISOString - Full ISO date string
|
|
202
140
|
*/
|
|
203
|
-
export declare function getNextMarketDay({ referenceDate
|
|
141
|
+
export declare function getNextMarketDay({ referenceDate }?: {
|
|
204
142
|
referenceDate?: Date;
|
|
205
143
|
}): {
|
|
206
144
|
date: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"market-time.d.ts","sourceRoot":"","sources":["../../src/market-time.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"market-time.d.ts","sourceRoot":"","sources":["../../src/market-time.ts"],"names":[],"mappings":"AAIA,OAAO,E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,MAAM,CAanE;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,IAAI,KAAG,QAAQ,GAAG,QAmCtD,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAO,GAAG,YAAY,CAwG3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-calcs.d.ts","sourceRoot":"","sources":["../../src/metrics-calcs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"metrics-calcs.d.ts","sourceRoot":"","sources":["../../src/metrics-calcs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAoI5D,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAgFpH;AAwQD,wBAA8B,iBAAiB,CAC7C,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,GAAG,EAAE,EAChB,aAAa,EAAE,YAAY,EAAE,GAC5B,OAAO,CAAC,YAAY,CAAC,CA6BvB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const LOG_TYPES: readonly ["info", "warn", "error", "debug", "trace"];
|
|
2
|
-
type LogType =
|
|
2
|
+
type LogType = typeof LOG_TYPES[number];
|
|
3
3
|
/**
|
|
4
4
|
* Debug logging utility that respects environment debug flags.
|
|
5
5
|
* Logs messages to the console based on the specified log level.
|
|
@@ -30,9 +30,6 @@ export declare function hideApiKeyFromurl(url: string): string;
|
|
|
30
30
|
* Fetches a resource with intelligent retry logic for handling transient errors.
|
|
31
31
|
* Features enhanced error logging, rate limit detection, and adaptive backoff.
|
|
32
32
|
*
|
|
33
|
-
* This is a wrapper around the new retry utility for backward compatibility.
|
|
34
|
-
* It wraps fetch calls with retry logic using exponential backoff.
|
|
35
|
-
*
|
|
36
33
|
* @param url - The URL to fetch.
|
|
37
34
|
* @param options - Optional fetch options.
|
|
38
35
|
* @param retries - The number of retry attempts. Defaults to 3.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc-utils.d.ts","sourceRoot":"","sources":["../../src/misc-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"misc-utils.d.ts","sourceRoot":"","sources":["../../src/misc-utils.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,SAAS,sDAAuD,CAAC;AAEvE,KAAK,OAAO,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;AAExC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,GACrB,SAAS,MAAM,EACf,OAAO,OAAO,EACd,OAAM,OAAgB,SA0BvB,CAAC;AAqBF;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAiBrD;AAyCD;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,WAAgB,EACzB,OAAO,GAAE,MAAU,EACnB,cAAc,GAAE,MAAa,GAC5B,OAAO,CAAC,QAAQ,CAAC,CAsFnB;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAe5E"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PortfolioHistory,
|
|
2
|
-
import { PerformanceMetrics, FetchPerformanceMetricsProps } from
|
|
1
|
+
import { PortfolioHistory, BenchmarkBar, CalculateBetaResult } from './types/alpaca-types';
|
|
2
|
+
import { PerformanceMetrics, FetchPerformanceMetricsProps } from './types/metrics-types';
|
|
3
3
|
/**
|
|
4
4
|
* Calculates the alpha, beta, and annualized Alpha of the portfolio compared to a benchmark.
|
|
5
5
|
* @param portfolioHistory - The portfolio history data.
|
|
6
6
|
* @param benchmarkBars - The historical price data of the benchmark.
|
|
7
7
|
* @returns An object containing alpha, beta, and annualized alpha.
|
|
8
8
|
*/
|
|
9
|
-
export declare function calculateAlphaAndBeta(portfolioHistory:
|
|
9
|
+
export declare function calculateAlphaAndBeta(portfolioHistory: any, benchmarkBars: any[]): Promise<{
|
|
10
10
|
alpha: string;
|
|
11
11
|
alphaAnnualized: string;
|
|
12
12
|
beta: string;
|
|
@@ -73,16 +73,16 @@ export declare function calculateBetaFromReturns(portfolioReturns: number[], ben
|
|
|
73
73
|
* @param benchmarkBars - The historical price data of the benchmark.
|
|
74
74
|
* @returns Information ratio as a formatted string.
|
|
75
75
|
*/
|
|
76
|
-
export declare function calculateInformationRatio(portfolioHistory:
|
|
76
|
+
export declare function calculateInformationRatio(portfolioHistory: any, benchmarkBars: any[]): Promise<string>;
|
|
77
77
|
/**
|
|
78
78
|
* Fetches performance metrics for a given Alpaca account.
|
|
79
79
|
* @param params - The parameters for fetching performance metrics.
|
|
80
80
|
* @param client - The Apollo client instance.
|
|
81
81
|
* @param accountId - The ID of the Alpaca account.
|
|
82
|
-
* @param
|
|
82
|
+
* @param alpacaAccount - The Alpaca account object.
|
|
83
83
|
* @returns A promise that resolves to an object containing various performance metrics.
|
|
84
84
|
* @throws Will throw an error if required parameters are missing or if fetching fails.
|
|
85
85
|
*/
|
|
86
|
-
export declare function fetchPerformanceMetrics({ params, client, accountId,
|
|
86
|
+
export declare function fetchPerformanceMetrics({ params, client, accountId, alpacaAccount, }: FetchPerformanceMetricsProps): Promise<PerformanceMetrics>;
|
|
87
87
|
export {};
|
|
88
88
|
//# sourceMappingURL=performance-metrics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performance-metrics.d.ts","sourceRoot":"","sources":["../../src/performance-metrics.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"performance-metrics.d.ts","sourceRoot":"","sources":["../../src/performance-metrics.ts"],"names":[],"mappings":"AAIA,OAAO,EAA0B,gBAAgB,EAAE,YAAY,EAAE,mBAAmB,EAAgF,MAAM,sBAAsB,CAAC;AAKjM,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AA0QzF;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,gBAAgB,EAAE,GAAG,EACrB,aAAa,EAAE,GAAG,EAAE,GACnB,OAAO,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CA6LD;AAkCD,UAAU,cAAc;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yBAAyB,EAAE,MAAM,CAAC;CACnC;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CACrB,GACL,cAAc,CAwGhB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,QAAQ,GAAE,MAAU,GAAG,MAAM,CAGnF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAchE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,YAAY,EAAE,GAC5B;IAAE,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAAC,uBAAuB,EAAE,MAAM,EAAE,CAAA;CAAE,CAkE1E;AA4DD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAoDpH;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,gBAAgB,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAsF5G;AAED;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAAC,EAC5C,MAAM,EACN,MAAM,EACN,SAAS,EACT,aAAa,GACd,EAAE,4BAA4B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAiI5D"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This module provides functions to interact with the Polygon.io Indices API.
|
|
5
5
|
*/
|
|
6
|
-
import { PolygonIndicesAggregatesParams, PolygonIndicesAggregatesResponse, PolygonIndicesPrevCloseResponse, PolygonIndicesDailyOpenCloseResponse, PolygonIndicesSnapshotParams, PolygonIndicesSnapshotResponse } from
|
|
6
|
+
import { PolygonIndicesAggregatesParams, PolygonIndicesAggregatesResponse, PolygonIndicesPrevCloseResponse, PolygonIndicesDailyOpenCloseResponse, PolygonIndicesSnapshotParams, PolygonIndicesSnapshotResponse } from './types';
|
|
7
7
|
/**
|
|
8
8
|
* Fetches aggregate bars for an index over a given date range in custom time window sizes.
|
|
9
9
|
*
|
|
@@ -59,7 +59,7 @@ export declare const fetchIndicesSnapshot: (params?: PolygonIndicesSnapshotParam
|
|
|
59
59
|
* @param {string} [options.order] - Order results
|
|
60
60
|
* @param {number} [options.limit] - Limit the number of results
|
|
61
61
|
* @param {string} [options.sort] - Sort field
|
|
62
|
-
* @returns {Promise<
|
|
62
|
+
* @returns {Promise<any>} The universal snapshot response
|
|
63
63
|
*/
|
|
64
64
|
export declare const fetchUniversalSnapshot: (tickers: string[], options?: {
|
|
65
65
|
apiKey?: string;
|
|
@@ -67,7 +67,7 @@ export declare const fetchUniversalSnapshot: (tickers: string[], options?: {
|
|
|
67
67
|
order?: string;
|
|
68
68
|
limit?: number;
|
|
69
69
|
sort?: string;
|
|
70
|
-
}) => Promise<
|
|
70
|
+
}) => Promise<any>;
|
|
71
71
|
/**
|
|
72
72
|
* Converts Polygon Indices bar data to a more standardized format
|
|
73
73
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polygon-indices.d.ts","sourceRoot":"","sources":["../../src/polygon-indices.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"polygon-indices.d.ts","sourceRoot":"","sources":["../../src/polygon-indices.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EACL,8BAA8B,EAC9B,gCAAgC,EAChC,+BAA+B,EAC/B,oCAAoC,EACpC,4BAA4B,EAC5B,8BAA8B,EAE/B,MAAM,SAAS,CAAC;AAyBjB;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,8BAA8B,EACtC,UAAU;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,KAC5B,OAAO,CAAC,gCAAgC,CAmC1C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GACpC,eAAe,MAAM,EACrB,UAAU;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,KAC5B,OAAO,CAAC,+BAA+B,CAyBzC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,GACrC,eAAe,MAAM,EACrB,MAAM,MAAM,EACZ,UAAU;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,KAC5B,OAAO,CAAC,oCAAoC,CAyB9C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAC/B,SAAS,4BAA4B,EACrC,UAAU;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,KAC5B,OAAO,CAAC,8BAA8B,CAyCxC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,MAAM,EAAE,EACjB,UAAU;IACR,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,KACA,OAAO,CAAC,GAAG,CA6Cb,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,MAAM,gCAAgC,KAAG,KAAK,CAAC;IAClF,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,SAAS,EAAE,MAAM,CAAC;CACnB,CAYA,CAAC"}
|
package/dist/types/polygon.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**********************************************************************************
|
|
2
2
|
* Polygon.io calls
|
|
3
3
|
**********************************************************************************/
|
|
4
|
-
import { PolygonQuote, PolygonPriceData, PolygonGroupedDailyResponse, PolygonTickerInfo, PolygonDailyOpenClose, PolygonTradesResponse } from
|
|
4
|
+
import { PolygonQuote, PolygonPriceData, PolygonGroupedDailyResponse, PolygonTickerInfo, PolygonDailyOpenClose, PolygonTradesResponse } from './types';
|
|
5
5
|
/**
|
|
6
6
|
* Fetches general information about a stock ticker.
|
|
7
7
|
* @param {string} symbol - The stock ticker symbol to fetch information for.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../src/polygon.ts"],"names":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EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAe,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"price-utils.d.ts","sourceRoot":"","sources":["../../src/price-utils.ts"],"names":[],"mappings":"AAEA,OAAgB,EAAS,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAe,cAAc,EAAE,MAAM,eAAe,CAAC;AAuE5D,eAAO,MAAM,gBAAgB,GAAU,OAAO,KAAK,CAAC,KAAK,KAAG,OAAO,CAAC,MAAM,CAezE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMrD;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,WAAW,EAAE,EACzB,gBAAgB,CAAC,EAAE,sBAAsB,EACzC,cAAc,CAAC,EAAE,cAAc,EAC/B,MAAM,CAAC,EAAE,MAAM;;;;;;;;;;;;;;EAgHhB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PolygonPriceData } from
|
|
2
|
-
import { BollingerBandsData, BollingerBandsParams } from
|
|
1
|
+
import { PolygonPriceData } from './types';
|
|
2
|
+
import { BollingerBandsData, BollingerBandsParams } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Calculates Bollinger Bands for a given set of price data.
|
|
5
5
|
* Bollinger Bands consist of a middle band (SMA) and two outer bands
|
|
@@ -12,7 +12,7 @@ import { BollingerBandsData, BollingerBandsParams } from "./types";
|
|
|
12
12
|
* @returns An array of BollingerBandsData objects containing the calculated bands.
|
|
13
13
|
*/
|
|
14
14
|
export declare function calculateBollingerBands(priceData: PolygonPriceData[], { period, standardDeviations }?: BollingerBandsParams): BollingerBandsData[];
|
|
15
|
-
import { EMAParams } from
|
|
15
|
+
import { EMAParams } from './types';
|
|
16
16
|
/**
|
|
17
17
|
* Calculates the Exponential Moving Average (EMA) for a given set of price data.
|
|
18
18
|
* The EMA gives more weight to recent prices, making it more responsive to new information.
|
|
@@ -24,7 +24,7 @@ import { EMAParams } from "./types";
|
|
|
24
24
|
* @returns An array of EMAData objects containing the calculated EMA values.
|
|
25
25
|
*/
|
|
26
26
|
export declare function calculateEMA(priceData: PolygonPriceData[], { period, period2 }?: EMAParams): EMAData[];
|
|
27
|
-
import { FibonacciData, FibonacciParams } from
|
|
27
|
+
import { FibonacciData, FibonacciParams } from './types';
|
|
28
28
|
/**
|
|
29
29
|
* Calculates Fibonacci retracement and extension levels based on price data.
|
|
30
30
|
* Fibonacci levels are used to identify potential support and resistance levels.
|
|
@@ -38,7 +38,7 @@ import { FibonacciData, FibonacciParams } from "./types";
|
|
|
38
38
|
* @returns An array of FibonacciData objects containing the calculated levels.
|
|
39
39
|
*/
|
|
40
40
|
export declare function calculateFibonacciLevels(priceData: PolygonPriceData[], { lookbackPeriod, retracementLevels, extensionLevels, reverseDirection, }?: FibonacciParams): FibonacciData[];
|
|
41
|
-
import { MACDData, MACDParams, EMAData } from
|
|
41
|
+
import { MACDData, MACDParams, EMAData } from './types';
|
|
42
42
|
/**
|
|
43
43
|
* Calculates the Moving Average Convergence Divergence (MACD) for a given set of price data.
|
|
44
44
|
* MACD is a trend-following momentum indicator that shows the relationship between two EMAs.
|
|
@@ -51,7 +51,7 @@ import { MACDData, MACDParams, EMAData } from "./types";
|
|
|
51
51
|
* @returns An array of MACDData objects containing the calculated MACD values.
|
|
52
52
|
*/
|
|
53
53
|
export declare function calculateMACD(priceData: PolygonPriceData[], { shortPeriod, longPeriod, signalPeriod }?: MACDParams): MACDData[];
|
|
54
|
-
import { RSIData, RSIParams } from
|
|
54
|
+
import { RSIData, RSIParams } from './types';
|
|
55
55
|
/**
|
|
56
56
|
* Calculates the Relative Strength Index (RSI) for a given set of price data.
|
|
57
57
|
* RSI is a momentum oscillator that measures the speed and change of price movements.
|
|
@@ -62,7 +62,7 @@ import { RSIData, RSIParams } from "./types";
|
|
|
62
62
|
* @returns An array of RSIData objects containing the calculated RSI values.
|
|
63
63
|
*/
|
|
64
64
|
export declare function calculateRSI(priceData: PolygonPriceData[], { period }?: RSIParams): RSIData[];
|
|
65
|
-
import { StochData, StochasticParams } from
|
|
65
|
+
import { StochData, StochasticParams } from './types';
|
|
66
66
|
/**
|
|
67
67
|
* Calculates the Stochastic Oscillator for a given set of price data.
|
|
68
68
|
* The Stochastic Oscillator compares a particular closing price of a security to a range of its prices over a certain period of time.
|
|
@@ -74,8 +74,8 @@ import { StochData, StochasticParams } from "./types";
|
|
|
74
74
|
* @param params.smoothingFactor - The smoothing factor for %K (default is 3).
|
|
75
75
|
* @returns An array of StochData objects containing the calculated %K and %D values.
|
|
76
76
|
*/
|
|
77
|
-
export declare function calculateStochasticOscillator(priceData: PolygonPriceData[], { lookbackPeriod, signalPeriod, smoothingFactor
|
|
78
|
-
import { SupportResistanceData, SupportResistanceParams } from
|
|
77
|
+
export declare function calculateStochasticOscillator(priceData: PolygonPriceData[], { lookbackPeriod, signalPeriod, smoothingFactor }?: StochasticParams): StochData[];
|
|
78
|
+
import { SupportResistanceData, SupportResistanceParams } from './types';
|
|
79
79
|
/**
|
|
80
80
|
* Calculates support and resistance levels based on price data.
|
|
81
81
|
* Support and resistance levels are price levels at which a stock tends to stop and reverse.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"technical-analysis.d.ts","sourceRoot":"","sources":["../../src/technical-analysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGnE;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,gBAAgB,EAAE,EAC7B,EAAE,MAAW,EAAE,kBAAsB,EAAE,GAAE,oB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E,SAAc,GAAG,OAAO,EAAE,CAuDtG;AAED,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,gBAAgB,EAAE,EAC7B,EAAE,cAAkB,EAAE,YAAgB,EAAE,eAAmB,EAAE,GAAE,gBAAqB,GACnF,SAAS,EAAE,CA4Cb;AAED,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAA0B,MAAM,SAAS,CAAC;AAEjG;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,gBAAgB,EAAE,EAC7B,EAAE,SAAa,EAAE,cAAmB,EAAE,GAAE,uBAA4B,GACnE,qBAAqB,EAAE,CA8GzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-utils.d.ts","sourceRoot":"","sources":["../../src/time-utils.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,GAAI,IAAI,MAAM,KAAG,MAE5C,CAAC;AAEF,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"time-utils.d.ts","sourceRoot":"","sources":["../../src/time-utils.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,GAAI,IAAI,MAAM,KAAG,MAE5C,CAAC;AAEF,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,UAiC5C;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGvD;AAGD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,UA2B/C;AAeD,eAAO,MAAM,iBAAiB,GAAI,qBAAqB,IAAI,KAAG,MAS7D,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,YAAY,IAAI,KAAG,MAe1C,CAAC;AAGF,eAAO,MAAM,UAAU,GAAI,YAAY,MAAM,EAAE,aAAa,OAAO,WAOlE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,MAAM,IAAI,KAAG,MAY/C,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,KAAG,IActD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,IAAI,EAAE,WAAW,OAAO,KAAG,MAelE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,WAAW,MAAM,KAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAK3G,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,cAAc,MAAM,KAAG,MAerD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptic-types.d.ts","sourceRoot":"","sources":["../../../src/types/adaptic-types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"adaptic-types.d.ts","sourceRoot":"","sources":["../../../src/types/adaptic-types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAGD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;CAClB"}
|