• Home
  • Products
    • Login
    • Product Info
    • User Guide
    • Pricing
  • Services
    • Stock Brokers
    • Freelancers
  • Help
    • Documentation
    • Knowledge Base
    • FAQ
  • Company
    • About Us
    • Contact Us
    • Terms & Conditions
  • Home
  • Products
    • Login
    • Product Info
    • User Guide
    • Pricing
  • Services
    • Stock Brokers
    • Freelancers
  • Help
    • Documentation
    • Knowledge Base
    • FAQ
  • Company
    • About Us
    • Contact Us
    • Terms & Conditions

AutoTrader Web

home/Documentation/AutoTrader Web
Expand All Collapse All
  • Index
  • Getting Started
  • Portfolio Management System (PMS)
  •  Copy Trading (Master-Child Auto-Copy)
    • Master-Child Copy - Performance
  • PMS vs Master-Child
  • Trading View
  •  Supported Brokers
    • Symphony XTS
    • Zerodha
    • Angel Broking
    • Dhan
    • Aliceblue
    • Fyers
    • Nuvama
    • IIFL
    • Zebu
    • Finvasia
    • Motilal Oswal
    • Kotak
    • Mastertrust
    • Five Paisa
    • Choice Broking
    • FlatTrade
    • Tradejini
    • Upstox
    • SAS Online
    • Profitmart
  •  Client Setup
    • Desktop Client
    • AmiBroker Library
    • Excel Library or Tools
    • Java Library
    • MetaTrader Library
    • C# Library
    • Python Library
    • HTTP REST
  •  User Interface
    • User Registration
    •   Settings
      • General
      • Trading Accounts
      • Pseudo Accounts
      • Group Accounts
      • API Key
    •   AutoTrader
      • Activity
      • Instruments
    •   Trading
      • Summary
      • Positions
      • Orders
      • Margins
      • Holdings
      • Trade
    •   User
      • Account
      • Profile
  •  API (Application Programming Interface)
    • Place Regular Order
    • Place Cover Order
    • Place Bracket Order
    • Place Advanced Order
    • Cancel Order
    • Cancel Child Orders
    • Cancel All Orders
    • Modify Order
    • Modify Order Price
    • Modify Order Quantity
    • Square-off Position
    • Square-off Portfolio
    • Read Orders
    • Read Positions
    • Read Margins
    • Read Holdings
    • Read Portfolio Summary
    • Fetch All Trading Accounts
    • Create or Update Trading Account
    • Validate Trading Account Credentials
    • API Parameters
    • API Rate Limits
    • Email Limits
    • Postman
  • Pricing
  • Precautions
  •  Broker Independence
    • API Functions
    • Pseudo Account
    • Instruments (Trading Symbols)
  • Quantity Multiplier
  • Architecture

API Parameters

15117 views October 14, 2024 Pritesh 11

In this section, we will take a look at different parameters that are passed to the API functions.

Every trading platform has different formats for orders, positions, trades & margins. The job of AutoTrader is to hide these platform specific details and provide a standard format to our users. API functions accept standard formats as defined by AutoTrader team and our software internally converts it to a format specific to your trading platform.

AutoTrader API is provided in multiple programming languages. The description given below is generic and applies to all languages, hence there might be minor differences. Users are advised to look at language specific examples.

Order Id

Data Type – Text or String

Order id an id that uniquely identifies the order. In AutoTrader, you will deal with 3 types of order ids.

  1. Publisher Id – This is give in programming languages like AmiBroker AFL or MetaTrader MQL, where direct HTTP Rest communication is not possible. This id is generated by the API functions. AutoTrader will then map this to the actual order. This id might not be unique across different users, as the generation of id is done on client side.
  2. System Id – When AutoTrader receives a new order, it assigns a new id. This id is unique across all users of AutoTrader platform.
  3. Platform Id – This is an id given to the order by your stock broker’s trading platform.

Account

Data Type – Text or String

A pseudo account is basically a dummy account to be used for trading. The system internally maps it to an actual trading account. More details about how to create it.

Variety

Data Type – Text or String or Enumeration

Variety represents the kind of an order. We have 3 types of varieties:

  1. REGULAR – Represents a regular order
  2. BO – Represents a bracket order
  3. CO – Represents a cover order

Exchange

Data Type – Text or String or Enumeration

An exchange represents the stock exchange on which the order symbol is traded. We have 3 valid exchanges:

  1. NSE – National Stock Exchange
  2. BSE – Bombay Stock Exchange
  3. MCX – Multi Commodity Exchange

Symbol

Data Type – Text or String

A symbol represents a stock or derivative contract. Symbol must be a broker independent symbol. You can use this Indian API stock symbol search tool.

Trade Type

Data Type – Text or String or Enumeration

Represents a trade type or sometimes knows as transaction type. There are 2 valid trade types:

  • BUY – Represents a buy order
  • SELL – Represents a sell order
  • SHORT – Represents a sell order (added for charting software support – only allowed in csv format used by Desktop client)
  • COVER – Represents a buy order (added for charting software support – only allowed in csv format used by Desktop client)

Order Type

Data Type – Text or String or Enumeration

Represents an order type. There are 4 valid order types:

  1. LIMIT – Represents a limit order
  2. MARKET – Represents a market order
  3. STOP_LOSS – Represents a stoploss order
  4. SL_MARKET – Represents a stoploss market order

Product Type

Data Type – Text or String or Enumeration

Represents a product type. There are 3 valid product types:

  1. INTRADAY – Represents an intraday or MIS order
  2. DELIVERY – Represents a delivery order
  3. NORMAL – Represents a normal order

Validity

Data Type – Text or String or Enumeration

Represents order validity. There are 2 types of valid validity:

  1. DAY – Order is valid for the day (this is default)
  2. IOC – Immediate or cancel

Note: Do not confuse Validity with Product Type. Both are different things.

Quantity

Data Type – Numeric or Integer

AutoTrader functions pass the quantity as it is to the trading platform.

The confusion mostly happens for derivatives. Users are confused whether to pass quantity in multiple of lot size or number of lots? The answer is all trading platforms supported by AutoTrader take quantity in multiple of lot size.

Example: To buy 1 lot of NIFTY Future (assuming it has a lot size of 75), you need to enter quantity as

= (#lots * lots_size) = (1 * 75) = 75

Disclosed Quantity

Data Type – Numeric or Integer

Represents a disclosed quantity. It is an optional parameter and defaults to zero.

Price

Data Type – Decimal or Float

Represents order price. For a market order, this price is defaulted to zero.

Note: Price is automatically rounded to the nearest tick price. So users need not worry about price being a multiple of tick size. Example: A price of 50.54 with a tick size of 0.05 will be converted to 50.55.

Trigger Price

Data Type – Decimal or Float

Represents a trigger price. It is used in a stoploss order or a cover order.

Note: Trigger price is automatically rounded to the nearest tick price. So users need not worry about trigger price being a multiple of tick size. Example: A price of 50.54 with a tick size of 0.05 will be converted to 50.55.

Target (Bracket Order)

Data Type – Decimal or Float

Represents target of a bracket order.

Stoploss (Bracket Order)

Data Type – Decimal or Float

Represents stoploss of a bracket order.

Trailing Stoploss (Bracket Order)

Data Type – Decimal or Float

Represents trailing stoploss of a bracket order. In most cases, it should be an absolute value.

Upstox is a little different than other brokers, their system takes trailing stoploss in number of ticks. So if a stock or derivative has a tick size of 0.05, and you want to put a trailing stoploss of 1/-. The on upstox system, you need to enter 20, calculated as 1 divide by 0.05.

But as AutoTrader is broker independent, it takes trailing stoploss as absolute value (example, 1/- as explained above). Even for upstox accounts, the value should be entered as absolute (not in number of ticks). The system internally looks at the tick size and converts it into number of ticks.

AMO

Data Type – Text or String or Boolean

Indicates whether an order is an After Market Order.

  1. TRUE – means an order is AMO
  2. FALSE – means an order is not AMO (this is default)

Validate

Data Type – Boolean

This parameter is only used in AmiBroker. When it set to True, the system will not accept back to back BUY or back to back SELL orders. It will consider them as duplicate orders generated due to a known limitation of AmiBroker. When you get a signal in AmiBroker, it remains active until the candle is complete. Unfortunately, every time strategy runs during this active state; it will see that signal is active and place order; which results in duplicate orders being generated.

AmiBroker experts can set it to False and manage the signal in their strategy code. This simple flag was built for beginners.

OrderStatus

Data Type – Text or String or Enumeration

Represents order status which is broker independent. Broker specific statuses are not uniform, hence AutoTrader parses them into a standard status.

Valid values are:

  1. OPEN – Open
  2. COMPLETE – Complete
  3. CANCELLED – Cancelled
  4. REJECTED – Rejected
  5. TRIGGER_PENDING – Trigger pending
  6. UNKNOWN – Unknown (when system cannot determine the type from the raw order status received from stock broker)

MarginCategory

Data Type – Text or String or Enumeration

Represents margin category.

  1. EQUITY – Represents margin for Equity section of your account
  2. COMMODITY – Represents margin for Commodity section of your account
  3. ALL – Represents combined margin for Equity & Commodity

PositionCategory

Data Type – Text or String or Enumeration

Represents position category.

  1. DAY – snapshot of the buying and selling activity for that particular day
  2. NET – actual or current net position

PositionType

Data Type – Text or String or Enumeration

Represents position type.

  1. MIS – MIS or intraday position
  2. CNC – CNC or delivery position
  3. NRML – Normal position position
  4. BO – BracketOrder position
  5. CO – CoverOrder position

PositionState

Data Type – Text or String or Enumeration

Represents state of the position, which can be either OPEN or CLOSED.

  1. OPEN – The position is open
  2. CLOSED – The position is closed

PositionDirection

Data Type – Text or String or Enumeration

Represents direction of the position.

  1. LONG – A long position
  2. SHORT – A short position
  3. NEUTRAL – A neutral position
Read Portfolio Summary
API Rate Limits

Was this helpful?

11 Yes  2 No
Related Articles
  • Master-Child Copy – Performance
  • Tradejini
  • Dhan
  • FlatTrade
  • Supported Brokers
  • Symphony XTS

© 2025 Stocks Developer. All Rights Reserved.