Skip to Content

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.
  • qty is the total quantity and must be at least initQty plus avgqty. initQty of 0 means nothing is placed immediately.
  • avgqty is the quantity per step and must be a multiple of the lot size. avgdiff must be at least 0.01 and more than 20 times the tick size.
  • direction 1 averages as the price falls. direction -1 averages as the price rises.
  • startTime and endTime are Unix timestamps within market hours. startTime must be in the future and before midnight of the current day.
  • For a Limit order (orderType 1) limitPrice is required. hpr and lpr of 0 mean no limit. mpp must be 0 to 3 or -1.
  • productType can 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

AttributeData TypeRequiredDescription
symbolstringYesThe instrument's unique identifier, e.g., "NSE:SBIN-EQ"
sideintYesOrder side: 1 for Buy, -1 for Sell (enum: 1, -1)
qtyintYesTotal order quantity (Min: 1, Max: 999999; must be ≥ initQty + avgqty)
productTypestringYesMust be one of: "CNC", "MARGIN", "INTRADAY", "MTF"
orderTypeintYesOrder type: 1 for Limit, 2 for Market (enum: 1, 2). If orderType = 1, limitPrice is required.
avgqtyintYesQuantity to place at each averaging step (Min: 1, Max: 999999)
avgdifffloatYesPrice difference between averaging steps (Min: 0.01)
directionintYes1 for averaging on price decrease, -1 for averaging on price increase (enum: 1, -1)
startTimeintYesUnix timestamp (epoch) when the order should start executing
endTimeintYesUnix timestamp (epoch) when the order should expire
limitPricefloatConditionalDefault: 0. Required if orderType = 1. Not needed for market orders.
initQtyintNoDefault: 0. Quantity to place immediately. 0 = no initial order (Max: 999999)
hprfloatNoDefault: 0. 0 = no upper price limit. If set, execution allowed only below this price.
lprfloatNoDefault: 0. 0 = no lower price limit. If set, execution is allowed only above this price.
mppfloatNoDefault: 0. 0 = no market protection. Valid values: 0–3, or -1 (disabled)

Validations & Error Messages

AttributeValidation RuleError Message
symbolMust be a valid trading symbol"The symbol entered is invalid."
symbolMust be allowed for smart orders"The selected symbol is not allowed for placing smart orders. Please try again with a different symbol."
symbolMust be allowed for this segment"The smart order not allowed for this segment"
sideMust be 1 or -1 (enum)"The input details entered is invalid."
qtyMin: 1, Max: 999999, must be >= initQty + avgqty"Total Quantity should be greater than or equal to the sum of Initial Qty and Average Qty."
productTypeMust be one of: CNC, MARGIN, INTRADAY, MTF"productType must be one of the following: CNC, MARGIN, INTRADAY, MTF"
orderTypeMust be 1 or 2 (enum)"orderType must be one of the following: 1, 2"
limitPriceRequired if orderType=1"The input details entered is invalid."
avgqtyMin: 1, Max: 999999, must be multiple of lot size"Avg quantity should be multiple of min lot size."
avgdiffMin: 0.01, must be > 20× tick size"The average entry price must be more than 20 times the tick size."
directionMust be 1 or -1 (enum)"The input details entered is invalid."
startTimeCannot be 0"Start Time is required to place orders."
startTimeMust be within market hours"Start time cannot fall within market closed hours."
startTimeCannot be in the past"The start time entered is earlier than the current time."
startTimeMust be within current day"The start time cannot extend beyond midnight of the current day."
endTimeCannot be 0"End Time is required to place orders."
endTimeMust be within market hours"End time cannot fall within market closed hours."
initQtyMin: 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."
mppIf provided (>0), must be 0-3 or -1"MPP must be either -1 or a value between 0 to 3% (0 to 3)."
flowtypeMust be a valid smart order type"The smart order specified in the URL path is not recognized."
UserMust not be banned for smart orders"You are banned for smart order. Please contact support"
Trading dayMust not be market-closed day"You can't create smart orders on market-closed day"
Trading daySmart orders not allowed on special trading day"Smart orders are not allowed on special trading day"
Trading hoursMust not be after market hours"Smart orders cannot be created after market hours."
Trading hoursMust not be before 8:00 AM"Smart orders are not allowed to be created before 8:00 AM."
Trading hoursMust be within regular trading hours"You can't place a smart order outside regular trading hours"
Daily limitMax 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

AttributeData TypeDescription
codeintStatus code: 200 for success; negative values indicate errors.
messagestringText message describing the result — e.g., "Request sent successfully" or the error reason.
sstring"ok" for success, "error" for failure.
idstringUnique identifier for the placed smart order (returned only on success).
Last updated on