Programmatic Trading in India with Upstox Developer


When Upstox - formally known as RKSV was born in 2010, it was only a few months after exchanges allowed programmatic trading. I remember placing our first trades on an ancient broker terminal and thinking how it could be so behind.

Our history with programmatic trading

We had a few strategies in mind that we wanted to try out but there was no way to know whether it would work. We came from a background where strategies were backtested using historical data. After that, they were put test with small amounts of capital. At that time this was not possible with the broker we were trading with.

So we decided to change our fate, and get our own licenses. I spent first few months just collecting historical prices to build our own price database. Raghu worked hard on trying different strategies based on the little data that we did have. A few months later, we got the green light from the exchanges to trade using our servers. This was around the time Raghu thought he found a strategy that seemed to click.

That changed everything for us.

Within the next two months, we had several strategies running for us during the day. Backtests were running every night to tell us whether the strategy still worked. Any tweaks were done after market hours. All this would not have been possible had we not made the investment in building an infrastructure that supports the trader.

Introducing Upstox Developer

Today, I'm proud to say, that 7 years after we had our first stint with API trading, you can have yours too. Upstox has launched a developer portal this week.

  • Programmatic trading - Get direct access to historical data, live market feed, live trades, and order placement/modifications functionality to you via REST and Socket
  • ** Coming soon ** Platform Bridge - We've built a bridge for AmiBroker which will allow you to get live market data for NSE CM, NSE F&O, and NSE CDS. You will also be able to generate the order alert directly on to Upstox Pro Web

Smarter trading is the future. Technology has to provide feedback on how we trade, visualize our gains and losses, and, eventually, manage our risk. Finding innovative ways to help traders achieve this is our job. The software is the way of the future.

Switch to the new Upstox

To search, select and shortlist from 5000+ stocks, easily - with Smartlists and Smart Filters

Enter your mobile number to get started

26 responses to “Programmatic Trading in India with Upstox Developer

  1. @shrini- Thanks for creating a developer portal for techies.
    Just wanted to say that the link you provided in the post is not working, Please update the link.

  2. @shriniviswanath:disqus In Bridge
    Can we send trade order via amiborker not asking for automate order submit, but manual entry on amiborker

  3. @shriniviswanath:disqus I took a look at the developer doc. Seems like the Upstox package is not available in the npm registry. `npm install –save Upstox` is failing

  4. The Upstox APIs seems to be for an APP development (in iOS or Android) It requires a redirect URL.
    I’m creating a desktop application, and I dont have a redirect URL. Previously I was using NEST APIs to get live feeds and place orders. How you are going to replace functionality which NEST gave me and the Upstox APIs doesn’t have?

    1. Hey Krishna,

      As the login process is based on oAuth you need to provide a “redirect uri”. This redirect uri should be a link to your backend server from which you can redirect again to any page as per your workflow.

      Your authentication process would be as below –

      1. Open your homepage
      2. On press of login button, fetch the loginUrl by called the “getLoginUri” API.
      3. Redirect to the login URL received. Here you need to provide the necessary details and the requested.
      4. Once authenticated you will be redirected to the “redirect_uri” which you provided with a code as the query parameter.
      5. Here in this “redirected url”, you can receive the code and then get the access token by calling the “getAccessToken” API.

      The complete process with the flowchart is present at the below link:

      Hope this helps. Do get back in case of any other queries.

      Happy trading.

      1. I know the new login process. And that’s not my question is. My question is the previous NEST API’s doesn’t have any complication of oAuth or redirect Uri. Now when you are switching from the NEST APIs to your own API, how you are going to tackle with the new complication of oAuth and redirect Uri. Not everybody will be having a redirect Uri or backend server. And without redirect Uri, upstox APIs are useless.

  5. If a person still has to wait for signal and press yes when it appears on terminal, then there is no point of doing so much hassle. The exchange wants to approve execution strategy and not trading strategy and more interested in seeing if there are high frequency orders getting executed but the brokers take it other way round.

  6. Dear Shrini , why this is named as upstox as u r new application. any logic behind it. what is the meaning of it

Leave a Reply

Your email address will not be published. Required fields are marked *


The future of investing is here!

Open demat & trading account in 10 mins