XTS API reference
Every XTS-compatible endpoint, under https://app.mquant.in/api/v1/interactive. Paths, function names, fields and replies are those of the Symphony XTS Interactive API. Rules that apply to every endpoint are in the XTS-compatible API guide.
Method and path under /api/v1/interactive | What | Python XTConnect | Node xts-interactive-api |
|---|---|---|---|
POST /user/session | Log in | interactive_login | logIn |
DELETE /user/session | Log out | interactive_logout | logOut |
GET /user/profile | Profile | get_profile | getProfile |
GET /user/balance | Balance, all zero | get_balance | getBalance |
GET /user/enums | Enums | None | getEnums |
POST /orders | Place an order | place_order | placeOrder |
PUT /orders | Modify an order | modify_order | modifyOrder |
DELETE /orders?appOrderID= | Cancel an order | cancel_order | cancelOrder |
POST /orders/cancelall | Cancel all in a segment | cancelall_order | None |
GET /orders | Order book | get_order_book | getOrderBook |
GET /orders?appOrderID= | Order history | get_order_history | getOrderHistory |
GET /orders/trades | Trade book, empty | get_trade | getTradeBook |
GET /portfolio/positions?dayOrNet= | Positions, empty | get_position_daywise, get_position_netwise | getPositions |
GET /portfolio/holdings | Holdings, empty | get_holding | getHoldings |
The examples assume you have logged in: in Python an XTSConnect named xt after xt.interactive_login(); in Node.js an XTSInteractive named xts after await xts.logIn(…), inside an async function; in the shell XTS_ROOT=https://app.mquant.in/api/v1 and TOKEN from the login call. Pick a language once and every page remembers it.
Dealer endpoints#
Dealer-style code that calls these gets the same reply as the investor endpoint. MQuant answers isInvestorClient: true, so the SDKs do not call them on their own.
Path under /api/v1/interactive | Same as | Python XTConnect |
|---|---|---|
GET /orders/dealerorderbook | Order book | get_dealer_orderbook |
GET /orders/dealertradebook | Trade book | get_dealer_tradebook |
GET /portfolio/dealerpositions?dayOrNet= | Positions | get_dealerposition_daywise, get_dealerposition_netwise |
Any other path under /interactive/ returns 400 e-mquant-0001 "Not supported by MQuant". A supported path with the wrong method returns 405 e-request-0002 with an Allow header.
Log in#
/api/v1/interactive/user/sessionExchanges your MQuant key id and secret for a session token. Send the token in the authorization header on every other call.
- SDK Python
interactive_login()· NodelogIn({ appKey, secretKey, source }) - Auth appKey and secretKey
- Rate class Login
- Max body 4,096 bytes
| Body field | Rule |
|---|---|
appKey | Required. Your MQuant key id, mq_live_pk_… or mq_test_pk_…. |
secretKey | Required. Your MQuant secret. |
source | Optional, default WEBAPI. Any XTS source: WEBAPI, WEB, TWS, TWSAPI, MOBILEANDROID, MOBILEIOS, ENTERPRISEWEB, ENTERPRISEMOBILE, ENTERPRISETWS, or its number. |
uniqueKey, accessToken, userID | Accepted and ignored. |
The body may be JSON or form-encoded, with any Content-Type. The token lasts until midnight IST. MQuantTokenExpiry gives the time in IST, application_expiry_date the key's expiry date.
Responses
- 200
s-user-0001"Valid User." withresult.tokenandresult.userID. - 400
e-user-0001wrong appKey or secretKey;e-user-0003key revoked, expired or suspended, or trader inactive;e-user-0004unreadable body or badsource. - 403
e-user-0005: your IP is not on the key's allowlist. - 429
e-user-0002after repeated failed logins;e-rate-0001login limit.
from Connect import XTSConnect
xt = XTSConnect("mq_test_pk_YOUR_KEY_ID", "mq_test_sk_YOUR_SECRET", "WEBAPI",
root="https://app.mquant.in/api/v1")
login = xt.interactive_login()
print(login["type"], login["result"]["userID"], login["result"]["MQuantTokenExpiry"])const XTSInteractive = require('xts-interactive-api').Interactive
const xts = new XTSInteractive('https://app.mquant.in/api/v1')
const login = await xts.logIn({
appKey: 'mq_test_pk_YOUR_KEY_ID',
secretKey: 'mq_test_sk_YOUR_SECRET',
source: 'WEBAPI',
})
console.log(login.type, login.result.userID, login.result.MQuantTokenExpiry)TOKEN=$(curl -sS -X POST "$XTS_ROOT/interactive/user/session" \
-H 'Content-Type: application/json' \
-d "{\"appKey\":\"$XTS_APP_KEY\",\"secretKey\":\"$XTS_SECRET_KEY\",\"source\":\"WEBAPI\"}" \
| python3 -c 'import json, sys; print(json.load(sys.stdin)["result"]["token"])')
echo "$TOKEN"{"type": "success", "code": "s-user-0001", "description": "Valid User.", "result": {
"enums": {
"socketEvent": [],
"orderSide": ["BUY", "SELL"],
"positionSqureOffMode": ["DayWise", "NetWise"],
"positionSquareOffQuantityType": ["Percentage", "ExactQty"],
"dayOrNet": ["DAY", "NET"],
"instrumentType": ["Futures", "Options", "Equity"],
"exchangeSegment": ["NSECM", "NSEFO", "BSECM", "BSEFO", "MCXFO"],
"exchangeInfo": {"NSECM": {"productType": {"1": "MIS", "2": "NRML", "4": "CNC", "MIS": 1, "NRML": 2, "CNC": 4}, "orderType": ["StopLimit", "StopMarket", "Limit", "Market"], "timeInForce": ["DAY", "IOC"]}, "...": "..."}
},
"clientCodes": ["MQ12"],
"exchangeSegmentArray": [{"key": "NSECM", "value": "NSECM"}, {"key": "NSEFO", "value": "NSEFO"}, {"key": "BSECM", "value": "BSECM"}, {"key": "BSEFO", "value": "BSEFO"}, {"key": "MCXFO", "value": "MCXFO"}],
"token": "mq_xts_…",
"userID": "MQ12",
"isInvestorClient": true,
"isOneTouchUser": false,
"application_expiry_date": "02-03-2027",
"MQuantTokenExpiry": "03-12-2026 00:00:00",
"MQuantMode": "live",
"MQuantNote": "MQuant stores every order as a signal for the desk. Nothing is sent to an exchange."
}}Profile#
/api/v1/interactive/user/profileYour client id, name and the segments MQuant can resolve instruments for. No email, phone, PAN, address or bank data is returned.
- SDK Python
get_profile()· NodegetProfile() - Auth Session token
- Scope Any
- Rate class Read
Enabled in ClientExchangeDetailsList is true for a segment MQuant has an instrument master for.
Responses
- 200
s-user-0001"User profile".
profile = xt.get_profile()
print(profile["result"]["ClientId"], profile["result"]["ClientName"])const profile = await xts.getProfile()
console.log(profile.result.ClientId, profile.result.ClientName)curl -sS "$XTS_ROOT/interactive/user/profile" -H "authorization: $TOKEN"{"type": "success", "code": "s-user-0001", "description": "User profile", "result": {
"ClientId": "MQ12", "ClientName": "Ravi Kumar", "EmailId": "", "MobileNo": "", "PAN": "",
"IncludeInAutoSquareoff": false, "IncludeInAutoSquareoffBlocked": false,
"IsProClient": false, "IsInvestorClient": true,
"ResidentialAddress": "", "OfficeAddress": "", "ClientBankInfoList": [],
"ClientExchangeDetailsList": {
"NSECM": {"ClientId": "MQ12", "ExchangeSegNumber": 1, "Enabled": true, "ParticipantCode": ""},
"NSEFO": {"ClientId": "MQ12", "ExchangeSegNumber": 2, "Enabled": true, "ParticipantCode": ""},
"BSECM": {"ClientId": "MQ12", "ExchangeSegNumber": 11, "Enabled": true, "ParticipantCode": ""},
"BSEFO": {"ClientId": "MQ12", "ExchangeSegNumber": 12, "Enabled": true, "ParticipantCode": ""},
"MCXFO": {"ClientId": "MQ12", "ExchangeSegNumber": 51, "Enabled": false, "ParticipantCode": ""}
},
"MQuantKeyId": "mq_live_pk_7Lq2Wd9XcR4tVb1N0ZpKfE", "MQuantKeyLabel": "Algo box 1", "MQuantMode": "live",
"MQuantNote": "MQuant stores every order as a signal for the desk. Nothing is sent to an exchange."
}}Balance#
/api/v1/interactive/user/balanceThe XTS balance shape with every amount zero. MQuant holds no money for you.
- SDK Python
get_balance()· NodegetBalance() - Auth Session token
- Scope Any
- Rate class Read
Responses
- 200
s-user-0002"OK".BalanceListis a list with one entry.
balance = xt.get_balance()
print(balance["result"]["BalanceList"][0]["limitObject"]["RMSSubLimits"]["netMarginAvailable"])const balance = await xts.getBalance()
console.log(balance.result.BalanceList[0].limitObject.RMSSubLimits.netMarginAvailable)curl -sS "$XTS_ROOT/interactive/user/balance" -H "authorization: $TOKEN"{"type": "success", "code": "s-user-0002", "description": "OK", "result": {"BalanceList": [{
"limitHeader": "ALL|ALL|ALL",
"limitObject": {
"RMSSubLimits": {"cashAvailable": "0", "collateral": 0, "marginUtilized": "0", "netMarginAvailable": "0", "MTM": "0", "UnrealizedMTM": "0", "RealizedMTM": "0"},
"marginAvailable": {"CashMarginAvailable": 0, "...": 0},
"marginUtilized": {"GrossExposureMarginPresent": 0, "...": 0},
"limitsAssigned": {"CNCLimit": 0, "...": 0},
"AccountID": "MQ12"
}
}], "MQuantNote": "MQuant holds no funds. All balances are zero."}}Enums#
/api/v1/interactive/user/enumsThe same enums object the login reply carries: segments, product types, order types and validities MQuant accepts.
- SDK Python None · Node
getEnums({ userID }) - Auth Session token
- Scope Any
- Rate class Read
The userID query parameter is accepted and ignored. XTConnect has no function for it; read enums from the login reply instead.
Responses
- 200
s-user-0001"Enums".
const enums = await xts.getEnums({ userID: xts.userID })
console.log(enums.result.enums.exchangeSegment)curl -sS "$XTS_ROOT/interactive/user/enums" -H "authorization: $TOKEN"{"type": "success", "code": "s-user-0001", "description": "Enums", "result": {
"enums": {"exchangeSegment": ["NSECM", "NSEFO", "BSECM", "BSEFO", "MCXFO"], "...": "..."},
"clientCodes": ["MQ12"],
"isInvestorClient": true
}}Place an order#
/api/v1/interactive/ordersValidates the order, resolves the instrument and stores it as a signal with status received. Nothing is sent to an exchange.
- SDK Python
place_order(...)· NodeplaceOrder({...}) - Auth Session token
- Scope
signals:write - Rate class Write, cost 1
- Max body 8,192 bytes
| Body field | Rule |
|---|---|
exchangeSegment | NSECM, NSEFO, BSECM, BSEFO, MCXFO or 1, 2, 11, 12, 51 |
exchangeInstrumentID | The exchange token, as at your broker |
productType | MIS, NRML or CNC |
orderType | MARKET, LIMIT, STOPMARKET or STOPLIMIT |
orderSide | BUY or SELL |
timeInForce | DAY or IOC |
orderQuantity | Units; a multiple of the lot size on F&O |
disclosedQuantity | Optional, default 0 |
limitPrice, stopPrice | 0 means not set; required as the order type needs; tick-size multiples |
orderUniqueIdentifier | Optional, up to 20 characters; echoed back |
apiOrderSource, clientID | Optional |
Every rule is in Order fields. An identical order with the same orderUniqueIdentifier within 10 seconds returns the first order with Idempotent-Replayed: true. MQuantWarnings may hold outside_market_hours, notional_unchecked or expiry_today.
Responses
- 200
s-orders-0001"Request sent" withAppOrderID. - 400
e-orders-0001Bad Request withresult.errors;e-orders-0004risk cap;e-instrument-0001to0004;e-request-0004unreadable JSON. - 403
e-user-0007the key lackssignals:write. - 503
e-mquant-0003: new orders are paused by the desk.
order = xt.place_order(
exchangeSegment=xt.EXCHANGE_NSECM,
exchangeInstrumentID=2885,
productType=xt.PRODUCT_MIS,
orderType=xt.ORDER_TYPE_LIMIT,
orderSide=xt.TRANSACTION_TYPE_BUY,
timeInForce=xt.VALIDITY_DAY,
disclosedQuantity=0,
orderQuantity=10,
limitPrice=1250.5,
stopPrice=0,
orderUniqueIdentifier="reliance1",
apiOrderSource="WEBAPI",
)
print(order["type"], order["result"]["AppOrderID"])const order = await xts.placeOrder({
exchangeSegment: 'NSECM',
exchangeInstrumentID: 2885,
productType: 'MIS',
orderType: 'LIMIT',
orderSide: 'BUY',
timeInForce: 'DAY',
disclosedQuantity: 0,
orderQuantity: 10,
limitPrice: 1250.5,
stopPrice: 0,
orderUniqueIdentifier: 'reliance1',
})
console.log(order.type, order.result.AppOrderID)curl -sS -X POST "$XTS_ROOT/interactive/orders" \
-H "authorization: $TOKEN" -H 'Content-Type: application/json' \
-d '{"exchangeSegment":"NSECM","exchangeInstrumentID":2885,"productType":"MIS","orderType":"LIMIT","orderSide":"BUY","timeInForce":"DAY","disclosedQuantity":0,"orderQuantity":10,"limitPrice":1250.5,"stopPrice":0,"orderUniqueIdentifier":"reliance1","apiOrderSource":"WEBAPI"}'{"type": "success", "code": "s-orders-0001", "description": "Request sent", "result": {
"AppOrderID": 1000000017,
"OrderUniqueIdentifier": "reliance1",
"ClientID": "MQ12",
"MQuantSignalID": "sig_9f2c4e1a7b3d5f60a1b2c3d4",
"MQuantWarnings": []
}}Order book#
/api/v1/interactive/ordersToday's orders (since midnight IST) placed through this interface by your trader, in the key's mode, oldest first.
- SDK Python
get_order_book()· NodegetOrderBook() - Auth Session token
- Scope
signals:read - Rate class Read
One row per order in the XTS order book shape. OrderStatus follows the status mapping; MQuantStatus and MQuantSignalID give the signal behind it. Times are IST, DD-MM-YYYY HH:MM:SS. ExchangeTransactTime is the last status change at MQuant, as there is no exchange.
Responses
- 200
s-orders-0001"Success order book";resultis a list. - 403
e-user-0007the key lackssignals:read.
book = xt.get_order_book()
for row in book["result"]:
print(row["AppOrderID"], row["TradingSymbol"], row["OrderStatus"], row["MQuantStatus"])const book = await xts.getOrderBook()
for (const row of book.result) console.log(row.AppOrderID, row.TradingSymbol, row.OrderStatus, row.MQuantStatus)curl -sS "$XTS_ROOT/interactive/orders" -H "authorization: $TOKEN"{"type": "success", "code": "s-orders-0001", "description": "Success order book", "result": [
{
"LoginID": "MQ12", "ClientID": "MQ12", "AppOrderID": 1000000017,
"OrderReferenceID": "", "GeneratedBy": "TWSAPI", "ExchangeOrderID": "",
"OrderCategoryType": "NORMAL", "ExchangeSegment": "NSECM", "ExchangeInstrumentID": 2885,
"OrderSide": "BUY", "OrderType": "Limit", "ProductType": "MIS", "TimeInForce": "DAY",
"OrderPrice": 1250.5, "OrderQuantity": 10, "OrderStopPrice": 0,
"OrderStatus": "New", "OrderAverageTradedPrice": "0",
"LeavesQuantity": 10, "CumulativeQuantity": 0, "OrderDisclosedQuantity": 0,
"OrderGeneratedDateTime": "02-12-2026 10:15:02", "ExchangeTransactTime": "02-12-2026 10:15:02",
"TradingSymbol": "RELIANCE", "LastUpdateDateTime": "02-12-2026 10:15:02",
"OrderExpiryDate": "01-01-1980 00:00:00", "CancelRejectReason": "",
"OrderUniqueIdentifier": "reliance1", "OrderLegStatus": "SingleOrderLeg", "BoLegDetails": 0,
"IsSpread": false, "BoEntryOrderId": "", "ApiOrderSource": "WEBAPI",
"MessageCode": 9004, "MessageVersion": 4, "TokenID": 0, "ApplicationType": 0,
"SequenceNumber": 0, "IsAMO": false, "ApiVendorCode": "", "DashboardAppKey": "",
"MQuantStatus": "received", "MQuantSignalID": "sig_9f2c4e1a7b3d5f60a1b2c3d4"
}
]}Order history#
/api/v1/interactive/orders?appOrderID={appOrderID}Every state of one order, oldest first: New, a Replaced row per modification, then PendingCancel, Cancelled or Rejected.
- SDK Python
get_order_history(appOrderID)· NodegetOrderHistory(appOrderID) - Auth Session token
- Scope
signals:read - Rate class Read
| Query parameter | Rule |
|---|---|
appOrderID | Required. Any AppOrderID of your trader in the key's mode, from any day. |
Each row shows the quantity and prices the order had at that point.
Responses
- 200
s-orders-0001"Success order history". - 400
e-orders-0002unknown AppOrderID;e-orders-0001it is not a number.
history = xt.get_order_history(appOrderID=1000000017)
print([row["OrderStatus"] for row in history["result"]])const history = await xts.getOrderHistory(1000000017)
console.log(history.result.map((row) => row.OrderStatus))curl -sS "$XTS_ROOT/interactive/orders?appOrderID=1000000017" -H "authorization: $TOKEN"{"type": "success", "code": "s-orders-0001", "description": "Success order history", "result": [
{"AppOrderID": 1000000017, "OrderStatus": "New", "OrderQuantity": 10, "OrderPrice": 1250.5, "MQuantStatus": "received", "...": "..."},
{
"LoginID": "MQ12", "ClientID": "MQ12", "AppOrderID": 1000000017,
"OrderReferenceID": "", "GeneratedBy": "TWSAPI", "ExchangeOrderID": "",
"OrderCategoryType": "NORMAL", "ExchangeSegment": "NSECM", "ExchangeInstrumentID": 2885,
"OrderSide": "BUY", "OrderType": "Limit", "ProductType": "MIS", "TimeInForce": "DAY",
"OrderPrice": 1249.5, "OrderQuantity": 20, "OrderStopPrice": 0,
"OrderStatus": "Replaced", "OrderAverageTradedPrice": "0",
"LeavesQuantity": 20, "CumulativeQuantity": 0, "OrderDisclosedQuantity": 0,
"OrderGeneratedDateTime": "02-12-2026 10:15:02", "ExchangeTransactTime": "02-12-2026 10:16:40",
"TradingSymbol": "RELIANCE", "LastUpdateDateTime": "02-12-2026 10:16:40",
"OrderExpiryDate": "01-01-1980 00:00:00", "CancelRejectReason": "",
"OrderUniqueIdentifier": "reliance1", "OrderLegStatus": "SingleOrderLeg", "BoLegDetails": 0,
"IsSpread": false, "BoEntryOrderId": "", "ApiOrderSource": "WEBAPI",
"MessageCode": 9004, "MessageVersion": 4, "TokenID": 0, "ApplicationType": 0,
"SequenceNumber": 0, "IsAMO": false, "ApiVendorCode": "", "DashboardAppKey": "",
"MQuantStatus": "received", "MQuantSignalID": "sig_9f2c4e1a7b3d5f60a1b2c3d4"
}
]}Modify an order#
/api/v1/interactive/ordersChanges the product, order type, quantity, prices or validity of an order the desk has not acted on yet (signal status received).
- SDK Python
modify_order(...)· NodemodifyOrder({...}) - Auth Session token
- Scope
signals:write - Rate class Write, cost 1
- Max body 8,192 bytes
| Body field | Rule |
|---|---|
appOrderID | Required |
modifiedProductType, modifiedOrderType, modifiedOrderQuantity, modifiedTimeInForce | Required, with the place rules |
modifiedDisclosedQuantity, modifiedLimitPrice, modifiedStopPrice | Optional, default 0 |
orderUniqueIdentifier | Optional; echoed back. The stored tag does not change. |
apiOrderSource, clientID, algoID, algoCategory | Accepted |
The segment, instrument and side cannot change. A modify that changes nothing succeeds and stores nothing.
Responses
- 200
s-orders-0001"Request sent". - 400
e-orders-0001invalidmodified…fields;e-orders-0002not found;e-orders-0003the order is no longerreceived. - 503
e-mquant-0003: new orders are paused by the desk.
reply = xt.modify_order(
appOrderID=1000000017,
modifiedProductType=xt.PRODUCT_MIS,
modifiedOrderType=xt.ORDER_TYPE_LIMIT,
modifiedOrderQuantity=20,
modifiedDisclosedQuantity=0,
modifiedLimitPrice=1249.5,
modifiedStopPrice=0,
modifiedTimeInForce=xt.VALIDITY_DAY,
orderUniqueIdentifier="reliance1",
)
print(reply["type"], reply["result"])const reply = await xts.modifyOrder({
appOrderID: 1000000017,
modifiedProductType: 'MIS',
modifiedOrderType: 'LIMIT',
modifiedOrderQuantity: 20,
modifiedDisclosedQuantity: 0,
modifiedLimitPrice: 1249.5,
modifiedStopPrice: 0,
modifiedTimeInForce: 'DAY',
orderUniqueIdentifier: 'reliance1',
})
console.log(reply.type, reply.result)curl -sS -X PUT "$XTS_ROOT/interactive/orders" \
-H "authorization: $TOKEN" -H 'Content-Type: application/json' \
-d '{"appOrderID":1000000017,"modifiedProductType":"MIS","modifiedOrderType":"LIMIT","modifiedOrderQuantity":20,"modifiedDisclosedQuantity":0,"modifiedLimitPrice":1249.5,"modifiedStopPrice":0,"modifiedTimeInForce":"DAY","orderUniqueIdentifier":"reliance1"}'{"type": "success", "code": "s-orders-0001", "description": "Request sent", "result": {"AppOrderID": 1000000017, "OrderUniqueIdentifier": "reliance1", "ClientID": "MQ12"}}Cancel an order#
/api/v1/interactive/orders?appOrderID={appOrderID}Withdraws an order. Its signal becomes cancelled (or cancel_requested once mapped). Nothing is sent to an exchange.
- SDK Python
cancel_order(appOrderID, orderUniqueIdentifier)· NodecancelOrder({ appOrderID, orderUniqueIdentifier }) - Auth Session token
- Scope
signals:write - Rate class Write, cost 1
| Query parameter | Rule |
|---|---|
appOrderID | Required |
orderUniqueIdentifier, clientID | Optional |
Works while new orders are paused.
Responses
- 200
s-user-0001"Request sent";resultis a one-item list. - 400
e-orders-0002not found;e-orders-0003already cancelled or rejected.
cancel = xt.cancel_order(appOrderID=1000000017, orderUniqueIdentifier="reliance1")
print(cancel["type"], cancel["result"])const cancel = await xts.cancelOrder({ appOrderID: 1000000017, orderUniqueIdentifier: 'reliance1' })
console.log(cancel.type, cancel.result)curl -sS -X DELETE "$XTS_ROOT/interactive/orders?appOrderID=1000000017&orderUniqueIdentifier=reliance1" \
-H "authorization: $TOKEN"{"type": "success", "code": "s-user-0001", "description": "Request sent", "result": [{"AppOrderID": 1000000017, "ClientID": "MQ12"}]}Cancel all#
/api/v1/interactive/orders/cancelallCancels today's open orders placed through this interface in one segment, for one instrument or for all of them.
- SDK Python
cancelall_order(exchangeSegment, exchangeInstrumentID)· Node None - Auth Session token
- Scope
signals:write - Rate class Write, cost 1
- Max body 4,096 bytes
| Body field | Rule |
|---|---|
exchangeSegment | Required, as for place |
exchangeInstrumentID | Required. 0 means every instrument in the segment. |
clientID | Optional |
The header X-MQuant-Cancelled gives the number of orders changed. Works while new orders are paused. The Node SDK 3.0.3 has no function for it.
Responses
- 200
s-cancelAll-0001;resultis an empty string. - 400
e-orders-0001bad segment or id.
reply = xt.cancelall_order(exchangeSegment=xt.EXCHANGE_NSECM, exchangeInstrumentID=0)
print(reply["type"], reply["description"])curl -sS -X POST "$XTS_ROOT/interactive/orders/cancelall" \
-H "authorization: $TOKEN" -H 'Content-Type: application/json' \
-d '{"exchangeSegment":"NSECM","exchangeInstrumentID":0}'{"type": "success", "code": "s-cancelAll-0001", "description": "Cancel All Order Request Send Successfully", "result": ""}Trade book#
/api/v1/interactive/orders/tradesAlways an empty list: MQuant does not execute orders.
- SDK Python
get_trade()· NodegetTradeBook() - Auth Session token
- Scope Any
- Rate class Read
Responses
- 200
s-tradeBook-0001"Success trade book".
trades = xt.get_trade()
print(trades["result"])const trades = await xts.getTradeBook()
console.log(trades.result)curl -sS "$XTS_ROOT/interactive/orders/trades" -H "authorization: $TOKEN"{"type": "success", "code": "s-tradeBook-0001", "description": "Success trade book", "result": []}Positions#
/api/v1/interactive/portfolio/positions?dayOrNet={dayOrNet}Always an empty position list.
- SDK Python
get_position_daywise(), get_position_netwise()· NodegetPositions({ dayOrNet }) - Auth Session token
- Scope Any
- Rate class Read
| Query parameter | Rule |
|---|---|
dayOrNet | Required. DayWise or NetWise (also DAY, NET, 1, 2), any case. |
Responses
- 200
s-portfolio-0009"Success get position". - 400
e-portfolio-0001dayOrNetmissing or wrong.
positions = xt.get_position_netwise()
print(positions["result"]["positionList"])const positions = await xts.getPositions({ dayOrNet: 'NetWise' })
console.log(positions.result.positionList)curl -sS "$XTS_ROOT/interactive/portfolio/positions?dayOrNet=NetWise" -H "authorization: $TOKEN"{"type": "success", "code": "s-portfolio-0009", "description": "Success get position", "result": {"positionList": []}}Holdings#
/api/v1/interactive/portfolio/holdingsAlways empty holdings.
- SDK Python
get_holding()· NodegetHoldings() - Auth Session token
- Scope Any
- Rate class Read
Responses
- 200
s-portfolio-0012"Success holding".
holdings = xt.get_holding()
print(holdings["result"]["RMSHoldings"])const holdings = await xts.getHoldings()
console.log(holdings.result.RMSHoldings)curl -sS "$XTS_ROOT/interactive/portfolio/holdings" -H "authorization: $TOKEN"{"type": "success", "code": "s-portfolio-0012", "description": "Success holding", "result": {
"ClientId": "MQ12", "IsCollateralLTPBased": false, "RMSHoldings": {"Holdings": {}}, "CollateralHoldings": {}
}}Log out#
/api/v1/interactive/user/sessionEnds this session. The token stops working at once; your other sessions on the key keep working.
- SDK Python
interactive_logout()· NodelogOut() - Auth Session token
- Scope Any
- Rate class None
Responses
- 200
s-user-0001;resultis an empty string. - 400
e-session-0007"Invalid Token": the session had already ended.
reply = xt.interactive_logout()
print(reply["type"], reply["description"])const reply = await xts.logOut()
console.log(reply.type, reply.description)curl -sS -X DELETE "$XTS_ROOT/interactive/user/session" -H "authorization: $TOKEN"{"type": "success", "code": "s-user-0001", "description": "successfully logout from all API.", "result": ""}