@adaptic/utils 0.0.383 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +10241 -120
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10057 -121
- package/dist/index.mjs.map +1 -1
- package/dist/types/alpaca/client.d.ts +95 -0
- package/dist/types/alpaca/client.d.ts.map +1 -0
- package/dist/types/alpaca/crypto/data.d.ts +281 -0
- package/dist/types/alpaca/crypto/data.d.ts.map +1 -0
- package/dist/types/alpaca/crypto/index.d.ts +75 -0
- package/dist/types/alpaca/crypto/index.d.ts.map +1 -0
- package/dist/types/alpaca/crypto/orders.d.ts +221 -0
- package/dist/types/alpaca/crypto/orders.d.ts.map +1 -0
- package/dist/types/alpaca/index.d.ts +201 -0
- package/dist/types/alpaca/index.d.ts.map +1 -0
- package/dist/types/alpaca/market-data/bars.d.ts +142 -0
- package/dist/types/alpaca/market-data/bars.d.ts.map +1 -0
- package/dist/types/alpaca/market-data/index.d.ts +13 -0
- package/dist/types/alpaca/market-data/index.d.ts.map +1 -0
- package/dist/types/alpaca/market-data/news.d.ts +87 -0
- package/dist/types/alpaca/market-data/news.d.ts.map +1 -0
- package/dist/types/alpaca/market-data/quotes.d.ts +85 -0
- package/dist/types/alpaca/market-data/quotes.d.ts.map +1 -0
- package/dist/types/alpaca/market-data/trades.d.ts +98 -0
- package/dist/types/alpaca/market-data/trades.d.ts.map +1 -0
- package/dist/types/alpaca/options/contracts.d.ts +279 -0
- package/dist/types/alpaca/options/contracts.d.ts.map +1 -0
- package/dist/types/alpaca/options/data.d.ts +126 -0
- package/dist/types/alpaca/options/data.d.ts.map +1 -0
- package/dist/types/alpaca/options/index.d.ts +17 -0
- package/dist/types/alpaca/options/index.d.ts.map +1 -0
- package/dist/types/alpaca/options/orders.d.ts +366 -0
- package/dist/types/alpaca/options/orders.d.ts.map +1 -0
- package/dist/types/alpaca/options/strategies.d.ts +224 -0
- package/dist/types/alpaca/options/strategies.d.ts.map +1 -0
- package/dist/types/alpaca/streams/base-stream.d.ts +143 -0
- package/dist/types/alpaca/streams/base-stream.d.ts.map +1 -0
- package/dist/types/alpaca/streams/crypto-stream.d.ts +173 -0
- package/dist/types/alpaca/streams/crypto-stream.d.ts.map +1 -0
- package/dist/types/alpaca/streams/index.d.ts +54 -0
- package/dist/types/alpaca/streams/index.d.ts.map +1 -0
- package/dist/types/alpaca/streams/option-stream.d.ts +167 -0
- package/dist/types/alpaca/streams/option-stream.d.ts.map +1 -0
- package/dist/types/alpaca/streams/stock-stream.d.ts +176 -0
- package/dist/types/alpaca/streams/stock-stream.d.ts.map +1 -0
- package/dist/types/alpaca/streams/stream-manager.d.ts +277 -0
- package/dist/types/alpaca/streams/stream-manager.d.ts.map +1 -0
- package/dist/types/alpaca/streams/trading-stream.d.ts +186 -0
- package/dist/types/alpaca/streams/trading-stream.d.ts.map +1 -0
- package/dist/types/alpaca/streams.d.ts +88 -0
- package/dist/types/alpaca/streams.d.ts.map +1 -0
- package/dist/types/alpaca/test-imports.d.ts +7 -0
- package/dist/types/alpaca/test-imports.d.ts.map +1 -0
- package/dist/types/alpaca/trading/account.d.ts +198 -0
- package/dist/types/alpaca/trading/account.d.ts.map +1 -0
- package/dist/types/alpaca/trading/bracket-orders.d.ts +162 -0
- package/dist/types/alpaca/trading/bracket-orders.d.ts.map +1 -0
- package/dist/types/alpaca/trading/index.d.ts +13 -0
- package/dist/types/alpaca/trading/index.d.ts.map +1 -0
- package/dist/types/alpaca/trading/oco-orders.d.ts +203 -0
- package/dist/types/alpaca/trading/oco-orders.d.ts.map +1 -0
- package/dist/types/alpaca/trading/order-utils.d.ts +404 -0
- package/dist/types/alpaca/trading/order-utils.d.ts.map +1 -0
- package/dist/types/alpaca/trading/orders.d.ts +199 -0
- package/dist/types/alpaca/trading/orders.d.ts.map +1 -0
- package/dist/types/alpaca/trading/oto-orders.d.ts +282 -0
- package/dist/types/alpaca/trading/oto-orders.d.ts.map +1 -0
- package/dist/types/alpaca/trading/positions.d.ts +389 -0
- package/dist/types/alpaca/trading/positions.d.ts.map +1 -0
- package/dist/types/alpaca/trading/smart-orders.d.ts +301 -0
- package/dist/types/alpaca/trading/smart-orders.d.ts.map +1 -0
- package/dist/types/alpaca/trading/trailing-stops.d.ts +240 -0
- package/dist/types/alpaca/trading/trailing-stops.d.ts.map +1 -0
- package/dist/types/index.d.ts +353 -6
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-orders.d.ts","sourceRoot":"","sources":["../../../../src/alpaca/trading/smart-orders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EAEvB,kBAAkB,EAElB,4BAA4B,EAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAkB,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAkB,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAsB,MAAM,kBAAkB,CAAC;AAS9F,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AAEjC;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,kCAAkC;IAClC,IAAI,EAAE,SAAS,CAAC;IAEhB,6EAA6E;IAC7E,KAAK,CAAC,EAAE;QACN,uBAAuB;QACvB,IAAI,EAAE,QAAQ,GAAG,OAAO,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;;;;;;;;;;;;;;AACH,wBAqBE"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native Trailing Stop Orders Module
|
|
3
|
+
*
|
|
4
|
+
* This module provides functions for creating and managing native trailing stop orders
|
|
5
|
+
* using Alpaca's server-side trailing stop functionality. Native trailing stops are
|
|
6
|
+
* handled by Alpaca's servers, eliminating the need for client-side monitoring.
|
|
7
|
+
*
|
|
8
|
+
* Key benefits of native trailing stops:
|
|
9
|
+
* - Server-side execution ensures stops work even if your application is offline
|
|
10
|
+
* - No need for polling or websocket connections to monitor prices
|
|
11
|
+
* - Automatic high water mark (HWM) tracking by Alpaca
|
|
12
|
+
* - Support for both percentage-based and dollar-based trailing
|
|
13
|
+
*/
|
|
14
|
+
import { AlpacaClient } from '../client';
|
|
15
|
+
import { AlpacaOrder, OrderSide, TimeInForce } from '../../types/alpaca-types';
|
|
16
|
+
/**
|
|
17
|
+
* Parameters for creating a trailing stop order
|
|
18
|
+
*/
|
|
19
|
+
export interface TrailingStopParams {
|
|
20
|
+
/** Stock symbol */
|
|
21
|
+
symbol: string;
|
|
22
|
+
/** Number of shares */
|
|
23
|
+
qty: number;
|
|
24
|
+
/** Order side (usually 'sell' for closing long positions) */
|
|
25
|
+
side: OrderSide;
|
|
26
|
+
/** Trail by percentage (e.g., 1.0 = 1%). Must specify either trailPercent OR trailPrice */
|
|
27
|
+
trailPercent?: number;
|
|
28
|
+
/** Trail by fixed dollar amount. Must specify either trailPercent OR trailPrice */
|
|
29
|
+
trailPrice?: number;
|
|
30
|
+
/** Time in force (default: 'gtc') */
|
|
31
|
+
timeInForce?: TimeInForce;
|
|
32
|
+
/** Extended hours trading */
|
|
33
|
+
extendedHours?: boolean;
|
|
34
|
+
/** Client order ID for tracking */
|
|
35
|
+
clientOrderId?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Result of trailing stop HWM query
|
|
39
|
+
*/
|
|
40
|
+
export interface TrailingStopHWMResult {
|
|
41
|
+
/** High water mark - the highest price seen since order placement (for sell stops) */
|
|
42
|
+
hwm: number | null;
|
|
43
|
+
/** Current calculated stop price based on HWM and trail amount */
|
|
44
|
+
currentStop: number | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parameters for creating trailing stops across a portfolio
|
|
48
|
+
*/
|
|
49
|
+
export interface PortfolioTrailingStopParams {
|
|
50
|
+
/** Trail by percentage (e.g., 2.0 = 2%) */
|
|
51
|
+
trailPercent: number;
|
|
52
|
+
/** Time in force (default: 'gtc') */
|
|
53
|
+
timeInForce?: TimeInForce;
|
|
54
|
+
/** Symbols to exclude from trailing stop creation */
|
|
55
|
+
excludeSymbols?: string[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Validation error for trailing stop parameters
|
|
59
|
+
*/
|
|
60
|
+
export declare class TrailingStopValidationError extends Error {
|
|
61
|
+
constructor(message: string);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Create a native trailing stop order
|
|
65
|
+
*
|
|
66
|
+
* The trailing stop automatically adjusts based on price movement:
|
|
67
|
+
* - For SELL: Stop rises as price rises, locks in when price falls
|
|
68
|
+
* - For BUY: Stop falls as price falls, triggers when price rises
|
|
69
|
+
*
|
|
70
|
+
* Must specify either trailPercent OR trailPrice (not both)
|
|
71
|
+
*
|
|
72
|
+
* @param client - AlpacaClient instance
|
|
73
|
+
* @param params - Trailing stop parameters
|
|
74
|
+
* @returns The created order
|
|
75
|
+
* @throws {TrailingStopValidationError} If parameters are invalid
|
|
76
|
+
* @throws {Error} If order creation fails
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* // Trail by 2% on a sell (closing long position)
|
|
81
|
+
* await createTrailingStop(client, {
|
|
82
|
+
* symbol: 'AAPL',
|
|
83
|
+
* qty: 100,
|
|
84
|
+
* side: 'sell',
|
|
85
|
+
* trailPercent: 2.0,
|
|
86
|
+
* });
|
|
87
|
+
*
|
|
88
|
+
* // Trail by $5 on a sell
|
|
89
|
+
* await createTrailingStop(client, {
|
|
90
|
+
* symbol: 'AAPL',
|
|
91
|
+
* qty: 100,
|
|
92
|
+
* side: 'sell',
|
|
93
|
+
* trailPrice: 5.00,
|
|
94
|
+
* });
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
export declare function createTrailingStop(client: AlpacaClient, params: TrailingStopParams): Promise<AlpacaOrder>;
|
|
98
|
+
/**
|
|
99
|
+
* Update an existing trailing stop order
|
|
100
|
+
*
|
|
101
|
+
* You can update the trail_percent or trail_price of an existing order.
|
|
102
|
+
* Note: Alpaca uses 'trail' parameter for replacements (works for both percent and price).
|
|
103
|
+
*
|
|
104
|
+
* @param client - AlpacaClient instance
|
|
105
|
+
* @param orderId - The ID of the order to update
|
|
106
|
+
* @param updates - New trail parameters (specify one of trailPercent or trailPrice)
|
|
107
|
+
* @returns The updated order
|
|
108
|
+
* @throws {Error} If no update parameters provided or update fails
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* // Tighten trailing stop to 1.5%
|
|
113
|
+
* await updateTrailingStop(client, 'order-id-123', { trailPercent: 1.5 });
|
|
114
|
+
*
|
|
115
|
+
* // Change to $3 trail
|
|
116
|
+
* await updateTrailingStop(client, 'order-id-123', { trailPrice: 3.00 });
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export declare function updateTrailingStop(client: AlpacaClient, orderId: string, updates: {
|
|
120
|
+
trailPercent?: number;
|
|
121
|
+
trailPrice?: number;
|
|
122
|
+
}): Promise<AlpacaOrder>;
|
|
123
|
+
/**
|
|
124
|
+
* Get the current high water mark (HWM) for a trailing stop
|
|
125
|
+
*
|
|
126
|
+
* The HWM is the highest price seen since order placement (for sell stops)
|
|
127
|
+
* or the lowest price (for buy stops). The current stop price is calculated
|
|
128
|
+
* based on the HWM and the trail amount.
|
|
129
|
+
*
|
|
130
|
+
* @param client - AlpacaClient instance
|
|
131
|
+
* @param orderId - The ID of the trailing stop order
|
|
132
|
+
* @returns Object containing HWM and current stop price (null if not yet established)
|
|
133
|
+
* @throws {Error} If order retrieval fails
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* const { hwm, currentStop } = await getTrailingStopHWM(client, 'order-id-123');
|
|
138
|
+
* console.log(`High water mark: $${hwm}, Current stop: $${currentStop}`);
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
export declare function getTrailingStopHWM(client: AlpacaClient, orderId: string): Promise<TrailingStopHWMResult>;
|
|
142
|
+
/**
|
|
143
|
+
* Cancel a trailing stop order
|
|
144
|
+
*
|
|
145
|
+
* @param client - AlpacaClient instance
|
|
146
|
+
* @param orderId - The ID of the trailing stop order to cancel
|
|
147
|
+
* @throws {Error} If cancellation fails
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* await cancelTrailingStop(client, 'order-id-123');
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
export declare function cancelTrailingStop(client: AlpacaClient, orderId: string): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* Create trailing stops for all positions in a portfolio
|
|
157
|
+
*
|
|
158
|
+
* This function creates trailing stop orders for all long positions in the portfolio,
|
|
159
|
+
* which is useful for applying blanket downside protection. Short positions are skipped.
|
|
160
|
+
*
|
|
161
|
+
* @param client - AlpacaClient instance
|
|
162
|
+
* @param params - Configuration for portfolio-wide trailing stops
|
|
163
|
+
* @returns Map of symbol to created order (symbols that failed are not included)
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```typescript
|
|
167
|
+
* // Apply 3% trailing stops to all positions except TSLA and NVDA
|
|
168
|
+
* const orders = await createPortfolioTrailingStops(client, {
|
|
169
|
+
* trailPercent: 3.0,
|
|
170
|
+
* excludeSymbols: ['TSLA', 'NVDA'],
|
|
171
|
+
* });
|
|
172
|
+
*
|
|
173
|
+
* console.log(`Created ${orders.size} trailing stops`);
|
|
174
|
+
* for (const [symbol, order] of orders) {
|
|
175
|
+
* console.log(`${symbol}: ${order.id}`);
|
|
176
|
+
* }
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
export declare function createPortfolioTrailingStops(client: AlpacaClient, params: PortfolioTrailingStopParams): Promise<Map<string, AlpacaOrder>>;
|
|
180
|
+
/**
|
|
181
|
+
* Get all open trailing stop orders
|
|
182
|
+
*
|
|
183
|
+
* @param client - AlpacaClient instance
|
|
184
|
+
* @param symbol - Optional symbol to filter by
|
|
185
|
+
* @returns Array of open trailing stop orders
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* // Get all trailing stops
|
|
190
|
+
* const allStops = await getOpenTrailingStops(client);
|
|
191
|
+
*
|
|
192
|
+
* // Get trailing stops for specific symbol
|
|
193
|
+
* const appleStops = await getOpenTrailingStops(client, 'AAPL');
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
export declare function getOpenTrailingStops(client: AlpacaClient, symbol?: string): Promise<AlpacaOrder[]>;
|
|
197
|
+
/**
|
|
198
|
+
* Check if a symbol has an active trailing stop order
|
|
199
|
+
*
|
|
200
|
+
* @param client - AlpacaClient instance
|
|
201
|
+
* @param symbol - Stock symbol to check
|
|
202
|
+
* @returns True if an active trailing stop exists for the symbol
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```typescript
|
|
206
|
+
* if (await hasActiveTrailingStop(client, 'AAPL')) {
|
|
207
|
+
* console.log('AAPL already has a trailing stop');
|
|
208
|
+
* }
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
export declare function hasActiveTrailingStop(client: AlpacaClient, symbol: string): Promise<boolean>;
|
|
212
|
+
/**
|
|
213
|
+
* Cancel all trailing stop orders for a specific symbol
|
|
214
|
+
*
|
|
215
|
+
* @param client - AlpacaClient instance
|
|
216
|
+
* @param symbol - Stock symbol
|
|
217
|
+
* @returns Number of orders canceled
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* const canceled = await cancelTrailingStopsForSymbol(client, 'AAPL');
|
|
222
|
+
* console.log(`Canceled ${canceled} trailing stop orders for AAPL`);
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
225
|
+
export declare function cancelTrailingStopsForSymbol(client: AlpacaClient, symbol: string): Promise<number>;
|
|
226
|
+
/**
|
|
227
|
+
* Default export object with all trailing stop functions
|
|
228
|
+
*/
|
|
229
|
+
declare const _default: {
|
|
230
|
+
createTrailingStop: typeof createTrailingStop;
|
|
231
|
+
updateTrailingStop: typeof updateTrailingStop;
|
|
232
|
+
getTrailingStopHWM: typeof getTrailingStopHWM;
|
|
233
|
+
cancelTrailingStop: typeof cancelTrailingStop;
|
|
234
|
+
createPortfolioTrailingStops: typeof createPortfolioTrailingStops;
|
|
235
|
+
getOpenTrailingStops: typeof getOpenTrailingStops;
|
|
236
|
+
hasActiveTrailingStop: typeof hasActiveTrailingStop;
|
|
237
|
+
cancelTrailingStopsForSymbol: typeof cancelTrailingStopsForSymbol;
|
|
238
|
+
};
|
|
239
|
+
export default _default;
|
|
240
|
+
//# sourceMappingURL=trailing-stops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trailing-stops.d.ts","sourceRoot":"","sources":["../../../../src/alpaca/trading/trailing-stops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAkB,MAAM,0BAA0B,CAAC;AAW/F;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,mBAAmB;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,IAAI,EAAE,SAAS,C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