So I've written several posts about this all over the place but I keep getting questions and PM's so it makes more sense for this to have its own thread.
First, I need to tell you that while I have no problem sharing a great deal, I am not going to share everything. Trading is my livelihood, so obviously some of this is proprietary since we are talking about automated trading.
After years of "lessons learned" by using all the various platforms out there to try and develop, analyze, execute and track systems, I finally came to the conclusion that I need to invest the time into just creating my own custom "platform" that does exactly what I need to do.
My tools are:
- R
- Python
- MySQL
I am using:
- InteractiveBrokers API
- IQFeed API
Up until a month ago I had never written a single line of code in R, in fact I installed it for the first time the first week of November. But I've been programming for over 20 years so picking it up didn't take too long.
Over the last month I've written a few thousand lines of code in around 100 or so functions. What I targeted first was:
- Connectivity to IQFeed
- Connectivity to IB
- Storage backend, column definition
- Automation of routine tasks
I am happy to report everything is working. My database is about 5,000 tickers of daily and minute data, and about 250-500 of tick data (I am still deciding on this), and a dozen or so of L2 depth data (still deciding on this).
At the EOD of each session, I pull all the historical data down for the last 5 days and refresh. This all goes into a MySQL db. I compute a lot of columns for a database I call "meta" which is where I have one row per symbol that gives me the "at a glance" info for that symbol. Things like closing price, fundamentals, avg daily/weekly/monthly volumes, rate of change columns, common moving averages, vwap's, VPOC's and all that good stuff. I also calculate relative volume which is very important (see below), as well as relative sector performance.
Real-time scanning takes place throughout the session. IQFeed has a symbol limit of 1,800 for real-time per client. The idea is quite simple, I need to have tickers on the radar to know what to trade. Trades vary from day trades to swing trades, so obviously some tickers don't change often, while others do.
The real-time scan is primarily looking for "events" or "patterns". Using the relative volume mechanism, I have a volume breakdown by hour of day. So let's say the 4AM pre-market normally sees 1,000 shares traded, but today it's 4:05AM and we're already at 5,000 shares. Obviously something going on, so goes on the short list. Just an example.
Next of course is analysis. This is everything to do with risk and probably what I won't go into too much detail on here.
Then of course is the actual execution, which I am using IB for. This also covers the real-time monitoring of the portfolio.
Last is reporting.
Anyway, I'll post some stuff here and there and try to answer questions. Let me know if it is useful.