How did you learn API-based trading?

Share your experience and any resources that were particularly helpful. Do you have any recommendations for others looking to learn? :thinking:

1 Like

@Vinit_1989 -

Thanks for this questionā€¦it is a good one.

For me, I essentially stumbled into programmatic / API-based trading because it was a means to an end. I started API-based trading ~2006 (in the US) and prior to that was primarily using a combination of technical and fundamental analysis. Since I traded through the tech crash in the late 90s, I realized that in times of crisis, keeping control of your emotions and being systematic is easier said than done. I began approaching trading in an extremely methodical way. Instead of trying to identify and execute entry/exit points on individual trades, the intent was trade across a ā€œuniverseā€.

Here is an example of this: There is academic research (in the US) that shows that companies with low volatility skew prior to an earnings announcement outperform those companies with high volatility skew. Volatility skew is defined as the implied volatility of OTM(put) ā€“ ATM(call). So, you would go long companies with low vol skew (ranked by decile) and short companies with high vol skew. The data gathering and initial back testing would be done manually and potentially supported with an API to collect the historical data. Analysis for determination of vol skew deciles would be automated along with the trade execution of these hundreds of trades each quarter. This would be one of many strategies being run.

I wrote an article that Upstox published on our news site today. If you give it a quick read, it will hopefully give you additional ideas of how I approach trading strategies: How does the earnings season impact your portfolio? All you need to know

So, there are two key components with API trading (IMO): coming up with ideas for trading strategy (particularly ideas that are best served with automation) and the actual programming. Here are a few resources that Iā€™ve used for the former. Some of the books are pretty old since I used them when I was just starting out:

  • Social Science Research Network (search for market anomaly, trading strategies, etc.) ā€“ This is where academic faculty post working papers prior to publication. Iā€™ve found this to be a great source of trading ideas. However, you still need to do the work to figure out how to gather the data and execute your own analysis.

  • Applied Quantitative Methods for Trading and Investment ā€“ Gives an overview of various techniques for quant trading from stat arb to forecasting to volatility modeling. Any of this could be automated as part of a programmatic trading strategy.

  • Handbook of Alternative Assets ā€“ Not necessarily about API trading but more about various strategies of hedge funds along with their return distributions. Ultimately, when you are running trading strategies like I describe above, you are operating very similar to a global macro / stat arb / merger arbitrage fund. This gives you a bit of background on these types of strategies.

  • Investment Strategies of Hedge Funds ā€“ Similar to the above book but not as in-depth.

Hope this helps!

4 Likes

I was lucky to work with a group of High Frequency Traders who wanted to enter Indian markets. We traded in milliseconds and 3 computers placed over 2.5 lac orders / day. Translating roughly to 60k trades / day

This was using omnesys platform

Then I wrote some code in VBA excel using an API, that was very well documentedā€¦ i received market data and my program processed it to take decision and place buy / sell orders.

Where ever stuck, i tool help from other systematic traders

1 Like

Hey Vinit, I think this is an interesting question. As far as I recall, it made more imprvements in me to learn via implementing things at each step rather than learn first and implement it. I had an experience working in a Hedge Fund for around 2 years and as my team was in initial stages, I got to work in the develop the systems using the NSE colocation servers, testing and building strategies in mid and high frequency range as well as design post and pre trade analysis tool to constantly monitor the strategies for improvements.

If someone wants to learn API Trading today, they should start with basics of designing a trading system. You can find many medium based articles for this. The 3 major components to learn are -

  1. The Login Systems
  2. The Strategy Generation Systems
  3. The Place Order Systems

Actually, what I observed recently is, in order to learn API based trading, the expectations from day 1 is to make a complex options trading system with adjustments and lowest latency within a couple of days. My recommendation is to start slow, start with building easy systems and slowly over the period of time, try to build features one at a time on top of it.

There are many books from Wiley, Packt, and Oā€™ Reilly which can be read to get good ideas around designing these systems.

Looking forward to answer any follow ups for this.

3 Likes