• 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

Python Library

17481 views July 8, 2022 Pritesh 11

AutoTrader Web API Python library can be used for automated trading on Supports leading Indian Stock Brokers.

Following steps need to be taken in order to use the Python Library.

Installtion

  1. Make sure you have installed python on your computer (version 3.6 or higher)
  2. Install AutoTrader Web’s python library by running following command:
# To install run following command
python -m pip install AutoTrader-Web-API-Stocks-Developer

# To upgrade to latest version run following command
python -m pip install --upgrade AutoTrader-Web-API-Stocks-Developer

Manual Download

If you want to download the library manually, you can do that from pypi or github. We do not recommend manual download, as you would need to download dependencies manually as well. This project depends on the following modules:

  • requests

Initialize

You need to make an instance of AutoTrader class. Just create one instance and share it across your application. See the sample code below:

from com.dakshata.autotrader.api.AutoTrader import AutoTrader

autotrader = AutoTrader.create_instance('<your-api-key>', AutoTrader.SERVER_URL)

You can find your API Key on AutoTrader Web.

Usage

Using the client is pretty straightforward, you invoke appropriate functions on the autotrader instance. For example,

from com.dakshata.autotrader.api.AutoTrader import AutoTrader

autotrader = AutoTrader.create_instance( \
    '<your-api-key>', \
    AutoTrader.SERVER_URL)

# Place regular order
response = autotrader.place_regular_order( \
    'ABC123', 'NSE', 'WIPRO', 'BUY', 'LIMIT', 'INTRADAY', 1, 330.35, 0.0)
print(response)

# Place bracket order
response = autotrader.place_bracket_order( \
    'ABC123', 'NSE', 'WIPRO', 'SELL', 'LIMIT', 1, 326.35, 0.0, 1, 1, 0)
print(response)

# Place cover order
response = autotrader.place_cover_order( \
    'ABC123', 'NSE', 'SBIN', 'SELL', 'LIMIT', 1, 188.15, 190.0)
print(response)

# Cancel order
response = autotrader.cancel_order_by_platform_id( \
	'ABC123', '201007000438034')
print(response)

# Exit bracket or cover order
response = autotrader.cancel_child_orders_by_platform_id( \
	'ABC123', '201007000448051')
print(response)

# Modify an order
response = autotrader.modify_order_by_platform_id('ABC123', '201007000443194', price=325.9)
# response = autotrader.modify_order_by_platform_id('ABC123', '201007000443194', quantity=2)
# response = autotrader.modify_order_by_platform_id('ABC123', '201007000443194', trigger_price=322)
# response = autotrader.modify_order_by_platform_id('ABC123', '201007000443194', order_type='MARKET')
print(response)

# Square-off position
response = autotrader.square_off_position( \
	'ABC123', 'DAY', 'MIS', 'NSE', 'WIPRO')
print(response)

# Square-off portfolio
response = autotrader.square_off_portfolio( \
	'ABC123', 'DAY')
print(response)

# reading orders data
response = autotrader.read_platform_orders('ABC123')
print(*response.result, sep = "\n\n")

# reading positions data
response = autotrader.read_platform_positions('ABC123')
print(*response.result, sep = "\n\n")

# reading margins data
response = autotrader.read_platform_margins('ABC123')
print(*response.result, sep = "\n\n")

API Functions

Note: A detailed explanation is provided for each function along with examples in the API documentation.

GitHub

If you are interested to look at the code of this library, it is available on GitHub.

Was this helpful?

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

© 2025 Stocks Developer. All Rights Reserved.