Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions interfaces/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,10 @@ export interface PlaceOrderParams {
* @type {?boolean}
*/
autoslice?: boolean;
/**
* @type {?string}
*/
algo_id?: string;
/**
* @type {?string}
*/
Expand Down
21 changes: 21 additions & 0 deletions test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down Expand Up @@ -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, {
Expand Down
4 changes: 4 additions & 0 deletions types/connect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/
Expand Down
Loading