Automated Trading on AliceBlue using AutoTrader

Introduction

In this article, we will look at how to do automated trading on AliceBlue without using broker’s API. AliceBlue is one of the leading discount brokers in India.

Demo Video

A video explaining this process is available on YouTube

About AliceBlue

We are proud to announce that we have registered as partner with AliceBlue. They are one of the leading discount broker in India. They have lowest brokerage changes & they provide quite attractive margins as well. Click here to open an account with AliceBlue & get one month AutoTrader license free.

You can find more details on their website.

Prerequisite

You need to install AutoTrader software.

You must have a trading account with AliceBlue.

NO need to subscribe to AliceBlue API.

Step 1 – Link AutoTrader with AliceBlue

Important:

  • On aliceblue Trading Platform, You must set same answer to all security questions
  • Example, set answer of all security question to secret (or any other answer)
  • You can take aliceblue customer care help to change answers of security questions

New AutoTrader Users:

Install AutoTrader as per instructions given in Installation section of the user guide & then please enter following things on registration page:

  • Platform: ALICEBLUE
  • Trading Account id: Your aliceblue login id
  • Trading Account Password: Your aliceblue login password
  • Transaction Password: Your aliceblue transaction password
  • 2fa Answer: Common answer to your security questions

Existing AutoTrader Users:

Enter following values in AutoTrader Settings -> Trading Platform :

  1. DEFAULT_CLIENT_ID: Your aliceblue login id
  2. LOGIN_PASSWORD: Your aliceblue login password
  3. LOGIN_2FA_ANSWER: Common answer to your security questions
  4. TRANSACTION_PWD: Your aliceblue transaction password
  5. PLATFORM_NAME: ALICEBLUE
  6. It is recommended to restart AutoTrader after changing settings

NOTE: Your trading account login id and/or password are stored on your local PC. Hence it is safe & Stocksdeveloper does not have access to your trading account by any means.

Step 2:  Use correct instruments

Alice Blue instrument symbols differ a lot from other brokers like Zerodha or Upstox. Please use RTD screen to search for your desired symbols & then use correct Exchange & Trading Symbol in your placeOrder() functions or excel sheets.

Automation

Once AutoTrader is setup with correct credentials & AliceBlue platform, next step is to automate your trading. AutoTrader has built-in support for following software:

  • AmiBroker
  • MetaTrader
  • Excel

Now if you run your strategy in any other software, then please read Connecting AutoTrader with other softwares.

AutoTrader provides you a set of functions that you can use in your strategy code for automation. Please refer to the user guide for details about integrating AutoTrader with your strategy execution/charting software. The integration process depends on your software which executes strategies.

We will show some examples of integrating with AmiBroker. To understand the workflow, please refer AmiBroker AutoTrader workflow. AutoTrader comes bundled with some sample AFLs, you can find details in the user guide.

For a list of available functions, please refer AutoTrader Functions.

Examples

You can find correct instrument/stock symbol on instrument search page on AutoTrader menu (RTD -> Instruments).

Regular limit orders:

placeOrderUsingParams(“NSE”, “SBIN”, “BUY”, “LIMIT”, 1, 330, defaultTriggerPrice(), 1);
placeOrderUsingParams(“NFO”, “NIFTY JUL FUT”, “SELL”, “LIMIT”, 75, 11950, defaultTriggerPrice(), 1);
placeOrderUsingParams(“MCX”, “CRUDEOILM JUL FUT”, “BUY”, “LIMIT”, 1, 4050, defaultTriggerPrice(), 1);

Regular market orders:

placeOrderUsingParams(“NSE”, “SBIN”, “BUY”, “MARKET”, 1, 0, defaultTriggerPrice(), 1);

Regular stoploss orders:

placeOrderUsingParams(“NSE”, “SBIN”, “BUY”, “STOP_LOSS”, 1, 360, 358, 1);
placeOrderUsingParams(“NSE”, “SBIN”, “BUY”, “SL_MARKET”, 1, 0, 358, 1);

Note: We recommend you to look at actual samples available under AutoTrader installation at (C:\autotrader\scripts).

After spending more than 12 years developing Financial Software, I took a break from my career to start my own algorithmic trading setup. This new journey started well and along with my own proprietary trading systems, I also started building automation systems for retail traders, fund managers and HNIs. I was employed with firms like Morgan Stanley, HSBC & SunGard. I work on various technologies, but my strengths are building server side cloud based algorithmic trading systems built primarily using Java programming language. Apart from all of this, I am a big fan of Formula 1 racing :-)

20 thoughts on “Automated Trading on AliceBlue using AutoTrader”
  • M Prudhvi Raj says:

    do we have live charts if we are using alice blue?

    May 3, 2019 at 12:17 pm
    • Admin says:

      Not as of now, but we will have them in the future.

      May 6, 2019 at 5:15 am
  • Arvind says:

    Hi,
    Nice I want auto trading on mt4
    Pls help

    September 20, 2019 at 6:03 pm
  • KANNAN A says:

    I am having alice blue trade account.
    How to use the auto trade app

    September 22, 2019 at 5:16 am
  • Suraj says:

    While running AutoTrader-4.2.0.bat below message is alerting . Please suggest.

    ===========================

    Window protected your PC

    Windows Defender SmarScreen prvented an unrecognized app from startin .
    Running this app might put your PC at risk.

    App: AutoTrader-4.2.0.bat
    Publisher: Unknown publisher

    =====================

    Thanks

    November 7, 2019 at 11:26 pm
    • Admin says:

      Click “More Info” -> Run Anyway

      November 8, 2019 at 7:05 am
  • N G says:

    Very nice…

    January 3, 2020 at 3:22 am
  • SAMEER says:

    CAN THIS WORK IN ANGEL SPEED PRO

    January 13, 2020 at 6:30 pm
    • Pritesh says:

      Yes, because it is ODIN.

      January 15, 2020 at 4:54 am
  • Ganwsh says:

    Will it work with fortune mt4 terminal

    January 18, 2020 at 1:14 am
  • Angelina says:

    Is Algorithmic Trading possible in Indian stock market? If yes, what service, API is available to get started?

    February 19, 2020 at 8:52 pm
    • Pritesh says:

      There are many APIs available like Zerodha API or Upstox API (most common). Most APIs are broker specific, but AutoTrader API is broker independent. For more details visit AutoTrader (look at help and support section) and our Blog.

      February 20, 2020 at 1:42 pm
  • rajni kant says:

    now fyers have also started its API services recently ..kindly arrange to include this also.

    February 22, 2020 at 11:13 am
  • Prasenjit Biswas says:

    during market hour autotrader has stopped taking orders from my excel. After market hours sometimes it takes the order and I can see in my broker’s terminal. Any idea how to fix this?

    April 22, 2020 at 10:23 am
    • Pritesh says:

      Report it to support please.

      April 23, 2020 at 3:45 pm
  • My account in aliceblue i am vba coder currently taking 144 stocks and index prices from trade tiger snap to excel got filter 10 stocks for buying in bracket order manner need execution help or excel which gives me edge to auto execution same 144 stocks and index

    July 26, 2020 at 7:43 am
Leave A Comment