diff --git a/src/api/order/order.ts b/src/api/order/order.ts index 55d93b5c..6dc71520 100644 --- a/src/api/order/order.ts +++ b/src/api/order/order.ts @@ -763,7 +763,9 @@ export interface Order { professionalCustomer?: boolean; bondAccruedInterest?: string; + includeOvernight?: boolean; + manualOrderIndicator?: number; } diff --git a/src/tests/unit/api/historical-data.test.ts b/src/tests/unit/api/historical-data.test.ts index 973ff486..f284ebb4 100644 --- a/src/tests/unit/api/historical-data.test.ts +++ b/src/tests/unit/api/historical-data.test.ts @@ -113,7 +113,7 @@ describe("IBApi Historical data Tests", () => { ib.reqHistoricalData( refId, contract, - "20241110-17:00:00", + "20241107-17:00:00", "30 S", BarSizeSetting.SECONDS_FIFTEEN, WhatToShow.BID_ASK, @@ -134,17 +134,17 @@ describe("IBApi Historical data Tests", () => { count: number | undefined, WAP: number, ) => { - console.log(counter, time, open, high, low, close, volume, count, WAP); + // console.log(counter, time, open, high, low, close, volume, count, WAP); expect(reqId).toEqual(refId); if (time.startsWith("finished")) { expect(counter).toEqual(2); done(); } else if (counter++ == 1) { - expect(time).toEqual("1721408385"); - expect(open).toEqual(11.95); - expect(high).toEqual(11.95); - expect(low).toEqual(11.9); - expect(close).toEqual(11.95); + expect(time).toEqual("1730998785"); + expect(open).toEqual(8.77); + expect(high).toEqual(8.77); + expect(low).toEqual(8.75); + expect(close).toEqual(8.77); expect(volume).toEqual(-1); expect(count).toEqual(-1); expect(WAP).toEqual(-1); diff --git a/src/tests/unit/api/order/placeConditionalOrder.test.ts b/src/tests/unit/api/order/placeConditionalOrder.test.ts index 2c56f05f..3d41eec6 100644 --- a/src/tests/unit/api/order/placeConditionalOrder.test.ts +++ b/src/tests/unit/api/order/placeConditionalOrder.test.ts @@ -51,7 +51,7 @@ const sample_percent_condition: OrderCondition = new PercentChangeCondition( ConjunctionConnection.OR, ); const sample_time_condition: OrderCondition = new TimeCondition( - "20250102-17:00:00", + "20260102-18:00:00", true, ConjunctionConnection.OR, ); @@ -342,8 +342,31 @@ describe("Place Conditional Orders", () => { }) .on(EventName.openOrderEnd, () => { if (isDone) done(); - else done("failed"); }) + .on( + EventName.orderStatus, + ( + orderId, + status, + filled, + remaining, + _avgFillPrice, + _permId, + _parentId, + _lastFillPrice, + _clientId, + _whyHeld, + _mktCapPrice, + ) => { + if (!isDone && orderId == refId) { + isDone = true; + expect(status).toMatch(/Pending/); + expect(filled).toEqual(0); + expect(remaining).toEqual(refOrder.totalQuantity); + done(); + } + }, + ) .on( EventName.error, (