I’m always looking for ways to cut down on the time I spend on my daily trading routine. Many of my various trading tasks are performed much better by a computer. In my experience, if there’s some task that you do that can be safely performed by a computer, then I believe it’s worth a one-time chunk of your time figuring out how to automate it. I’ve spent sometimes a few hours automating a task that only takes me a few seconds to do manually. There are many benefits to doing this:
- Removes the chance for human error
- Saves your time so you can do something more meaningful (this adds up over time)
- Forces you to take a hard look at your task – often you’ll figure out a better way to do it
- Sense of accomplishment
I’ve automated a few of my tasks, but most recently I’ve automated the creation of my morning gap list. Here’s the way I used to generate it:
- Use Trade-Ideas Pro to create 3 long alert windows and 3 short alert windows
- Bring up Trade-Ideas Pro just before the market open and just let it run
- At 10:00AM, export the history of each alert window to a csv file
- Run a script that knows the file names of my export files, reads them, and spits out a unique list of symbols
- Import them into CyberTrader
For many weeks I performed the steps above and thought it was pretty efficient. It worked well and trading life was good. But over time, as I did these steps over and over I realized there should be a way to automate the entire process. Sometimes I was distracted at 10AM and couldn’t perform the steps until a little later, putting me in “catch-up” mode when I did get around to it.
I sent David from Trade-Ideas a note asking if, perhaps, keyboard shortcuts could be added to Trade-Ideas Pro for the history export function in each window. He added it to the list of feature requests, but also pointed me to the Trade-Ideas API. After browsing the docs for a while, I realized it was possible to automate much of my 10AM routine.
I set out to create an app that uses the Trade-Ideas API to automatically generate my watchlist. I set a timer in the app which automatically creates a CyberTrader stocklist file that is easily imported into my trading platform. That timer fires first at 10AM. Every half hour for the rest of the trading day it fires again but creates a separate stocklist file that contains new symbols that have appeared since 10AM. This allows me to optionally look through an additional list during the day if there seems to be a relatively small number of stocks that initially fit my criteria after the 10AM run.
As I started coding the app, I realized this was also an opportunity to implement some features that Trade-Ideas Pro lacked that I thought would help me out. I created counters on each of the windows that show the number of alerts generated so far and a count of unique stocks that have produced those alerts. Also, I added some sound support for the alerts much like TI Pro, but with an important twist: the sounds only play when a symbol appears in the alert window for the first time. If you’re using the Percent Up Alert, for example, one stock could produce many of those alerts during the day – if it’s not something you’re going to trade do you want it playing a sound each time it comes up in an alert window? I didn’t. I want to be alerted only if there’s a new symbol in the window since it’s likely I’ve already looked at any symbol that’s appeared previously.
Here’s a screencast showing the app I created. Comments and suggestions welcome!