MQuant Developers v1
Open MQuant

Signals

A signal says what you want traded: instrument, side, size, order type and product. This page lists every field, the rules that tie fields together, and what happens to a signal after you send it.

The signal object#

Send one signal as the JSON body of POST /api/v1/signals or POST /api/v1/signals/test, or up to 10 inside items for POST /api/v1/signals/batch. Field names are case-sensitive and enum values are upper case.

FieldTypeNeedAllowed values and rules
client_signal_idstringRequiredYour id for this signal: 1 to 64 characters from A-Z a-z 0-9 _ -. Unique per key for the life of the key. It is the idempotency key, see Idempotency.
exchangestringRequiredNSE, BSE, NFO, BFO or MCX.
segmentstringOptionalCASH, FNO or COMMODITY. Derived from exchange (NSE and BSE are CASH, NFO and BFO are FNO, MCX is COMMODITY), so you can leave it out. If you send it, it must match: segment_mismatch.
symbolstringRequiredThe exchange trading symbol of the underlying, such as RELIANCE, NIFTY, M&M or CRUDEOIL. Lower-case ASCII letters are upper-cased, then it must be 1 to 32 characters from A-Z 0-9 & _ -. Look-alike Unicode letters are rejected: invalid_symbol.
instrument_typestringRequiredEQ (cash equity), FUT (future), CE (call option) or PE (put option).
expirystringConditionalContract expiry as YYYY-MM-DD, a real date from today (IST) to 1,830 days ahead. Required for FUT, CE, PE; not allowed for EQ.
strikedecimalConditionalStrike price, above 0 and at most 10,000,000, up to 2 decimal places. Required for CE and PE; not allowed for EQ and FUT.
sidestringRequiredBUY or SELL.
quantityintegerConditionalUnits (shares, or contract units), 1 to 1,000,000. Send exactly one of quantity or lots.
lotsintegerConditionalNumber of lots, 1 to 10,000. Send exactly one of quantity or lots. Not allowed for EQ.
order_typestringRequiredMARKET, LIMIT, SL (stop-loss limit) or SL-M (stop-loss market).
pricedecimalConditionalLimit price, above 0 and at most 10,000,000, up to 2 decimal places. Required for LIMIT and SL; not allowed, not even 0, for MARKET and SL-M.
trigger_pricedecimalConditionalStop trigger, same format as price. Required for SL and SL-M; not allowed for MARKET and LIMIT.
productstringRequiredMIS (intraday), NRML (carry-forward derivatives) or CNC (equity delivery).
validitystringOptionalDAY or IOC. Defaults to DAY.
tagstringOptionalYour label, 1 to 20 characters from A-Z a-z 0-9 _ -.
strategy_idstringOptionalYour strategy name, 1 to 32 characters from A-Z a-z 0-9 _ -.
algo_idstringOptional1 to 32 characters from A-Z a-z 0-9 _ -. Stored now for exchange algo-ID tagging once signals are routed.
notesstringOptionalFree text for the desk, 1 to 200 characters after trimming spaces. Control and bidirectional-override characters are rejected.

Validation is strict. A field MQuant does not know is an error, not something it quietly ignores, so a typo such as trigger for trigger_price is caught before the desk sees the signal.

Number and text formats#

Prices and strikes

  • price, trigger_price and strike accept a JSON number or a decimal string such as "112.50". Strings are recommended: they avoid binary floating-point surprises.
  • At most 2 decimal places (too_many_decimals), above 0, at most 10,000,000. Exponents such as 1e3 are rejected.
  • MQuant always returns them as strings with exactly 2 decimals: "24500" comes back as "24500.00".
  • MQuant does not check tick sizes in v1. Send prices on the instrument's tick (0.05 for most NSE and NFO contracts) so the desk can use them unchanged.

Quantities

quantity and lots must be JSON integers. 10.0, "10" and true are rejected with invalid_type. For futures and options you may size in either units or lots; for equity, units only.

Strict JSON

  • The body must be a single JSON object in UTF-8. Anything else is 400 invalid_json.
  • A repeated key, such as two price fields, is 400 duplicate_json_key.
  • NaN, Infinity, exponents and integers longer than 15 digits are 400 invalid_number.
  • Nesting deeper than 4 levels is 400 invalid_json. A signal never needs more than 1, a batch 3.
  • Unknown fields are rejected with unknown_field, including fields that look like server fields, such as status, signal_id or account_id.
  • Control characters, bidirectional overrides and lone surrogates in any string are rejected with forbidden_character.
  • A field set to null is treated as absent.

Cross-field rules#

Each rule below is checked on its own, and every failure is reported in details of one 422 invalid_signal response, so you can fix them all at once.

Exchange and instrument

Cash exchanges take equity only; derivative exchanges take futures and options only (instrument_type_not_allowed).

ExchangeSegmentEQFUTCE / PE
NSECASHYesNoNo
BSECASHYesNoNo
NFOFNONoYesYes
BFOFNONoYesYes
MCXCOMMODITYNoYesYes

Expiry, strike and size

instrument_typeexpirystrikeSize with
EQNot allowedNot allowedquantity only
FUTRequiredNot allowedquantity or lots
CE, PERequiredRequiredquantity or lots

Send exactly one of quantity or lots (quantity_xor_lots). Equity must use quantity (lots_not_allowed_for_equity). Missing or extra contract fields give expiry_required, expiry_not_allowed, strike_required or strike_not_allowed. An expiry before today (IST) is expiry_in_past; more than 1,830 days ahead is expiry_too_far.

Order type, price and trigger

order_typepricetrigger_priceMeaning
MARKETNot allowedNot allowedTrade at the market
LIMITRequiredNot allowedTrade at price or better
SLRequiredRequiredWhen trigger_price trades, place a limit order at price
SL-MNot allowedRequiredWhen trigger_price trades, place a market order

Breaking these gives price_required, price_not_allowed, trigger_price_required or trigger_price_not_allowed. For SL, the trigger must sit on the correct side of the limit price (trigger_price_inconsistent):

  • BUY stop-loss: trigger_price ≤ price. For example trigger 100.00, limit 100.50.
  • SELL stop-loss: trigger_price ≥ price. For example trigger 53000.00, limit 52990.00.

Product

productEQFUT, CE, PE
CNCYesNo
NRMLNoYes
MISYesYes

CNC is equity delivery only and NRML is derivatives only (product_not_allowed). MIS works with every instrument.

Risk caps#

After a signal passes validation it is checked against the risk caps on your key. The current caps are in limits of GET /api/v1/me; the desk sets them. A breach returns 422 with error_type: "RiskException" and nothing is stored.

CodeWhenDefault cap
max_quantity_exceededquantity is above max_quantity100,000 units
max_lots_exceededlots is above max_lots1,000 lots
max_notional_exceededprice × quantity is above max_notional, when both are set₹5,00,00,000.00

The notional check needs both a price and a quantity in units. It is skipped for MARKET and SL-M orders and for signals sized in lots; such signals get the notional_unchecked warning.

Warnings#

Warnings never stop a signal. They are stored on it, returned to you and shown to the desk.

WarningAdded when
outside_market_hoursThe signal arrives outside Monday to Friday 09:15 to 15:30 IST for NSE, BSE, NFO and BFO, or 09:00 to 23:55 IST for MCX. Exchange holidays and special sessions are not modelled in v1.
notional_uncheckedThe notional could not be checked: the order is MARKET or SL-M, or it is sized in lots.
expiry_todayThe contract expires today (IST).

Example payloads#

Each body below is complete and valid. The derivative examples use fixed expiry dates; change expiry to the expiry of a contract that is trading when you send it. Dry-run with POST /api/v1/signals/test first.

NSE equity, LIMIT, delivery (CNC)#

POST /api/v1/signals
{
  "client_signal_id": "reliance-0001",
  "exchange": "NSE",
  "symbol": "RELIANCE",
  "instrument_type": "EQ",
  "side": "BUY",
  "quantity": 10,
  "order_type": "LIMIT",
  "price": "1250.50",
  "product": "CNC"
}

NSE equity, MARKET, intraday (MIS), IOC#

POST /api/v1/signals
{
  "client_signal_id": "infy-0003",
  "exchange": "NSE",
  "symbol": "INFY",
  "instrument_type": "EQ",
  "side": "SELL",
  "quantity": 25,
  "order_type": "MARKET",
  "product": "MIS",
  "validity": "IOC",
  "strategy_id": "infy-mean-rev"
}

NFO index future, stop-loss limit (SL), sized in lots#

POST /api/v1/signals
{
  "client_signal_id": "bnf-fut-0007",
  "exchange": "NFO",
  "symbol": "BANKNIFTY",
  "instrument_type": "FUT",
  "expiry": "2026-12-29",
  "side": "SELL",
  "lots": 1,
  "order_type": "SL",
  "price": "52990.00",
  "trigger_price": "53000.00",
  "product": "NRML",
  "strategy_id": "bnf-breakdown"
}

NFO call option, LIMIT, sized in lots#

POST /api/v1/signals
{
  "client_signal_id": "nifty-0001",
  "exchange": "NFO",
  "symbol": "NIFTY",
  "instrument_type": "CE",
  "expiry": "2026-12-29",
  "strike": "24500",
  "side": "BUY",
  "lots": 2,
  "order_type": "LIMIT",
  "price": "112.50",
  "product": "NRML",
  "tag": "momo1"
}

NFO put option, stop-loss market (SL-M), sized in units#

POST /api/v1/signals
{
  "client_signal_id": "nifty-pe-0042",
  "exchange": "NFO",
  "symbol": "NIFTY",
  "instrument_type": "PE",
  "expiry": "2026-12-29",
  "strike": "24000",
  "side": "SELL",
  "quantity": 75,
  "order_type": "SL-M",
  "trigger_price": "85.00",
  "product": "MIS",
  "algo_id": "hedge-v2"
}

MCX commodity future, LIMIT#

POST /api/v1/signals
{
  "client_signal_id": "crude-0101",
  "exchange": "MCX",
  "symbol": "CRUDEOIL",
  "instrument_type": "FUT",
  "expiry": "2026-12-17",
  "side": "BUY",
  "lots": 1,
  "order_type": "LIMIT",
  "price": "6120.00",
  "product": "NRML",
  "notes": "Breakout above the opening range"
}

Batch of two (a pair trade)

Up to 10 signals in one call, stored all together or not at all. See POST /signals/batch.

POST /api/v1/signals/batch
{
  "items": [
    {
      "client_signal_id": "pair-0001-a",
      "exchange": "NSE",
      "symbol": "HDFCBANK",
      "instrument_type": "EQ",
      "side": "BUY",
      "quantity": 50,
      "order_type": "LIMIT",
      "price": "1712.40",
      "product": "MIS"
    },
    {
      "client_signal_id": "pair-0001-b",
      "exchange": "NSE",
      "symbol": "ICICIBANK",
      "instrument_type": "EQ",
      "side": "SELL",
      "quantity": 60,
      "order_type": "LIMIT",
      "price": "1281.05",
      "product": "MIS"
    }
  ]
}

The stored signal#

Every endpoint that returns a signal returns this shape. Fields you did not send come back as null; segment and validity are filled in.

Signal object
{
  "object": "signal",
  "signal_id": "sig_9f2c4e1a7b3d5f60a1b2c3d4",
  "client_signal_id": "nifty-0001",
  "batch_id": null,
  "status": "received",
  "mode": "live",
  "exchange": "NFO",
  "segment": "FNO",
  "symbol": "NIFTY",
  "instrument_type": "CE",
  "expiry": "2026-12-29",
  "strike": "24500.00",
  "side": "BUY",
  "quantity": null,
  "lots": 2,
  "order_type": "LIMIT",
  "price": "112.50",
  "trigger_price": null,
  "product": "NRML",
  "validity": "DAY",
  "tag": "momo1",
  "strategy_id": null,
  "algo_id": null,
  "notes": null,
  "warnings": ["outside_market_hours"],
  "reject_reason": null,
  "cancel_reason": null,
  "received_at": "2026-12-02T04:00:00.123Z",
  "updated_at": "2026-12-02T04:00:00.123Z",
  "status_history": [
    {"status": "received", "at": "2026-12-02T04:00:00.123Z", "by": "trader", "note": null}
  ]
}
  • signal_id: MQuant's id, sig_ + 24 hex characters.
  • batch_id: bat_ + 24 hex characters when the signal arrived in a batch, otherwise null.
  • mode: live or test, from the key that sent it.
  • status_history: every status change, oldest first. by is trader, desk or system; note carries a cancel reason or a desk note.
  • received_at, updated_at: UTC with milliseconds.
  • replayed: present only on create responses. true when MQuant returned an existing signal instead of storing a new one.

Statuses and lifecycle#

StatusMeaningSet by
receivedStored and waiting for the desk. Every new signal starts here.MQuant
acceptedThe desk accepted it. Nothing is sent anywhere in v1.Desk
rejectedThe desk rejected it. reject_reason says why. Final.Desk
cancelledYou cancelled it before it was mapped. Final.You
mappedReserved for desk routing to accounts. Not used in v1.Desk
cancel_requestedYou asked to cancel a signal that was already mapped. Reserved; not reachable in v1.You
received
accepted by the desk, and can still be rejected or cancelled
rejected by the desk, final
cancelled by you, final
mapped cancel_requested reserved for routing, not used in v1
  • The desk can move received to accepted or rejected, and accepted to rejected.
  • You can cancel a received or accepted signal with POST /api/v1/signals/{signal_id}/cancel. Cancelling a rejected or cancelled signal returns 409 signal_not_cancellable.
  • Cancel only changes the stored status. In v1 there is no order at a broker to cancel.
  • Test signals can be rejected but never accepted.
  • MQuant does not push status changes to you. Poll GET /api/v1/signals/{signal_id}, or list recent signals with GET /api/v1/signals?status=accepted, within your read limits.

Idempotency#

client_signal_id makes sending safe to retry. MQuant stores at most one signal per client_signal_id per key, for the life of the key, across secret rotations.

You sendMQuant answers
A new client_signal_id202, the new signal, replayed: false
The same id and an identical payload200, the original signal as it is now, replayed: true and the header Idempotent-Replayed: true. This holds even if the signal's status changed, your caps changed or the expiry has passed since.
The same id and a different payload409 idempotency_conflict, with the existing signal_id in details

The comparison uses the normalised signal: "symbol": "reliance" and "RELIANCE", or "price": 1250.5 and "1250.50", count as the same payload. Signals that fail validation (400 or 422) are never stored and do not use up the id, so fix the body and resend with the same id.

Safe retry

  1. On a timeout, a dropped connection or a 5xx, send the identical body again with the same client_signal_id and a fresh timestamp, nonce and signature. If the first attempt was stored you get it back with replayed: true; if not, it is stored now.
  2. If you no longer have the exact body, look the signal up first with GET /api/v1/signals/by-client-id/{client_signal_id}. A 404 means it was never stored.
  3. On 429, wait for Retry-After seconds, then retry the same way.
  4. Do not retry any other 4xx without changing the request. It will fail the same way.
  5. A new trading decision always gets a new client_signal_id. Reusing one for a different signal returns 409 idempotency_conflict.

The Python and Node clients on Code examples implement this in send_signal() / sendSignal(). A good client_signal_id is built from your own order reference, for example momo1-20261202-000123.

Batches

  • A batch is all or nothing. If any item fails validation, every failing item is listed with its index and nothing is stored.
  • Two items with the same client_signal_id return 422 duplicate_client_signal_id.
  • If any item reuses an existing id with a different payload, the batch returns 409 idempotency_conflict and nothing is stored.
  • Items that exactly match existing signals come back with replayed: true. New items share one new batch_id. If every item was a replay, the status is 200 and batch_id is null.
MQuant is the platform of Sykes & Ray Equities. Questions go to your MQuant desk contact.