Python for fun and profit - quite literally. Identifying Investment Opportunities using Python.
Abhijit Gadgil (~gabhijit) |
1
Description:
Motivation
If one wants to answer investment questions like following in few seconds, from a historical data of 15 years?
- During last 15 years how many 2X in a calendar year opportunities were there?
- Which stocks are showing 'interesting' volume? (ie. a volume above moving average of last few days.)
- Which stocks outperformed mainstream index like Nifty or Nifty 500 in the last one month? (Momentum)
Coming specifically to Python -
- Can you use Python for identifying 'interesting' investing opportunities as discussed above?
- Can you offer this as a service so that it's possible for anyone to use it?
- 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 -
- Do aggregation/Processing (daily - to weekly/monthly data)
- Fast computations over the data (eg. doing something like Exponential Moving Average over a large number of stocks- typically 1500)
- Compute returns distribution (essentially something of the form
row[n]/row[n-m]
)
To be able to answer Question 2, we need to be -
- 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 -
- Motivation and an Architecture (~5 mins)
- Challenges in Downloading and pre-processing data (~5 mins-10mins)
- Some SQLAlchemy Quirks
- Fancy Regular Expressions (Thanks to non-standard data available at NSE)
- Some counter-intuitive observations and their explaination in Data Processing (~5-10mins)
- Data Processing Deep Dive and Example Uses (~5-10mins)
- Lessons and Next Steps (~5 mins)
- Q and A (remaining)
Prerequisites:
Some experience in Python - pandas is desirable. Interest in Equity Markets useful.
Content URLs:
Blogs:
See above
Code:
- tickerplot-site
- tickerplot python package
- download utils
- data processing worker WIP - Very very early right now
Speaker Info:
- Founder @ hyphenOs.
- Interested in Networking (L2/L3) and latest developments in Software Defined Networking.
- Passionate about Capital Markets.
- 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.
- Hates trailing white spaces in code.