diff --git a/interfaces/connect.ts b/interfaces/connect.ts index 7b22b3c..18b39b4 100644 --- a/interfaces/connect.ts +++ b/interfaces/connect.ts @@ -818,6 +818,10 @@ export interface PlaceOrderParams { * @type {?boolean} */ autoslice?: boolean; + /** + * @type {?string} + */ + algo_id?: string; /** * @type {?string} */ diff --git a/test/test.ts b/test/test.ts index 6e13cde..6b848ec 100644 --- a/test/test.ts +++ b/test/test.ts @@ -48,6 +48,10 @@ function testSuite(){ .post('/orders/test') .reply(200, parseJson('order_response.json')) + // placeOrder with algo_id + .post('/orders/test', /algo_id=algo-123/) + .reply(200, parseJson('order_response.json')) + // placeOrder with autoslice .post('/orders/regular', /autoslice=true/) .reply(200, parseJson('autoslice_response.json')) @@ -264,6 +268,23 @@ function testSuite(){ }) }); + describe('placeOrder with algo_id', function() { + it('Place market order with algo_id', (done) => { + kc.placeOrder(Varieties.TEST, { + 'exchange': Exchanges.NSE, + 'tradingsymbol': 'SBIN', + 'transaction_type': TransactionTypes.BUY, + 'quantity': 1, + 'product': Products.MIS, + 'order_type': OrderTypes.MARKET, + 'algo_id': 'algo-123'}) + .then(function(response: AnyObject) { + expect(response).to.have.property('order_id'); + return done(); + }).catch(done); + }) + }); + describe('placeOrder with autoslice', function() { it('Place order with autoslice enabled', (done) => { kc.placeOrder(Varieties.VARIETY_REGULAR, { diff --git a/types/connect.d.ts b/types/connect.d.ts index 270a482..42f9cd6 100644 --- a/types/connect.d.ts +++ b/types/connect.d.ts @@ -2209,6 +2209,10 @@ export type Connect = { * A unique identifier for a particular auction */ auction_number?: number; + /** + * An optional algo ID to associate with the order + */ + algo_id?: string; /** * An optional tag to apply to an order to identify it (alphanumeric, max 20 chars) */