Python for fun and profit - quite literally. Identifying Investment Opportunities using Python.

Abhijit Gadgil (~gabhijit)


1

Vote

Description:

Motivation

If one wants to answer investment questions like following in few seconds, from a historical data of 15 years?

  1. During last 15 years how many 2X in a calendar year opportunities were there?
  2. Which stocks are showing 'interesting' volume? (ie. a volume above moving average of last few days.)
  3. Which stocks outperformed mainstream index like Nifty or Nifty 500 in the last one month? (Momentum)

Coming specifically to Python -

  1. Can you use Python for identifying 'interesting' investing opportunities as discussed above?
  2. Can you offer this as a service so that it's possible for anyone to use it?
  3. If the answer to above questions is Yes, how do we go about doing it.

To be able to answer yes to question 1 above - We need to look at closely only at a subset of stocks from the entire universe (Approximately 1500). So we should be able to -

  1. Do aggregation/Processing (daily - to weekly/monthly data)
  2. Fast computations over the data (eg. doing something like Exponential Moving Average over a large number of stocks- typically 1500)
  3. Compute returns distribution (essentially something of the form row[n]/row[n-m])

To be able to answer Question 2, we need to be -

  1. Able to perform these computations extremely fast (typical budget is at the most few seconds).

To be able to answer Question 3 - Is left as homework :-) Well this link sheds some light on answer to Question 3, This is what the talk would also cover in greater details.

The talk will Cover -

  1. Motivation and an Architecture (~5 mins)
  2. Challenges in Downloading and pre-processing data (~5 mins-10mins)
    • Some SQLAlchemy Quirks
    • Fancy Regular Expressions (Thanks to non-standard data available at NSE)
  3. Some counter-intuitive observations and their explaination in Data Processing (~5-10mins)
  4. Data Processing Deep Dive and Example Uses (~5-10mins)
  5. Lessons and Next Steps (~5 mins)
  6. Q and A (remaining)

Prerequisites:

Some experience in Python - pandas is desirable. Interest in Equity Markets useful.

Content URLs:

Slides: Draft

Blogs:

See above

Code:

  1. tickerplot-site
  2. tickerplot python package
  3. download utils
  4. data processing worker WIP - Very very early right now

Speaker Info:

  1. Founder @ hyphenOs.
  2. Interested in Networking (L2/L3) and latest developments in Software Defined Networking.
  3. Passionate about Capital Markets.
  4. Super fussy about maintainable code (knowing that often I don't get it right first time, so have to iterate). Writes code in Python and C/C++ and sometimes Javascript.
  5. Hates trailing white spaces in code.

Speaker Links:

  1. Stack Overflow
  2. Github
  3. LinkedIn

Section: Data Analysis and Visualization
Type: Talks
Target Audience: Intermediate
Last Updated: