@stoqey/ib 1.3.9 → 1.3.11

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.
Files changed (142) hide show
  1. package/README.md +3 -3
  2. package/dist/api/api.d.ts +67 -61
  3. package/dist/api/api.js +58 -49
  4. package/dist/api/api.js.map +1 -1
  5. package/dist/api/contract/contract.d.ts +4 -0
  6. package/dist/api/contract/future.d.ts +2 -2
  7. package/dist/api/contract/future.js +1 -0
  8. package/dist/api/contract/future.js.map +1 -1
  9. package/dist/api/contract/ind.d.ts +1 -3
  10. package/dist/api/contract/ind.js +2 -4
  11. package/dist/api/contract/ind.js.map +1 -1
  12. package/dist/api/contract/wsh.d.ts +15 -0
  13. package/dist/api/contract/wsh.js +21 -0
  14. package/dist/api/contract/wsh.js.map +1 -0
  15. package/dist/api/data/enum/fad-data-type.d.ts +2 -1
  16. package/dist/api/data/enum/fad-data-type.js +2 -1
  17. package/dist/api/data/enum/fad-data-type.js.map +1 -1
  18. package/dist/api/data/enum/min-server-version.d.ts +3 -1
  19. package/dist/api/data/enum/min-server-version.js +2 -0
  20. package/dist/api/data/enum/min-server-version.js.map +1 -1
  21. package/dist/api/data/enum/sec-type.d.ts +22 -13
  22. package/dist/api/data/enum/sec-type.js +23 -14
  23. package/dist/api/data/enum/sec-type.js.map +1 -1
  24. package/dist/api/historical/bar-size-setting.d.ts +2 -2
  25. package/dist/api/historical/bar-size-setting.js +2 -2
  26. package/dist/api/historical/bar-size-setting.js.map +1 -1
  27. package/dist/api/historical/what-to-show.d.ts +21 -0
  28. package/dist/api/historical/what-to-show.js +25 -0
  29. package/dist/api/historical/what-to-show.js.map +1 -0
  30. package/dist/api/market/tickType.d.ts +12 -0
  31. package/dist/api/market/tickType.js +12 -0
  32. package/dist/api/market/tickType.js.map +1 -1
  33. package/dist/api/market-scanner/market-scanner.d.ts +206 -0
  34. package/dist/api/market-scanner/market-scanner.js +218 -0
  35. package/dist/api/market-scanner/market-scanner.js.map +1 -0
  36. package/dist/api/order/enum/orderType.d.ts +4 -0
  37. package/dist/api/order/enum/orderType.js +23 -1
  38. package/dist/api/order/enum/orderType.js.map +1 -1
  39. package/dist/api/order/enum/tif.d.ts +30 -0
  40. package/dist/api/order/enum/tif.js +33 -0
  41. package/dist/api/order/enum/tif.js.map +1 -0
  42. package/dist/api/order/execution.d.ts +1 -0
  43. package/dist/api/order/order.d.ts +21 -6
  44. package/dist/api/order/order.js +2 -0
  45. package/dist/api/order/order.js.map +1 -1
  46. package/dist/api/order/stop.d.ts +3 -2
  47. package/dist/api/order/stop.js +2 -1
  48. package/dist/api/order/stop.js.map +1 -1
  49. package/dist/api/order/stopLimit.d.ts +3 -2
  50. package/dist/api/order/stopLimit.js +2 -1
  51. package/dist/api/order/stopLimit.js.map +1 -1
  52. package/dist/api/order/trailingStop.d.ts +4 -3
  53. package/dist/api/order/trailingStop.js +2 -1
  54. package/dist/api/order/trailingStop.js.map +1 -1
  55. package/dist/api-next/api-next.d.ts +10 -8
  56. package/dist/api-next/api-next.js +9 -7
  57. package/dist/api-next/api-next.js.map +1 -1
  58. package/dist/api-next/index.d.ts +10 -9
  59. package/dist/api-next/index.js +0 -1
  60. package/dist/api-next/index.js.map +1 -1
  61. package/dist/api-next/market-scanner/market-scanner.d.ts +1 -211
  62. package/dist/api-next/market-scanner/market-scanner.js +6 -215
  63. package/dist/api-next/market-scanner/market-scanner.js.map +1 -1
  64. package/dist/common/errorCode.d.ts +6 -1
  65. package/dist/common/errorCode.js +6 -0
  66. package/dist/common/errorCode.js.map +1 -1
  67. package/dist/core/io/controller.js +1 -1
  68. package/dist/core/io/controller.js.map +1 -1
  69. package/dist/core/io/decoder.d.ts +12 -6
  70. package/dist/core/io/decoder.js +79 -57
  71. package/dist/core/io/decoder.js.map +1 -1
  72. package/dist/core/io/encoder.d.ts +10 -8
  73. package/dist/core/io/encoder.js +98 -13
  74. package/dist/core/io/encoder.js.map +1 -1
  75. package/dist/core/io/socket.d.ts +11 -2
  76. package/dist/core/io/socket.js +22 -7
  77. package/dist/core/io/socket.js.map +1 -1
  78. package/dist/index.d.ts +10 -6
  79. package/dist/index.js +17 -7
  80. package/dist/index.js.map +1 -1
  81. package/dist/tests/unit/api/api.test.js +19 -41
  82. package/dist/tests/unit/api/api.test.js.map +1 -1
  83. package/dist/tests/unit/api/connect.test.js +12 -10
  84. package/dist/tests/unit/api/connect.test.js.map +1 -1
  85. package/dist/tests/unit/api/contract-details.test.d.ts +1 -0
  86. package/dist/tests/unit/api/contract-details.test.js +143 -0
  87. package/dist/tests/unit/api/contract-details.test.js.map +1 -0
  88. package/dist/tests/unit/api/historical-data.test.d.ts +1 -0
  89. package/dist/tests/unit/api/historical-data.test.js +215 -0
  90. package/dist/tests/unit/api/historical-data.test.js.map +1 -0
  91. package/dist/tests/unit/api/market-data.test.js +119 -15
  92. package/dist/tests/unit/api/market-data.test.js.map +1 -1
  93. package/dist/tests/unit/api/market-scanner.test.d.ts +1 -0
  94. package/dist/tests/unit/api/market-scanner.test.js +69 -0
  95. package/dist/tests/unit/api/market-scanner.test.js.map +1 -0
  96. package/dist/tests/unit/api/matching-symbols.test.js +38 -30
  97. package/dist/tests/unit/api/matching-symbols.test.js.map +1 -1
  98. package/dist/tests/unit/api/order/cancelOrder.test.d.ts +1 -0
  99. package/dist/tests/unit/api/order/cancelOrder.test.js +81 -0
  100. package/dist/tests/unit/api/order/cancelOrder.test.js.map +1 -0
  101. package/dist/tests/unit/api/order/placeOrder.test.js +55 -92
  102. package/dist/tests/unit/api/order/placeOrder.test.js.map +1 -1
  103. package/dist/tests/unit/api/order/reqAllOpenOrders.test.js +10 -7
  104. package/dist/tests/unit/api/order/reqAllOpenOrders.test.js.map +1 -1
  105. package/dist/tests/unit/api/wsh-event-data.test.d.ts +1 -0
  106. package/dist/tests/unit/api/wsh-event-data.test.js +110 -0
  107. package/dist/tests/unit/api/wsh-event-data.test.js.map +1 -0
  108. package/dist/tests/unit/api-next/get-all-open-orders.test.js +1 -2
  109. package/dist/tests/unit/api-next/get-all-open-orders.test.js.map +1 -1
  110. package/dist/tests/unit/api-next/get-head-timestamp.test.js +1 -1
  111. package/dist/tests/unit/api-next/get-head-timestamp.test.js.map +1 -1
  112. package/dist/tests/unit/api-next/get-historical-data-updates.test.js +1 -1
  113. package/dist/tests/unit/api-next/get-historical-data-updates.test.js.map +1 -1
  114. package/dist/tests/unit/api-next/get-historical-data.test.js +2 -2
  115. package/dist/tests/unit/api-next/get-historical-data.test.js.map +1 -1
  116. package/dist/tests/unit/api-next/get-matching-symbols.test.d.ts +4 -0
  117. package/dist/tests/unit/api-next/{search-contracts.test.js → get-matching-symbols.test.js} +4 -4
  118. package/dist/tests/unit/api-next/get-matching-symbols.test.js.map +1 -0
  119. package/dist/tests/unit/api-next/place-order.test.js +1 -6
  120. package/dist/tests/unit/api-next/place-order.test.js.map +1 -1
  121. package/dist/tests/unit/api-next/subscription-registry.test.d.ts +1 -0
  122. package/dist/tests/unit/api-next/subscription-registry.test.js +67 -0
  123. package/dist/tests/unit/api-next/subscription-registry.test.js.map +1 -0
  124. package/dist/tools/get-head-timestamp.js +2 -1
  125. package/dist/tools/get-head-timestamp.js.map +1 -1
  126. package/dist/tools/historical-data-updates.js +2 -1
  127. package/dist/tools/historical-data-updates.js.map +1 -1
  128. package/dist/tools/historical-data.js +2 -1
  129. package/dist/tools/historical-data.js.map +1 -1
  130. package/dist/tools/open-orders-all.d.ts +4 -0
  131. package/dist/tools/open-orders-all.js +45 -0
  132. package/dist/tools/open-orders-all.js.map +1 -0
  133. package/dist/tools/open-orders-auto.js +2 -2
  134. package/dist/tools/open-orders-auto.js.map +1 -1
  135. package/dist/tools/open-orders.d.ts +1 -1
  136. package/dist/tools/open-orders.js +16 -12
  137. package/dist/tools/open-orders.js.map +1 -1
  138. package/dist/tools/search-contracts.js +1 -1
  139. package/dist/tools/search-contracts.js.map +1 -1
  140. package/package.json +7 -7
  141. package/dist/tests/unit/api-next/search-contracts.test.d.ts +0 -4
  142. package/dist/tests/unit/api-next/search-contracts.test.js.map +0 -1
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
- <a href="https://lgtm.com/projects/g/stoqey/ib/context:javascript"><img alt="Language grade: JavaScript" src="https://img.shields.io/lgtm/grade/javascript/g/stoqey/ib.svg?logo=lgtm&logoWidth=18"/></a>
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 9.76 from May 08 2019.
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, MarketDataType, 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.USER_INFO;
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 tickerId Id of the request
184
+ * @param reqId Id of the request
184
185
  *
185
186
  * @see [[reqHeadTimeStamp]]
186
187
  */
187
- cancelHeadTimestamp(tickerId: number): IBApi;
188
+ cancelHeadTimestamp(reqId: number): IBApi;
188
189
  /**
189
190
  * Cancels a historical data request.
190
191
  *
191
- * @param tickerId The request's identifier.
192
+ * @param reqId The request's identifier.
192
193
  *
193
194
  * @see [[reqHistogramData]]
194
195
  */
195
- cancelHistogramData(tickerId: number): IBApi;
196
+ cancelHistogramData(reqId: number): IBApi;
196
197
  /**
197
198
  * Cancels a historical data request.
198
199
  *
199
- * @param tickerId The request's identifier.
200
+ * @param reqId The request's identifier.
200
201
  *
201
202
  * @see [[reqHistoricalData]]
202
203
  */
203
- cancelHistoricalData(tickerId: number): IBApi;
204
+ cancelHistoricalData(reqId: number): IBApi;
204
205
  /**
205
206
  * Cancels a RT Market Data request.
206
207
  *
207
- * @param tickerId The request's identifier.
208
+ * @param reqId The request's identifier.
208
209
  *
209
210
  * @see [[reqMktData]]
210
211
  */
211
- cancelMktData(tickerId: number): IBApi;
212
+ cancelMktData(reqId: number): IBApi;
212
213
  /**
213
214
  * Cancel a market depth's request.
214
215
  *
215
- * @param tickerId The request's identifier.
216
+ * @param reqId The request's identifier.
216
217
  * @param isSmartDepth TODO document
217
218
  *
218
219
  * @see [[reqMktDepth]]
219
220
  */
220
- cancelMktDepth(tickerId: number, isSmartDepth: boolean): IBApi;
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 tickerId The request's identifier.
272
+ * @param reqId The request's identifier.
272
273
  */
273
- cancelRealTimeBars(tickerId: number): IBApi;
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 tickerId Unique identifier of the request.
286
+ * @param reqId Unique identifier of the request.
286
287
  *
287
288
  * @see [[reqTickByTickData]]
288
289
  */
289
- cancelTickByTickData(tickerId: number): IBApi;
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 tickerId The exercise request's identifier.
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(tickerId: number, contract: Contract, exerciseAction: OptionExerciseAction, exerciseQuantity: number, account: string, override: number): IBApi;
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
- * - PreviousEquityWithLoanValue — Marginable Equity with Loan value as of 16:00 ET the previous day
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, conId: number): this;
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: string, useRTH: boolean, formatDate: number): IBApi;
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 tickerId An identifier for the request.
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(tickerId: number, contract: Contract, useRTH: boolean, period: number, periodUnit: DurationUnit): IBApi;
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,15 +561,18 @@ export declare class IBApi extends EventEmitter {
560
561
  *
561
562
  * The resulting bars will be emitted as historicalData event.
562
563
  *
563
- * @param tickerId The request's unique identifier.
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
- * @param durationStr The amount of time for which the data needs to be retrieved:
567
- * - " S (seconds) - " D (days)
568
- * - " W (weeks) - " M (months)
569
- * - " Y (years)
567
+ * @param durationStr The amount of time for which the data needs to be retrieved (number space unit).
568
+ * Note: min duration is "30 S", available units:
569
+ * - S (seconds)
570
+ * - D (days)
571
+ * - W (weeks)
572
+ * - M (months)
573
+ * - Y (years)
570
574
  * @param barSizeSetting the size of the bar:
571
- * - 1 sec
575
+ * - 1 secs
572
576
  * - 5 secs
573
577
  * - 15 secs
574
578
  * - 30 secs
@@ -597,7 +601,7 @@ export declare class IBApi extends EventEmitter {
597
601
  * @param keepUpToDate Set to `true` to received continuous updates on most recent bar data. If `true`, and
598
602
  * endDateTime cannot be specified.
599
603
  */
600
- reqHistoricalData(tickerId: number, contract: Contract, endDateTime: string, durationStr: string, barSizeSetting: BarSizeSetting, whatToShow: string, useRTH: number, formatDate: number, keepUpToDate: boolean): IBApi;
604
+ reqHistoricalData(reqId: number, contract: Contract, endDateTime: string, durationStr: string, barSizeSetting: BarSizeSetting, whatToShow: WhatToShow, useRTH: number, formatDate: number, keepUpToDate: boolean): IBApi;
601
605
  /**
602
606
  * Requests historical news headlines.
603
607
  *
@@ -621,7 +625,7 @@ export declare class IBApi extends EventEmitter {
621
625
  * @param useRTH Data from regular trading hours (1), or all available hours (0)
622
626
  * @param ignoreSize A filter only used when the source price is Bid_Ask
623
627
  */
624
- reqHistoricalTicks(reqId: number, contract: Contract, startDateTime: string, endDateTime: string, numberOfTicks: number, whatToShow: string, useRTH: number, ignoreSize: boolean): IBApi;
628
+ reqHistoricalTicks(reqId: number, contract: Contract, startDateTime: string, endDateTime: string, numberOfTicks: number, whatToShow: WhatToShow, useRTH: number, ignoreSize: boolean): IBApi;
625
629
  /**
626
630
  * Requests the next valid order ID at the current moment.
627
631
  *
@@ -648,7 +652,7 @@ export declare class IBApi extends EventEmitter {
648
652
  * - 3 (delayed) enables delayed and disables delayed-frozen market data.
649
653
  * - 4 (delayed-frozen) enables delayed and delayed-frozen market data.
650
654
  */
651
- reqMarketDataType(marketDataType: number): IBApi;
655
+ reqMarketDataType(marketDataType: MarketDataType): IBApi;
652
656
  /**
653
657
  * Requests the contract's market depth (order book).
654
658
  *
@@ -657,7 +661,7 @@ export declare class IBApi extends EventEmitter {
657
661
  * The number of simultaneous market depth requests allowed in an account is calculated based on a formula
658
662
  * that looks at an accounts equity, commissions, and quote booster packs.
659
663
  *
660
- * @param tickerId The request's identifier.
664
+ * @param reqId The request's identifier.
661
665
  * @param contract The [[Contract]] for which the depth is being requested.
662
666
  * @param numRows The number of rows on each side of the order book.
663
667
  * @param isSmartDepth Flag indicates that this is smart depth request.
@@ -665,7 +669,7 @@ export declare class IBApi extends EventEmitter {
665
669
  *
666
670
  * @see [[cancelMktDepth]]
667
671
  */
668
- reqMktDepth(tickerId: number, contract: Contract, numRows: number, isSmartDepth: boolean, mktDepthOptions?: TagValue[]): IBApi;
672
+ reqMktDepth(reqId: number, contract: Contract, numRows: number, isSmartDepth: boolean, mktDepthOptions?: TagValue[]): IBApi;
669
673
  /**
670
674
  * Requests details about a given market rule.
671
675
  * The market rule for an instrument on a particular exchange provides details about how the minimum price increment
@@ -690,7 +694,7 @@ export declare class IBApi extends EventEmitter {
690
694
  * Returns market data for an instrument either in real time or 10-15 minutes delayed (depending on the market data
691
695
  * type specified).
692
696
  *
693
- * @param tickerId The request's identifier.
697
+ * @param reqId The request's identifier.
694
698
  * @param contract The [[Contract]] for which the data is being requested
695
699
  * @param genericTickList comma separated ids of the available generic ticks:
696
700
  * - 100 Option Volume (currently for stocks)
@@ -718,7 +722,7 @@ export declare class IBApi extends EventEmitter {
718
722
  *
719
723
  * @see [[cancelMktData]]
720
724
  */
721
- reqMktData(tickerId: number, contract: Contract, genericTickList: string, snapshot: boolean, regulatorySnapshot: boolean): IBApi;
725
+ reqMktData(reqId: number, contract: Contract, genericTickList: string, snapshot: boolean, regulatorySnapshot: boolean): IBApi;
722
726
  /**
723
727
  * Requests venues for which market data is returned to updateMktDepthL2 (those with market makers)
724
728
  */
@@ -795,7 +799,7 @@ export declare class IBApi extends EventEmitter {
795
799
  * than 600 seconds. Real time bars subscriptions are also included in the calculation of the number of Level 1
796
800
  * market data subscriptions allowed in an account.
797
801
  *
798
- * @param tickerId The request's unique identifier.
802
+ * @param reqId The request's unique identifier.
799
803
  * @param contract The [[Contract]] for which the depth is being requested
800
804
  * @param barSize currently being ignored
801
805
  * @param whatToShow the nature of the data being retrieved:
@@ -808,7 +812,7 @@ export declare class IBApi extends EventEmitter {
808
812
  *
809
813
  * @see [[cancelRealTimeBars]]
810
814
  */
811
- reqRealTimeBars(tickerId: number, contract: Contract, barSize: number, whatToShow: string, useRTH: boolean, realTimeBarsOptions?: TagValue[]): IBApi;
815
+ reqRealTimeBars(reqId: number, contract: Contract, barSize: number, whatToShow: WhatToShow, useRTH: boolean, realTimeBarsOptions?: TagValue[]): IBApi;
812
816
  /**
813
817
  * Requests an XML list of scanner parameters valid in TWS.
814
818
  *
@@ -1034,7 +1038,7 @@ export declare interface IBApi {
1034
1038
  * securities account without depositing additional funds.
1035
1039
  * - EquityWithLoanValue: Forms the basis for determining whether a client has the necessary assets to either
1036
1040
  * initiate or maintain security positions. Cash + stocks + bonds + mutual funds
1037
- * - PreviousEquityWithLoanValue: Marginable Equity with Loan value as of 16:00 ET the previous day
1041
+ * - PreviousDayEquityWithLoanValue: Marginable Equity with Loan value as of 16:00 ET the previous day
1038
1042
  * - GrossPositionValue: The sum of the absolute value of all stock and equity option positions
1039
1043
  * - RegTEquity:Regulation T equity for universal account
1040
1044
  * - RegTMargin. Regulation T margin for universal account
@@ -1395,7 +1399,9 @@ export declare interface IBApi {
1395
1399
  * @see https://interactivebrokers.github.io/tws-api/historical_bars.html#hd_what_to_show
1396
1400
  * for additional context regarding meaning of price for different bar types
1397
1401
  */
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, hasGaps: boolean | undefined) => void): this;
1402
+ on(event: EventName.historicalData, listener: (reqId: number, time: string, open: number, high: number, low: number, close: number, volume: number, count: number | undefined, WAP: number,
1403
+ /** @deprecated */
1404
+ hasGaps: boolean | undefined) => void): this;
1399
1405
  /**
1400
1406
  * Receives bars in real time if keepUpToDate is `true` in reqHistoricalData.
1401
1407
  * Similar to realTimeBars function, except returned data is a composite of historical data and
@@ -1933,7 +1939,7 @@ export declare interface IBApi {
1933
1939
  * Exchange for Physicals.
1934
1940
  *
1935
1941
  * @param listener
1936
- * tickerId: The request's identifier.
1942
+ * reqId: The request's identifier.
1937
1943
  *
1938
1944
  * tickType: The type of tick being received.
1939
1945
  *
@@ -1952,12 +1958,12 @@ export declare interface IBApi {
1952
1958
  *
1953
1959
  * dividendsToLastTradeDate: The dividends expected until the expiration of the single stock future.
1954
1960
  */
1955
- on(event: EventName.tickEFP, listener: (tickerId: number, tickType: number, basisPoints: number, formattedBasisPoints: string, impliedFuture: number, holdDays: number, futureLastTradeDate: string, dividendImpact: number, dividendsToLastTradeDate: number) => void): this;
1961
+ 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
1962
  /**
1957
1963
  * Provides a market data generic tick.
1958
1964
  *
1959
1965
  * @param listener
1960
- * tickerId: The id of request.
1966
+ * reqId: The id of request.
1961
1967
  *
1962
1968
  * field: The type of tick being received.
1963
1969
  *
@@ -1965,12 +1971,12 @@ export declare interface IBApi {
1965
1971
  *
1966
1972
  * @see [[reqTickByTickData]]
1967
1973
  */
1968
- on(event: EventName.tickGeneric, listener: (tickerId: number, field: TickType, value: number) => void): this;
1974
+ on(event: EventName.tickGeneric, listener: (reqId: number, field: TickType, value: number) => void): this;
1969
1975
  /**
1970
1976
  * Provides a news headline tick.
1971
1977
  *
1972
1978
  * @param listener
1973
- * tickerId: The id of request.
1979
+ * reqId: The id of request.
1974
1980
  *
1975
1981
  * field: The type of tick being received.
1976
1982
  *
@@ -1978,7 +1984,7 @@ export declare interface IBApi {
1978
1984
  *
1979
1985
  * @see [[reqTickByTickData]]
1980
1986
  */
1981
- on(event: EventName.tickNews, listener: (tickerId: number, timeStamp: number, providerCode: string, articleId: string, headline: string, extraData: string) => void): this;
1987
+ on(event: EventName.tickNews, listener: (reqId: number, timeStamp: number, providerCode: string, articleId: string, headline: string, extraData: string) => void): this;
1982
1988
  /**
1983
1989
  * Provides option specific market data.
1984
1990
  * This method is called when the market in an option or its underlier moves.
@@ -1986,7 +1992,7 @@ export declare interface IBApi {
1986
1992
  * options underlier are received.
1987
1993
  *
1988
1994
  * @param listener
1989
- * tickerId: The id of request.
1995
+ * reqId: The id of request.
1990
1996
  *
1991
1997
  * field: Specifies the type of option computation.
1992
1998
  * Pass the field value into [[TickType.getField]] to retrieve the field description.
@@ -2013,7 +2019,7 @@ export declare interface IBApi {
2013
2019
  *
2014
2020
  * @see [[reqMktData]]
2015
2021
  */
2016
- on(event: EventName.tickOptionComputation, listener: (tickerId: number, field: TickType, impliedVolatility?: number, delta?: number, optPrice?: number, pvDividend?: number, gamma?: number, vega?: number, theta?: number, undPrice?: number) => void): this;
2022
+ 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
2023
  /**
2018
2024
  * Market data tick price callback. Handles all price related ticks.
2019
2025
  * Every tickPrice callback is followed by a tickSize.
@@ -2022,7 +2028,7 @@ export declare interface IBApi {
2022
2028
  * contract).
2023
2029
  *
2024
2030
  * @param listener
2025
- * tickerId: The id of request.
2031
+ * reqId: The id of request.
2026
2032
  *
2027
2033
  * field: The type of the price being received.
2028
2034
  *
@@ -2034,21 +2040,21 @@ export declare interface IBApi {
2034
2040
  *
2035
2041
  * @see [[reqMktData]]
2036
2042
  */
2037
- on(event: EventName.tickPrice, listener: (tickerId: number, field: TickType, value: number, attribs?: unknown) => void): this;
2043
+ on(event: EventName.tickPrice, listener: (reqId: number, field: TickType, value: number, attribs?: unknown) => void): this;
2038
2044
  /**
2039
2045
  * A tick with BOO exchange and snapshot permissions.
2040
2046
  *
2041
2047
  * @param listener
2042
- * tickerId: The id of request.
2048
+ * reqId: The id of request.
2043
2049
  *
2044
2050
  * @see [[reqMktData]]
2045
2051
  */
2046
- on(event: EventName.tickReqParams, listener: (tickerId: number, minTick: number, bboExchange: string, snapshotPermissions: number) => void): this;
2052
+ on(event: EventName.tickReqParams, listener: (reqId: number, minTick: number, bboExchange: string, snapshotPermissions: number) => void): this;
2047
2053
  /**
2048
2054
  * Market data tick size callback. Handles all size-related ticks.
2049
2055
  *
2050
2056
  * @param listener
2051
- * tickerId: The id of request.
2057
+ * reqId: The id of request.
2052
2058
  *
2053
2059
  * field: The type of size being received (i.e. bid size)
2054
2060
  *
@@ -2056,14 +2062,14 @@ export declare interface IBApi {
2056
2062
  *
2057
2063
  * @see [[reqMktData]]
2058
2064
  */
2059
- on(event: EventName.tickSize, listener: (tickerId: number, field?: TickType, value?: number) => void): this;
2065
+ on(event: EventName.tickSize, listener: (reqId: number, field?: TickType, value?: number) => void): this;
2060
2066
  /**
2061
2067
  * Market data callback. Every tickPrice is followed by a tickSize.
2062
2068
  * There are also independent tickSize callbacks anytime the tickSize changes, and so there will be duplicate
2063
2069
  * tickSize messages following a tickPrice.
2064
2070
  *
2065
2071
  * @param listener
2066
- * tickerId: The id of request.
2072
+ * reqId: The id of request.
2067
2073
  *
2068
2074
  * field: The type of size being received (i.e. bid size)
2069
2075
  *
@@ -2071,7 +2077,7 @@ export declare interface IBApi {
2071
2077
  *
2072
2078
  * @see [[reqMktData]]
2073
2079
  */
2074
- on(event: EventName.tickString, listener: (tickerId: number, field: TickType, value: string) => void): this;
2080
+ on(event: EventName.tickString, listener: (reqId: number, field: TickType, value: string) => void): this;
2075
2081
  /**
2076
2082
  * Receives the last time on which the account was updated.
2077
2083
  *
@@ -2262,7 +2268,7 @@ export declare interface IBApi {
2262
2268
  * Returns the order book.
2263
2269
  *
2264
2270
  * @param listener
2265
- * tickerId: The request's identifier.
2271
+ * reqId: The request's identifier.
2266
2272
  *
2267
2273
  * position: The order book's row being updated.
2268
2274
  *
@@ -2279,12 +2285,12 @@ export declare interface IBApi {
2279
2285
  *
2280
2286
  * @see [[reqMktDepth]]
2281
2287
  */
2282
- on(event: EventName.updateMktDepth, listener: (tickerId: number, position: number, operation: number, side: number, price: number, size: number) => void): this;
2288
+ on(event: EventName.updateMktDepth, listener: (reqId: number, position: number, operation: number, side: number, price: number, size: number) => void): this;
2283
2289
  /**
2284
2290
  * Returns the order book (level 2).
2285
2291
  *
2286
2292
  * @param listener
2287
- * tickerId: The request's identifier.
2293
+ * reqId: The request's identifier.
2288
2294
  *
2289
2295
  * position: The order book's row being updated.
2290
2296
  *
@@ -2305,7 +2311,7 @@ export declare interface IBApi {
2305
2311
  *
2306
2312
  * @see [[reqMktDepth]]
2307
2313
  */
2308
- on(event: EventName.updateMktDepthL2, listener: (tickerId: number, position: number, marketMaker: string, operation: number, side: number, price: number, size: number, isSmartDepth?: boolean) => void): this;
2314
+ on(event: EventName.updateMktDepthL2, listener: (reqId: number, position: number, marketMaker: string, operation: number, side: number, price: number, size: number, isSmartDepth?: boolean) => void): this;
2309
2315
  /**
2310
2316
  * Provides IB's bulletins.
2311
2317
  *