@stoqey/ib 1.3.8 → 1.3.10
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 +3 -3
- package/dist/api/api.d.ts +58 -55
- package/dist/api/api.js +50 -44
- package/dist/api/api.js.map +1 -1
- package/dist/api/contract/contract.d.ts +4 -0
- package/dist/api/contract/forex.js.map +1 -1
- package/dist/api/contract/wsh.d.ts +15 -0
- package/dist/api/contract/wsh.js +21 -0
- package/dist/api/contract/wsh.js.map +1 -0
- package/dist/api/data/enum/duration-unit.js +1 -1
- package/dist/api/data/enum/duration-unit.js.map +1 -1
- package/dist/api/data/enum/event-name.js +1 -1
- package/dist/api/data/enum/event-name.js.map +1 -1
- package/dist/api/data/enum/fad-data-type.d.ts +2 -1
- package/dist/api/data/enum/fad-data-type.js +3 -2
- package/dist/api/data/enum/fad-data-type.js.map +1 -1
- package/dist/api/data/enum/log-level.js +1 -1
- package/dist/api/data/enum/log-level.js.map +1 -1
- package/dist/api/data/enum/min-server-version.d.ts +3 -1
- package/dist/api/data/enum/min-server-version.js +3 -1
- package/dist/api/data/enum/min-server-version.js.map +1 -1
- package/dist/api/data/enum/option-exercise-action.js +1 -1
- package/dist/api/data/enum/option-exercise-action.js.map +1 -1
- package/dist/api/data/enum/option-type.js +1 -1
- package/dist/api/data/enum/option-type.js.map +1 -1
- package/dist/api/data/enum/sec-type.d.ts +22 -13
- package/dist/api/data/enum/sec-type.js +24 -15
- package/dist/api/data/enum/sec-type.js.map +1 -1
- package/dist/api/historical/bar-size-setting.js +1 -1
- package/dist/api/historical/bar-size-setting.js.map +1 -1
- package/dist/api/historical/what-to-show.d.ts +21 -0
- package/dist/api/historical/what-to-show.js +25 -0
- package/dist/api/historical/what-to-show.js.map +1 -0
- package/dist/api/market/tickByTickDataType.js +1 -1
- package/dist/api/market/tickByTickDataType.js.map +1 -1
- package/dist/api/market/tickType.d.ts +12 -0
- package/dist/api/market/tickType.js +13 -1
- package/dist/api/market/tickType.js.map +1 -1
- package/dist/api/order/enum/conjunction-connection.js +1 -1
- package/dist/api/order/enum/conjunction-connection.js.map +1 -1
- package/dist/api/order/enum/order-action.js +1 -1
- package/dist/api/order/enum/order-action.js.map +1 -1
- package/dist/api/order/enum/order-condition-type.js +1 -1
- package/dist/api/order/enum/order-condition-type.js.map +1 -1
- package/dist/api/order/enum/order-status.js +1 -1
- package/dist/api/order/enum/order-status.js.map +1 -1
- package/dist/api/order/enum/orderType.d.ts +4 -0
- package/dist/api/order/enum/orderType.js +24 -2
- package/dist/api/order/enum/orderType.js.map +1 -1
- package/dist/api/order/enum/tif.d.ts +30 -0
- package/dist/api/order/enum/tif.js +33 -0
- package/dist/api/order/enum/tif.js.map +1 -0
- package/dist/api/order/enum/trigger-method.js +1 -1
- package/dist/api/order/enum/trigger-method.js.map +1 -1
- package/dist/api/order/execution.d.ts +1 -0
- package/dist/api/order/order.d.ts +21 -6
- package/dist/api/order/order.js +2 -0
- package/dist/api/order/order.js.map +1 -1
- package/dist/api/order/stop.d.ts +3 -2
- package/dist/api/order/stop.js +2 -1
- package/dist/api/order/stop.js.map +1 -1
- package/dist/api/order/stopLimit.d.ts +3 -2
- package/dist/api/order/stopLimit.js +2 -1
- package/dist/api/order/stopLimit.js.map +1 -1
- package/dist/api/order/trailingStop.d.ts +4 -3
- package/dist/api/order/trailingStop.js +2 -1
- package/dist/api/order/trailingStop.js.map +1 -1
- package/dist/api-next/api-next.d.ts +19 -8
- package/dist/api-next/api-next.js +91 -35
- package/dist/api-next/api-next.js.map +1 -1
- package/dist/api-next/common/connection-state.js +1 -1
- package/dist/api-next/common/connection-state.js.map +1 -1
- package/dist/api-next/common/item-list-update.d.ts +0 -2
- package/dist/api-next/market/market-data-type.js +1 -1
- package/dist/api-next/market/market-data-type.js.map +1 -1
- package/dist/api-next/market/tick-type.js +1 -1
- package/dist/api-next/market/tick-type.js.map +1 -1
- package/dist/api-next/market-scanner/market-scanner.d.ts +0 -5
- package/dist/api-next/market-scanner/market-scanner.js +8 -8
- package/dist/api-next/market-scanner/market-scanner.js.map +1 -1
- package/dist/common/errorCode.d.ts +4 -1
- package/dist/common/errorCode.js +5 -1
- package/dist/common/errorCode.js.map +1 -1
- package/dist/core/api-next/item-list-update.d.ts +1 -2
- package/dist/core/api-next/item-list-update.js +1 -2
- package/dist/core/api-next/item-list-update.js.map +1 -1
- package/dist/core/api-next/subscription.d.ts +7 -7
- package/dist/core/api-next/subscription.js +16 -16
- package/dist/core/api-next/subscription.js.map +1 -1
- package/dist/core/io/controller.js +9 -0
- package/dist/core/io/controller.js.map +1 -1
- package/dist/core/io/decoder.d.ts +12 -6
- package/dist/core/io/decoder.js +79 -57
- package/dist/core/io/decoder.js.map +1 -1
- package/dist/core/io/encoder.d.ts +9 -7
- package/dist/core/io/encoder.js +99 -14
- package/dist/core/io/encoder.js.map +1 -1
- package/dist/core/io/enum/in-msg-id.js +1 -1
- package/dist/core/io/enum/in-msg-id.js.map +1 -1
- package/dist/core/io/socket.d.ts +4 -0
- package/dist/core/io/socket.js +5 -5
- package/dist/core/io/socket.js.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.js +12 -7
- package/dist/index.js.map +1 -1
- package/dist/tests/unit/api/api.test.js +22 -22
- package/dist/tests/unit/api/api.test.js.map +1 -1
- package/dist/tests/unit/api/connect.test.js +11 -9
- package/dist/tests/unit/api/connect.test.js.map +1 -1
- package/dist/tests/unit/api/contract-details.test.d.ts +1 -0
- package/dist/tests/unit/api/contract-details.test.js +114 -0
- package/dist/tests/unit/api/contract-details.test.js.map +1 -0
- package/dist/tests/unit/api/market-data.test.js +16 -13
- package/dist/tests/unit/api/market-data.test.js.map +1 -1
- package/dist/tests/unit/api/market-scanner.test.d.ts +1 -0
- package/dist/tests/unit/api/market-scanner.test.js +71 -0
- package/dist/tests/unit/api/market-scanner.test.js.map +1 -0
- package/dist/tests/unit/api/matching-symbols.test.d.ts +1 -0
- package/dist/tests/unit/api/matching-symbols.test.js +84 -0
- package/dist/tests/unit/api/matching-symbols.test.js.map +1 -0
- package/dist/tests/unit/api/order/cancelOrder.test.d.ts +1 -0
- package/dist/tests/unit/api/order/cancelOrder.test.js +86 -0
- package/dist/tests/unit/api/order/cancelOrder.test.js.map +1 -0
- package/dist/tests/unit/api/order/placeOrder.test.js +69 -92
- package/dist/tests/unit/api/order/placeOrder.test.js.map +1 -1
- package/dist/tests/unit/api/order/reqAllOpenOrders.test.js +27 -26
- package/dist/tests/unit/api/order/reqAllOpenOrders.test.js.map +1 -1
- package/dist/tests/unit/api/wsh-event-data.test.d.ts +1 -0
- package/dist/tests/unit/api/wsh-event-data.test.js +113 -0
- package/dist/tests/unit/api/wsh-event-data.test.js.map +1 -0
- package/dist/tests/unit/api-next/get-account-summary.test.js +17 -6
- package/dist/tests/unit/api-next/get-account-summary.test.js.map +1 -1
- package/dist/tests/unit/api-next/get-all-open-orders.test.js +1 -2
- package/dist/tests/unit/api-next/get-all-open-orders.test.js.map +1 -1
- package/dist/tests/unit/api-next/get-head-timestamp.test.js +1 -1
- package/dist/tests/unit/api-next/get-head-timestamp.test.js.map +1 -1
- package/dist/tests/unit/api-next/get-historical-data-updates.test.js +1 -1
- package/dist/tests/unit/api-next/get-historical-data-updates.test.js.map +1 -1
- package/dist/tests/unit/api-next/get-historical-data.test.js +2 -2
- package/dist/tests/unit/api-next/get-historical-data.test.js.map +1 -1
- package/dist/tests/unit/api-next/{search-contracts.test.js → get-matching-symbols.js} +3 -3
- package/dist/tests/unit/api-next/get-matching-symbols.js.map +1 -0
- package/dist/tests/unit/api-next/get-positions.test.js +3 -0
- package/dist/tests/unit/api-next/get-positions.test.js.map +1 -1
- package/dist/tools/account-summary.js +1 -7
- package/dist/tools/account-summary.js.map +1 -1
- package/dist/tools/commission-reports.d.ts +3 -0
- package/dist/tools/commission-reports.js +2 -8
- package/dist/tools/commission-reports.js.map +1 -1
- package/dist/tools/common/ib-api-next-app.d.ts +2 -0
- package/dist/tools/common/ib-api-next-app.js +8 -0
- package/dist/tools/common/ib-api-next-app.js.map +1 -1
- package/dist/tools/contract-details.js +1 -7
- package/dist/tools/contract-details.js.map +1 -1
- package/dist/tools/current-time.js +1 -7
- package/dist/tools/current-time.js.map +1 -1
- package/dist/tools/execution-details.d.ts +3 -0
- package/dist/tools/execution-details.js +2 -8
- package/dist/tools/execution-details.js.map +1 -1
- package/dist/tools/get-head-timestamp.js +3 -8
- package/dist/tools/get-head-timestamp.js.map +1 -1
- package/dist/tools/histogram-data.d.ts +3 -0
- package/dist/tools/histogram-data.js +4 -7
- package/dist/tools/histogram-data.js.map +1 -1
- package/dist/tools/historical-data-updates.js +3 -11
- package/dist/tools/historical-data-updates.js.map +1 -1
- package/dist/tools/historical-data.d.ts +3 -0
- package/dist/tools/historical-data.js +4 -9
- package/dist/tools/historical-data.js.map +1 -1
- package/dist/tools/historical-ticks-bid-ask.js +1 -7
- package/dist/tools/historical-ticks-bid-ask.js.map +1 -1
- package/dist/tools/historical-ticks-last.js +1 -7
- package/dist/tools/historical-ticks-last.js.map +1 -1
- package/dist/tools/historical-ticks-mid.js +1 -7
- package/dist/tools/historical-ticks-mid.js.map +1 -1
- package/dist/tools/managed-accts.js +1 -7
- package/dist/tools/managed-accts.js.map +1 -1
- package/dist/tools/market-data-snapshot.js +1 -8
- package/dist/tools/market-data-snapshot.js.map +1 -1
- package/dist/tools/market-data.js +1 -8
- package/dist/tools/market-data.js.map +1 -1
- package/dist/tools/market-depth-exchanges.js +1 -7
- package/dist/tools/market-depth-exchanges.js.map +1 -1
- package/dist/tools/market-depth.js +1 -7
- package/dist/tools/market-depth.js.map +1 -1
- package/dist/tools/market-scanner.js +1 -7
- package/dist/tools/market-scanner.js.map +1 -1
- package/dist/tools/modify-order.js +1 -4
- package/dist/tools/modify-order.js.map +1 -1
- package/dist/tools/next-valid-order-id.js +1 -7
- package/dist/tools/next-valid-order-id.js.map +1 -1
- package/dist/tools/open-orders-auto.js +1 -7
- package/dist/tools/open-orders-auto.js.map +1 -1
- package/dist/tools/open-orders.js +1 -7
- package/dist/tools/open-orders.js.map +1 -1
- package/dist/tools/place-new-order.js +1 -4
- package/dist/tools/place-new-order.js.map +1 -1
- package/dist/tools/place-order.js +1 -2
- package/dist/tools/place-order.js.map +1 -1
- package/dist/tools/pnl-single.js +1 -10
- package/dist/tools/pnl-single.js.map +1 -1
- package/dist/tools/pnl.js +1 -10
- package/dist/tools/pnl.js.map +1 -1
- package/dist/tools/positions.js +1 -7
- package/dist/tools/positions.js.map +1 -1
- package/dist/tools/search-contracts.js +2 -8
- package/dist/tools/search-contracts.js.map +1 -1
- package/dist/tools/sec-def-opt-params.js +1 -7
- package/dist/tools/sec-def-opt-params.js.map +1 -1
- package/dist/tools/user-info.js +1 -7
- package/dist/tools/user-info.js.map +1 -1
- package/package.json +6 -6
- package/dist/tests/unit/api-next/search-contracts.test.js.map +0 -1
- /package/dist/tests/unit/api-next/{search-contracts.test.d.ts → get-matching-symbols.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
<div style="display: flex;justify-content:center;">
|
|
7
7
|
<img src="https://img.shields.io/github/package-json/v/stoqey/ib"></img>
|
|
8
8
|
<img src="https://circleci.com/gh/stoqey/ib.svg?style=svg"></img>
|
|
9
|
-
<
|
|
9
|
+
<img src="https://img.shields.io/badge/License-MIT-blue.svg"/>
|
|
10
10
|
<img src="https://img.shields.io/npm/dt/@stoqey/ib.svg"></img>
|
|
11
11
|
</div>
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
|
-
`@stoqey/ib` is an [Interactive Brokers](http://interactivebrokers.com/) TWS (or IB Gateway) Typescript API client library for [Node.js](http://nodejs.org/). It is a direct port of Interactive Brokers' Java Client Version
|
|
14
|
+
`@stoqey/ib` is an [Interactive Brokers](http://interactivebrokers.com/) TWS (or IB Gateway) Typescript API client library for [Node.js](http://nodejs.org/). It is a direct port of Interactive Brokers' Java Client Version 10.25 ("latest") from Sept 7 2023.
|
|
15
15
|
|
|
16
16
|
Refer to the [Trader Workstation API](https://interactivebrokers.github.io/tws-api/) for the official documentation and the C#/Java/VB/C++/Python client.
|
|
17
17
|
|
|
@@ -117,7 +117,7 @@ ib.on(EventName.error, (err: Error, code: ErrorCode, reqId: number) => {
|
|
|
117
117
|
(account: string, contract: Contract, pos: number, avgCost?: number) => {
|
|
118
118
|
console.log(`${account}: ${pos} x ${contract.symbol} @ ${avgCost}`);
|
|
119
119
|
positionsCount++;
|
|
120
|
-
}
|
|
120
|
+
},
|
|
121
121
|
)
|
|
122
122
|
.once(EventName.positionEnd, () => {
|
|
123
123
|
console.log(`Total: ${positionsCount} positions.`);
|
package/dist/api/api.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { EventEmitter } from "eventemitter3";
|
|
2
|
-
import { DurationUnit } from "..";
|
|
2
|
+
import { DurationUnit, WhatToShow } from "..";
|
|
3
3
|
import { ErrorCode } from "../common/errorCode";
|
|
4
4
|
import { Contract } from "./contract/contract";
|
|
5
5
|
import { ContractDescription } from "./contract/contractDescription";
|
|
6
6
|
import { ContractDetails } from "./contract/contractDetails";
|
|
7
7
|
import { DeltaNeutralContract } from "./contract/deltaNeutralContract";
|
|
8
|
+
import WshEventData from "./contract/wsh";
|
|
8
9
|
import DepthMktDataDescription from "./data/container/depth-mkt-data-description";
|
|
9
10
|
import FamilyCode from "./data/container/family-code";
|
|
10
11
|
import NewsProvider from "./data/container/news-provider";
|
|
@@ -65,7 +66,7 @@ export interface IBApiCreationOptions {
|
|
|
65
66
|
maxReqPerSec?: number;
|
|
66
67
|
}
|
|
67
68
|
/** Maximum supported version. */
|
|
68
|
-
export declare const MAX_SUPPORTED_SERVER_VERSION = MIN_SERVER_VER.
|
|
69
|
+
export declare const MAX_SUPPORTED_SERVER_VERSION = MIN_SERVER_VER.PENDING_PRICE_REVISION;
|
|
69
70
|
/** Minimum supported version. */
|
|
70
71
|
export declare const MIN_SERVER_VER_SUPPORTED = 38;
|
|
71
72
|
/**
|
|
@@ -180,44 +181,44 @@ export declare class IBApi extends EventEmitter {
|
|
|
180
181
|
/**
|
|
181
182
|
* Cancels a pending [[reqHeadTimeStamp]] request.
|
|
182
183
|
*
|
|
183
|
-
* @param
|
|
184
|
+
* @param reqId Id of the request
|
|
184
185
|
*
|
|
185
186
|
* @see [[reqHeadTimeStamp]]
|
|
186
187
|
*/
|
|
187
|
-
cancelHeadTimestamp(
|
|
188
|
+
cancelHeadTimestamp(reqId: number): IBApi;
|
|
188
189
|
/**
|
|
189
190
|
* Cancels a historical data request.
|
|
190
191
|
*
|
|
191
|
-
* @param
|
|
192
|
+
* @param reqId The request's identifier.
|
|
192
193
|
*
|
|
193
194
|
* @see [[reqHistogramData]]
|
|
194
195
|
*/
|
|
195
|
-
cancelHistogramData(
|
|
196
|
+
cancelHistogramData(reqId: number): IBApi;
|
|
196
197
|
/**
|
|
197
198
|
* Cancels a historical data request.
|
|
198
199
|
*
|
|
199
|
-
* @param
|
|
200
|
+
* @param reqId The request's identifier.
|
|
200
201
|
*
|
|
201
202
|
* @see [[reqHistoricalData]]
|
|
202
203
|
*/
|
|
203
|
-
cancelHistoricalData(
|
|
204
|
+
cancelHistoricalData(reqId: number): IBApi;
|
|
204
205
|
/**
|
|
205
206
|
* Cancels a RT Market Data request.
|
|
206
207
|
*
|
|
207
|
-
* @param
|
|
208
|
+
* @param reqId The request's identifier.
|
|
208
209
|
*
|
|
209
210
|
* @see [[reqMktData]]
|
|
210
211
|
*/
|
|
211
|
-
cancelMktData(
|
|
212
|
+
cancelMktData(reqId: number): IBApi;
|
|
212
213
|
/**
|
|
213
214
|
* Cancel a market depth's request.
|
|
214
215
|
*
|
|
215
|
-
* @param
|
|
216
|
+
* @param reqId The request's identifier.
|
|
216
217
|
* @param isSmartDepth TODO document
|
|
217
218
|
*
|
|
218
219
|
* @see [[reqMktDepth]]
|
|
219
220
|
*/
|
|
220
|
-
cancelMktDepth(
|
|
221
|
+
cancelMktDepth(reqId: number, isSmartDepth: boolean): IBApi;
|
|
221
222
|
/**
|
|
222
223
|
* Cancels IB's news bulletin subscription.
|
|
223
224
|
*
|
|
@@ -268,9 +269,9 @@ export declare class IBApi extends EventEmitter {
|
|
|
268
269
|
/**
|
|
269
270
|
* Cancels Real Time Bars' subscription.
|
|
270
271
|
*
|
|
271
|
-
* @param
|
|
272
|
+
* @param reqId The request's identifier.
|
|
272
273
|
*/
|
|
273
|
-
cancelRealTimeBars(
|
|
274
|
+
cancelRealTimeBars(reqId: number): IBApi;
|
|
274
275
|
/**
|
|
275
276
|
* Cancels Scanner Subscription.
|
|
276
277
|
*
|
|
@@ -282,17 +283,17 @@ export declare class IBApi extends EventEmitter {
|
|
|
282
283
|
/**
|
|
283
284
|
* Cancels tick-by-tick data.
|
|
284
285
|
*
|
|
285
|
-
* @param
|
|
286
|
+
* @param reqId Unique identifier of the request.
|
|
286
287
|
*
|
|
287
288
|
* @see [[reqTickByTickData]]
|
|
288
289
|
*/
|
|
289
|
-
cancelTickByTickData(
|
|
290
|
+
cancelTickByTickData(reqId: number): IBApi;
|
|
290
291
|
/**
|
|
291
292
|
* Exercises an options contract.
|
|
292
293
|
*
|
|
293
294
|
* Note: this function is affected by a TWS setting which specifies if an exercise request must be finalized.
|
|
294
295
|
*
|
|
295
|
-
* @param
|
|
296
|
+
* @param reqId The exercise request's identifier.
|
|
296
297
|
* @param contract The option [[Contract]] to be exercised.
|
|
297
298
|
* @param exerciseAction 1 to exercise the option, 2 to let the option lapse.
|
|
298
299
|
* @param exerciseQuantity Number of contracts to be exercised.
|
|
@@ -303,7 +304,7 @@ export declare class IBApi extends EventEmitter {
|
|
|
303
304
|
* If you have override set to "yes" the natural action would be overridden and the out-of-the money option would be
|
|
304
305
|
* exercised. Set to 1 to override, set to 0 not to.
|
|
305
306
|
*/
|
|
306
|
-
exerciseOptions(
|
|
307
|
+
exerciseOptions(reqId: number, contract: Contract, exerciseAction: OptionExerciseAction, exerciseQuantity: number, account: string, override: number): IBApi;
|
|
307
308
|
/**
|
|
308
309
|
* Places or modifies an order.
|
|
309
310
|
* @param id The order's unique identifier.
|
|
@@ -358,7 +359,7 @@ export declare class IBApi extends EventEmitter {
|
|
|
358
359
|
* securities account without depositing additional funds
|
|
359
360
|
* - EquityWithLoanValue — Forms the basis for determining whether a client has the necessary assets to either
|
|
360
361
|
* initiate or maintain security positions. Cash + stocks + bonds + mutual funds
|
|
361
|
-
* -
|
|
362
|
+
* - PreviousDayEquityWithLoanValue — Marginable Equity with Loan value as of 16:00 ET the previous day
|
|
362
363
|
* - GrossPositionValue — The sum of the absolute value of all stock and equity option positions
|
|
363
364
|
* - RegTEquity — Regulation T equity for universal account
|
|
364
365
|
* - RegTMargin — Regulation T margin for universal account
|
|
@@ -464,11 +465,11 @@ export declare class IBApi extends EventEmitter {
|
|
|
464
465
|
* Requests event data from the wSH calendar.
|
|
465
466
|
*
|
|
466
467
|
* @param reqId The unique request identifier.
|
|
467
|
-
* @param conId Contract id of ticker.
|
|
468
|
+
* @param conId Contract id of ticker or WshEventData describing wanted events.
|
|
468
469
|
*
|
|
469
470
|
* @see [[reqCancelWshEventData]]
|
|
470
471
|
*/
|
|
471
|
-
reqWshEventData(reqId: number,
|
|
472
|
+
reqWshEventData(reqId: number, wshEventData: number | WshEventData): this;
|
|
472
473
|
/**
|
|
473
474
|
* Cancels pending WSH event data request.
|
|
474
475
|
*
|
|
@@ -537,17 +538,17 @@ export declare class IBApi extends EventEmitter {
|
|
|
537
538
|
* @param formatDate Set to 1 to obtain the bars' time as yyyyMMdd HH:mm:ss, set to 2 to obtain it like system time
|
|
538
539
|
* format in seconds.
|
|
539
540
|
*/
|
|
540
|
-
reqHeadTimestamp(reqId: number, contract: Contract, whatToShow:
|
|
541
|
+
reqHeadTimestamp(reqId: number, contract: Contract, whatToShow: WhatToShow, useRTH: boolean, formatDate: number): IBApi;
|
|
541
542
|
/**
|
|
542
543
|
* Returns data histogram of specified contract.
|
|
543
544
|
*
|
|
544
|
-
* @param
|
|
545
|
+
* @param reqId An identifier for the request.
|
|
545
546
|
* @param contract [[Contract]] object for which histogram is being requested
|
|
546
547
|
* @param useRTH Use regular trading hours only, `true` for yes or `false` for no.
|
|
547
548
|
* @param period Period of which data is being requested
|
|
548
549
|
* @param periodUnit Unit of the period of which data is being requested
|
|
549
550
|
*/
|
|
550
|
-
reqHistogramData(
|
|
551
|
+
reqHistogramData(reqId: number, contract: Contract, useRTH: boolean, period: number, periodUnit: DurationUnit): IBApi;
|
|
551
552
|
/**
|
|
552
553
|
* Requests contracts' historical data. When requesting historical data, a finishing time and date is required along
|
|
553
554
|
* with a duration string. For example, having:
|
|
@@ -560,7 +561,7 @@ export declare class IBApi extends EventEmitter {
|
|
|
560
561
|
*
|
|
561
562
|
* The resulting bars will be emitted as historicalData event.
|
|
562
563
|
*
|
|
563
|
-
* @param
|
|
564
|
+
* @param reqId The request's unique identifier.
|
|
564
565
|
* @param contract The contract for which we want to retrieve the data.
|
|
565
566
|
* @param endDateTime Request's ending time with format yyyyMMdd HH:mm:ss {TMZ}
|
|
566
567
|
* @param durationStr The amount of time for which the data needs to be retrieved:
|
|
@@ -597,7 +598,7 @@ export declare class IBApi extends EventEmitter {
|
|
|
597
598
|
* @param keepUpToDate Set to `true` to received continuous updates on most recent bar data. If `true`, and
|
|
598
599
|
* endDateTime cannot be specified.
|
|
599
600
|
*/
|
|
600
|
-
reqHistoricalData(
|
|
601
|
+
reqHistoricalData(reqId: number, contract: Contract, endDateTime: string, durationStr: string, barSizeSetting: BarSizeSetting, whatToShow: WhatToShow, useRTH: number, formatDate: number, keepUpToDate: boolean): IBApi;
|
|
601
602
|
/**
|
|
602
603
|
* Requests historical news headlines.
|
|
603
604
|
*
|
|
@@ -621,7 +622,7 @@ export declare class IBApi extends EventEmitter {
|
|
|
621
622
|
* @param useRTH Data from regular trading hours (1), or all available hours (0)
|
|
622
623
|
* @param ignoreSize A filter only used when the source price is Bid_Ask
|
|
623
624
|
*/
|
|
624
|
-
reqHistoricalTicks(reqId: number, contract: Contract, startDateTime: string, endDateTime: string, numberOfTicks: number, whatToShow:
|
|
625
|
+
reqHistoricalTicks(reqId: number, contract: Contract, startDateTime: string, endDateTime: string, numberOfTicks: number, whatToShow: WhatToShow, useRTH: number, ignoreSize: boolean): IBApi;
|
|
625
626
|
/**
|
|
626
627
|
* Requests the next valid order ID at the current moment.
|
|
627
628
|
*
|
|
@@ -657,7 +658,7 @@ export declare class IBApi extends EventEmitter {
|
|
|
657
658
|
* The number of simultaneous market depth requests allowed in an account is calculated based on a formula
|
|
658
659
|
* that looks at an accounts equity, commissions, and quote booster packs.
|
|
659
660
|
*
|
|
660
|
-
* @param
|
|
661
|
+
* @param reqId The request's identifier.
|
|
661
662
|
* @param contract The [[Contract]] for which the depth is being requested.
|
|
662
663
|
* @param numRows The number of rows on each side of the order book.
|
|
663
664
|
* @param isSmartDepth Flag indicates that this is smart depth request.
|
|
@@ -665,7 +666,7 @@ export declare class IBApi extends EventEmitter {
|
|
|
665
666
|
*
|
|
666
667
|
* @see [[cancelMktDepth]]
|
|
667
668
|
*/
|
|
668
|
-
reqMktDepth(
|
|
669
|
+
reqMktDepth(reqId: number, contract: Contract, numRows: number, isSmartDepth: boolean, mktDepthOptions?: TagValue[]): IBApi;
|
|
669
670
|
/**
|
|
670
671
|
* Requests details about a given market rule.
|
|
671
672
|
* The market rule for an instrument on a particular exchange provides details about how the minimum price increment
|
|
@@ -690,7 +691,7 @@ export declare class IBApi extends EventEmitter {
|
|
|
690
691
|
* Returns market data for an instrument either in real time or 10-15 minutes delayed (depending on the market data
|
|
691
692
|
* type specified).
|
|
692
693
|
*
|
|
693
|
-
* @param
|
|
694
|
+
* @param reqId The request's identifier.
|
|
694
695
|
* @param contract The [[Contract]] for which the data is being requested
|
|
695
696
|
* @param genericTickList comma separated ids of the available generic ticks:
|
|
696
697
|
* - 100 Option Volume (currently for stocks)
|
|
@@ -718,7 +719,7 @@ export declare class IBApi extends EventEmitter {
|
|
|
718
719
|
*
|
|
719
720
|
* @see [[cancelMktData]]
|
|
720
721
|
*/
|
|
721
|
-
reqMktData(
|
|
722
|
+
reqMktData(reqId: number, contract: Contract, genericTickList: string, snapshot: boolean, regulatorySnapshot: boolean): IBApi;
|
|
722
723
|
/**
|
|
723
724
|
* Requests venues for which market data is returned to updateMktDepthL2 (those with market makers)
|
|
724
725
|
*/
|
|
@@ -795,7 +796,7 @@ export declare class IBApi extends EventEmitter {
|
|
|
795
796
|
* than 600 seconds. Real time bars subscriptions are also included in the calculation of the number of Level 1
|
|
796
797
|
* market data subscriptions allowed in an account.
|
|
797
798
|
*
|
|
798
|
-
* @param
|
|
799
|
+
* @param reqId The request's unique identifier.
|
|
799
800
|
* @param contract The [[Contract]] for which the depth is being requested
|
|
800
801
|
* @param barSize currently being ignored
|
|
801
802
|
* @param whatToShow the nature of the data being retrieved:
|
|
@@ -808,7 +809,7 @@ export declare class IBApi extends EventEmitter {
|
|
|
808
809
|
*
|
|
809
810
|
* @see [[cancelRealTimeBars]]
|
|
810
811
|
*/
|
|
811
|
-
reqRealTimeBars(
|
|
812
|
+
reqRealTimeBars(reqId: number, contract: Contract, barSize: number, whatToShow: WhatToShow, useRTH: boolean, realTimeBarsOptions?: TagValue[]): IBApi;
|
|
812
813
|
/**
|
|
813
814
|
* Requests an XML list of scanner parameters valid in TWS.
|
|
814
815
|
*
|
|
@@ -1034,7 +1035,7 @@ export declare interface IBApi {
|
|
|
1034
1035
|
* securities account without depositing additional funds.
|
|
1035
1036
|
* - EquityWithLoanValue: Forms the basis for determining whether a client has the necessary assets to either
|
|
1036
1037
|
* initiate or maintain security positions. Cash + stocks + bonds + mutual funds
|
|
1037
|
-
* -
|
|
1038
|
+
* - PreviousDayEquityWithLoanValue: Marginable Equity with Loan value as of 16:00 ET the previous day
|
|
1038
1039
|
* - GrossPositionValue: The sum of the absolute value of all stock and equity option positions
|
|
1039
1040
|
* - RegTEquity:Regulation T equity for universal account
|
|
1040
1041
|
* - RegTMargin. Regulation T margin for universal account
|
|
@@ -1395,7 +1396,9 @@ export declare interface IBApi {
|
|
|
1395
1396
|
* @see https://interactivebrokers.github.io/tws-api/historical_bars.html#hd_what_to_show
|
|
1396
1397
|
* for additional context regarding meaning of price for different bar types
|
|
1397
1398
|
*/
|
|
1398
|
-
on(event: EventName.historicalData, listener: (reqId: number, time: string, open: number, high: number, low: number, close: number, volume: number, count: number | undefined, WAP: number,
|
|
1399
|
+
on(event: EventName.historicalData, listener: (reqId: number, time: string, open: number, high: number, low: number, close: number, volume: number, count: number | undefined, WAP: number,
|
|
1400
|
+
/** @deprecated */
|
|
1401
|
+
hasGaps: boolean | undefined) => void): this;
|
|
1399
1402
|
/**
|
|
1400
1403
|
* Receives bars in real time if keepUpToDate is `true` in reqHistoricalData.
|
|
1401
1404
|
* Similar to realTimeBars function, except returned data is a composite of historical data and
|
|
@@ -1933,7 +1936,7 @@ export declare interface IBApi {
|
|
|
1933
1936
|
* Exchange for Physicals.
|
|
1934
1937
|
*
|
|
1935
1938
|
* @param listener
|
|
1936
|
-
*
|
|
1939
|
+
* reqId: The request's identifier.
|
|
1937
1940
|
*
|
|
1938
1941
|
* tickType: The type of tick being received.
|
|
1939
1942
|
*
|
|
@@ -1952,12 +1955,12 @@ export declare interface IBApi {
|
|
|
1952
1955
|
*
|
|
1953
1956
|
* dividendsToLastTradeDate: The dividends expected until the expiration of the single stock future.
|
|
1954
1957
|
*/
|
|
1955
|
-
on(event: EventName.tickEFP, listener: (
|
|
1958
|
+
on(event: EventName.tickEFP, listener: (reqId: number, tickType: number, basisPoints: number, formattedBasisPoints: string, impliedFuture: number, holdDays: number, futureLastTradeDate: string, dividendImpact: number, dividendsToLastTradeDate: number) => void): this;
|
|
1956
1959
|
/**
|
|
1957
1960
|
* Provides a market data generic tick.
|
|
1958
1961
|
*
|
|
1959
1962
|
* @param listener
|
|
1960
|
-
*
|
|
1963
|
+
* reqId: The id of request.
|
|
1961
1964
|
*
|
|
1962
1965
|
* field: The type of tick being received.
|
|
1963
1966
|
*
|
|
@@ -1965,12 +1968,12 @@ export declare interface IBApi {
|
|
|
1965
1968
|
*
|
|
1966
1969
|
* @see [[reqTickByTickData]]
|
|
1967
1970
|
*/
|
|
1968
|
-
on(event: EventName.tickGeneric, listener: (
|
|
1971
|
+
on(event: EventName.tickGeneric, listener: (reqId: number, field: TickType, value: number) => void): this;
|
|
1969
1972
|
/**
|
|
1970
1973
|
* Provides a news headline tick.
|
|
1971
1974
|
*
|
|
1972
1975
|
* @param listener
|
|
1973
|
-
*
|
|
1976
|
+
* reqId: The id of request.
|
|
1974
1977
|
*
|
|
1975
1978
|
* field: The type of tick being received.
|
|
1976
1979
|
*
|
|
@@ -1978,7 +1981,7 @@ export declare interface IBApi {
|
|
|
1978
1981
|
*
|
|
1979
1982
|
* @see [[reqTickByTickData]]
|
|
1980
1983
|
*/
|
|
1981
|
-
on(event: EventName.tickNews, listener: (
|
|
1984
|
+
on(event: EventName.tickNews, listener: (reqId: number, timeStamp: number, providerCode: string, articleId: string, headline: string, extraData: string) => void): this;
|
|
1982
1985
|
/**
|
|
1983
1986
|
* Provides option specific market data.
|
|
1984
1987
|
* This method is called when the market in an option or its underlier moves.
|
|
@@ -1986,7 +1989,7 @@ export declare interface IBApi {
|
|
|
1986
1989
|
* options underlier are received.
|
|
1987
1990
|
*
|
|
1988
1991
|
* @param listener
|
|
1989
|
-
*
|
|
1992
|
+
* reqId: The id of request.
|
|
1990
1993
|
*
|
|
1991
1994
|
* field: Specifies the type of option computation.
|
|
1992
1995
|
* Pass the field value into [[TickType.getField]] to retrieve the field description.
|
|
@@ -2013,7 +2016,7 @@ export declare interface IBApi {
|
|
|
2013
2016
|
*
|
|
2014
2017
|
* @see [[reqMktData]]
|
|
2015
2018
|
*/
|
|
2016
|
-
on(event: EventName.tickOptionComputation, listener: (
|
|
2019
|
+
on(event: EventName.tickOptionComputation, listener: (reqId: number, field: TickType, impliedVolatility?: number, delta?: number, optPrice?: number, pvDividend?: number, gamma?: number, vega?: number, theta?: number, undPrice?: number) => void): this;
|
|
2017
2020
|
/**
|
|
2018
2021
|
* Market data tick price callback. Handles all price related ticks.
|
|
2019
2022
|
* Every tickPrice callback is followed by a tickSize.
|
|
@@ -2022,7 +2025,7 @@ export declare interface IBApi {
|
|
|
2022
2025
|
* contract).
|
|
2023
2026
|
*
|
|
2024
2027
|
* @param listener
|
|
2025
|
-
*
|
|
2028
|
+
* reqId: The id of request.
|
|
2026
2029
|
*
|
|
2027
2030
|
* field: The type of the price being received.
|
|
2028
2031
|
*
|
|
@@ -2034,21 +2037,21 @@ export declare interface IBApi {
|
|
|
2034
2037
|
*
|
|
2035
2038
|
* @see [[reqMktData]]
|
|
2036
2039
|
*/
|
|
2037
|
-
on(event: EventName.tickPrice, listener: (
|
|
2040
|
+
on(event: EventName.tickPrice, listener: (reqId: number, field: TickType, value: number, attribs?: unknown) => void): this;
|
|
2038
2041
|
/**
|
|
2039
2042
|
* A tick with BOO exchange and snapshot permissions.
|
|
2040
2043
|
*
|
|
2041
2044
|
* @param listener
|
|
2042
|
-
*
|
|
2045
|
+
* reqId: The id of request.
|
|
2043
2046
|
*
|
|
2044
2047
|
* @see [[reqMktData]]
|
|
2045
2048
|
*/
|
|
2046
|
-
on(event: EventName.tickReqParams, listener: (
|
|
2049
|
+
on(event: EventName.tickReqParams, listener: (reqId: number, minTick: number, bboExchange: string, snapshotPermissions: number) => void): this;
|
|
2047
2050
|
/**
|
|
2048
2051
|
* Market data tick size callback. Handles all size-related ticks.
|
|
2049
2052
|
*
|
|
2050
2053
|
* @param listener
|
|
2051
|
-
*
|
|
2054
|
+
* reqId: The id of request.
|
|
2052
2055
|
*
|
|
2053
2056
|
* field: The type of size being received (i.e. bid size)
|
|
2054
2057
|
*
|
|
@@ -2056,14 +2059,14 @@ export declare interface IBApi {
|
|
|
2056
2059
|
*
|
|
2057
2060
|
* @see [[reqMktData]]
|
|
2058
2061
|
*/
|
|
2059
|
-
on(event: EventName.tickSize, listener: (
|
|
2062
|
+
on(event: EventName.tickSize, listener: (reqId: number, field?: TickType, value?: number) => void): this;
|
|
2060
2063
|
/**
|
|
2061
2064
|
* Market data callback. Every tickPrice is followed by a tickSize.
|
|
2062
2065
|
* There are also independent tickSize callbacks anytime the tickSize changes, and so there will be duplicate
|
|
2063
2066
|
* tickSize messages following a tickPrice.
|
|
2064
2067
|
*
|
|
2065
2068
|
* @param listener
|
|
2066
|
-
*
|
|
2069
|
+
* reqId: The id of request.
|
|
2067
2070
|
*
|
|
2068
2071
|
* field: The type of size being received (i.e. bid size)
|
|
2069
2072
|
*
|
|
@@ -2071,7 +2074,7 @@ export declare interface IBApi {
|
|
|
2071
2074
|
*
|
|
2072
2075
|
* @see [[reqMktData]]
|
|
2073
2076
|
*/
|
|
2074
|
-
on(event: EventName.tickString, listener: (
|
|
2077
|
+
on(event: EventName.tickString, listener: (reqId: number, field: TickType, value: string) => void): this;
|
|
2075
2078
|
/**
|
|
2076
2079
|
* Receives the last time on which the account was updated.
|
|
2077
2080
|
*
|
|
@@ -2262,7 +2265,7 @@ export declare interface IBApi {
|
|
|
2262
2265
|
* Returns the order book.
|
|
2263
2266
|
*
|
|
2264
2267
|
* @param listener
|
|
2265
|
-
*
|
|
2268
|
+
* reqId: The request's identifier.
|
|
2266
2269
|
*
|
|
2267
2270
|
* position: The order book's row being updated.
|
|
2268
2271
|
*
|
|
@@ -2279,12 +2282,12 @@ export declare interface IBApi {
|
|
|
2279
2282
|
*
|
|
2280
2283
|
* @see [[reqMktDepth]]
|
|
2281
2284
|
*/
|
|
2282
|
-
on(event: EventName.updateMktDepth, listener: (
|
|
2285
|
+
on(event: EventName.updateMktDepth, listener: (reqId: number, position: number, operation: number, side: number, price: number, size: number) => void): this;
|
|
2283
2286
|
/**
|
|
2284
2287
|
* Returns the order book (level 2).
|
|
2285
2288
|
*
|
|
2286
2289
|
* @param listener
|
|
2287
|
-
*
|
|
2290
|
+
* reqId: The request's identifier.
|
|
2288
2291
|
*
|
|
2289
2292
|
* position: The order book's row being updated.
|
|
2290
2293
|
*
|
|
@@ -2305,7 +2308,7 @@ export declare interface IBApi {
|
|
|
2305
2308
|
*
|
|
2306
2309
|
* @see [[reqMktDepth]]
|
|
2307
2310
|
*/
|
|
2308
|
-
on(event: EventName.updateMktDepthL2, listener: (
|
|
2311
|
+
on(event: EventName.updateMktDepthL2, listener: (reqId: number, position: number, marketMaker: string, operation: number, side: number, price: number, size: number, isSmartDepth?: boolean) => void): this;
|
|
2309
2312
|
/**
|
|
2310
2313
|
* Provides IB's bulletins.
|
|
2311
2314
|
*
|