So I finally got around to dabbling with the innards of my program over the past couple of weeks. One major update I made was incorporating trailing stop-loss actions, rather than simple stop-loss. It has a little bit of customization, something I’ve been doing manually with my real purchases, where I’ll set a standard stop-loss upon buying a stock, and then if it goes up to a certain point, usually 2-3%, I’ll replace that stop-loss with a trailing stop, and let it ride. I’m overall happy with this method, I have left money on the table a few times but it does add some automation to my process and takes away some of the stress of checking on my stocks throughout the day.
An even larger update I’ve made is adding a little bit of code that does some very rudimentary analysis of the Dow and NASDAQ, by checking the DIA and QQQ index funds, respectively. It checks on the general direction those funds are moving in and then adjusts the scoring for the trades on individual stocks based on what the overall market is doing. For example, if my program is analyzing Home Depot (HD), which trades on the NYSE, it’ll look at how DIA (Dow Jones) is doing; if DIA is trending upward, it’s more likely to take a positive action on HD. If it’s looking at Apple (AAPL), the QQQ index weighs in since Apple trades on NASDAQ. Depending on this works out in real world trades, I’ll be looking into incorporating market-specific index funds for NYSE and AMEX (if any). I’d like to incorporate S&P but since that’s not a market, it may require some retooling of my database, creating a new pseudo table my program can reference to know which stocks to pull for the S&P 500.
This will hopefully let me segue eventually into an idea I’ve been struggling to integrate, that of creating fake index funds to track individual sectors (Real Estate, Financial, etc.) so that I can use the above concept but more fine-tuned (there’s little correlation, for example, between large corporations found in the Dow Jones like HD or AAPL and, say, a copper mining operation). What’s been holding me back in that area is the complete lack of free (API-based) resources that detail which industry and/or sector each stock belongs in (not to mention what free resources there are don’t seem to agree on this information, i.e. Yahoo! Finance and Bloomberg will sometimes give me different sectors for the same stock). I’d have to manually look up every single stock and manually add the information to my database, to integrate this idea… and that’s just not something I want to do (nor have the time for, really).
One other idea I want to incorporate is the use of stock volumes. Increase/decrease in volume, reversals and exhaustions, etc., can hopefully help my program make more informed decisions. The updates mentioned above have yielded interesting results in the backtesting I’ve done so far, success rate has improved as has return per trade, although it’s trading a lot more than I’d like (sometimes multiple times in a week). I had hoped these new integrations would reduce the amount of trading but has actually increased it, so I’m hoping integrating volume analysis will help things out in that regard as well.