Smart Step Order
This API allows you to build a position gradually by placing orders at price intervals you define.
USE CASE
Average your entry price by buying or selling more quantity at each price step you set.
Note
After execution starts you cannot modify initQty, limitPrice, or orderType.
- Starts with an initial quantity, followed by averaging based on defined step intervals.
- Direction determines whether orders are placed as the price increases or decreases.
- Orders are placed automatically at each step until the total quantity is fulfilled.
- Supports both price-based and time-based step execution.
- Supports only selected NSE and BSE symbols.
Details
- Smart Step Order lets you average your position by placing orders at predefined price intervals, helping you build the position gradually across multiple price levels.
qtyis the total quantity and must be at leastinitQtyplusavgqty.initQtyof 0 means nothing is placed immediately.avgqtyis the quantity per step and must be a multiple of the lot size.avgdiffmust be at least 0.01 and more than 20 times the tick size.direction1 averages as the price falls.direction-1 averages as the price rises.startTimeandendTimeare Unix timestamps within market hours.startTimemust be in the future and before midnight of the current day.- For a Limit order (
orderType1)limitPriceis required.hprandlprof 0 mean no limit.mppmust be 0 to 3 or -1. productTypecan be CNC, MARGIN, INTRADAY or MTF.- Smart orders can be created only on trading days (not special trading days), from 8:00 AM and within regular trading hours. The limit is 100 smart orders per day.
- Rate limits differ between the Standard and Prime plans. See Plans & rate limits.
Request Attributes
| Attribute | Data Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | The instrument's unique identifier, e.g., "NSE:SBIN-EQ" |
side | int | Yes | Order side: 1 for Buy, -1 for Sell (enum: 1, -1) |
qty | int | Yes | Total order quantity (Min: 1, Max: 999999; must be ≥ initQty + avgqty) |
productType | string | Yes | Must be one of: "CNC", "MARGIN", "INTRADAY", "MTF" |
orderType | int | Yes | Order type: 1 for Limit, 2 for Market (enum: 1, 2). If orderType = 1, limitPrice is required. |
avgqty | int | Yes | Quantity to place at each averaging step (Min: 1, Max: 999999) |
avgdiff | float | Yes | Price difference between averaging steps (Min: 0.01) |
direction | int | Yes | 1 for averaging on price decrease, -1 for averaging on price increase (enum: 1, -1) |
startTime | int | Yes | Unix timestamp (epoch) when the order should start executing |
endTime | int | Yes | Unix timestamp (epoch) when the order should expire |
limitPrice | float | Conditional | Default: 0. Required if orderType = 1. Not needed for market orders. |
initQty | int | No | Default: 0. Quantity to place immediately. 0 = no initial order (Max: 999999) |
hpr | float | No | Default: 0. 0 = no upper price limit. If set, execution allowed only below this price. |
lpr | float | No | Default: 0. 0 = no lower price limit. If set, execution is allowed only above this price. |
mpp | float | No | Default: 0. 0 = no market protection. Valid values: 0–3, or -1 (disabled) |
Validations & Error Messages
| Attribute | Validation Rule | Error Message |
|---|---|---|
symbol | Must be a valid trading symbol | "The symbol entered is invalid." |
symbol | Must be allowed for smart orders | "The selected symbol is not allowed for placing smart orders. Please try again with a different symbol." |
symbol | Must be allowed for this segment | "The smart order not allowed for this segment" |
side | Must be 1 or -1 (enum) | "The input details entered is invalid." |
qty | Min: 1, Max: 999999, must be >= initQty + avgqty | "Total Quantity should be greater than or equal to the sum of Initial Qty and Average Qty." |
productType | Must be one of: CNC, MARGIN, INTRADAY, MTF | "productType must be one of the following: CNC, MARGIN, INTRADAY, MTF" |
orderType | Must be 1 or 2 (enum) | "orderType must be one of the following: 1, 2" |
limitPrice | Required if orderType=1 | "The input details entered is invalid." |
avgqty | Min: 1, Max: 999999, must be multiple of lot size | "Avg quantity should be multiple of min lot size." |
avgdiff | Min: 0.01, must be > 20× tick size | "The average entry price must be more than 20 times the tick size." |
direction | Must be 1 or -1 (enum) | "The input details entered is invalid." |
startTime | Cannot be 0 | "Start Time is required to place orders." |
startTime | Must be within market hours | "Start time cannot fall within market closed hours." |
startTime | Cannot be in the past | "The start time entered is earlier than the current time." |
startTime | Must be within current day | "The start time cannot extend beyond midnight of the current day." |
endTime | Cannot be 0 | "End Time is required to place orders." |
endTime | Must be within market hours | "End time cannot fall within market closed hours." |
initQty | Min: 0, Max: 999999 | "The input details entered is invalid." |
hpr (buy, limit) | Min: 0, if provided must be >= limitPrice | "The limit price cannot be higher than the upper price range." |
lpr (buy, limit) | Min: 0, if provided must be <= limitPrice | "The limit price cannot be lower than the lower price range." |
mpp | If provided (>0), must be 0-3 or -1 | "MPP must be either -1 or a value between 0 to 3% (0 to 3)." |
flowtype | Must be a valid smart order type | "The smart order specified in the URL path is not recognized." |
| User | Must not be banned for smart orders | "You are banned for smart order. Please contact support" |
| Trading day | Must not be market-closed day | "You can't create smart orders on market-closed day" |
| Trading day | Smart orders not allowed on special trading day | "Smart orders are not allowed on special trading day" |
| Trading hours | Must not be after market hours | "Smart orders cannot be created after market hours." |
| Trading hours | Must not be before 8:00 AM | "Smart orders are not allowed to be created before 8:00 AM." |
| Trading hours | Must be within regular trading hours | "You can't place a smart order outside regular trading hours" |
| Daily limit | Max 100 smart orders/day | "You have exceeded the maximum limit of creating 100 smart orders for the day." |
Note: After the order starts executing, the following fields cannot be modified: initQty, limitPrice, orderType
Response Attributes
| Attribute | Data Type | Description |
|---|---|---|
code | int | Status code: 200 for success; negative values indicate errors. |
message | string | Text message describing the result — e.g., "Request sent successfully" or the error reason. |
s | string | "ok" for success, "error" for failure. |
id | string | Unique identifier for the placed smart order (returned only on success). |
Last updated on