On this page

The full loop: find an instrument, validate the order locally, check the margin, place it, read it back, and cancel it. Written so that nothing actually trades.

Read this box before running anything below

Practise first on Sandbox (UAT / Test — NOT live): https://uat.infinn.in. Then use live. Live calls hit your real account with your real money.

The technique this guide uses to stay safe: a limit order to buy one share of a liquid stock at a price far below the market. Such an order cannot fill - nobody will sell you Reliance at half price - so it rests in the order book where you can inspect it, and then you cancel it.

Do not substitute a market order. Do not increase the quantity. Do not move the price closer while experimenting.

What we will build

You callPlaceOrderPENDINGreceivedOPENrestingREJECTEDnever tradedTRIGGER_PENDINGCOMPLETEfully filledCANCELEDyou withdrew itTradein TradeBookOnly OPEN and TRIGGER_PENDING can be modified or cancelledEverything else is terminal. Check status before you try.
Figure 1. The states we will walk through. We will place an order into OPEN, observe it there, and move it to CANCELED without ever reaching COMPLETE.

The short path

  1. Find the instrument with SearchScrip (exchange + trading symbol, e.g. RELIANCE-EQ).
  2. Get the price with GetQuotes and pick a limit price far below it (for example half).
  3. Validate quantity, tick size and price band before sending.
  4. Check margin with GetOrderMargin.
  5. Place 1 share, prctyp: LMT, with PlaceOrder. Keep the norenordno.
  6. Read it back with SingleOrdStatus or OrderBook; expect OPEN.
  7. Cancel with CancelOrder; expect CANCELED.
Want it done for you?

The Your first trade in 30 minutes page has a copy-paste script that does all of this, dry-run by default.

Learn more: every step in detail, with full code →

Going further

Esc
↑↓ navigate↵ openEsc close/ to search