Went Long on the S&P 500

Finally my system got beaten enough on the short side to realize that this is a losing proposition at this point of time. I flipped my position on the SPY from short to long at today’s close. This has been one of the worst experiences (more than a year of trading now) with this system – a relentless push in the opposite (long) direction. Markets always have something new in store for everyone – they tend to teach humility to everyone who has been around for a while.

Went Short on the S&P 500

Time to change position again. Interestingly enough, I got short signals from some other indicators which I follow. Is the market about to turn, or about to make me suffer? 🙂

Difficulties Resolved – Back in the Market

Trading is random. After fixing the technical problems yesterday, the overnight computations went fine, and I had the “correct” (according to my systems) positions for the day. So what did I do? Around 10:20 today I finally got some free time and I put limit orders below the market close of yesterday. The market was in a pullback, in other words, I managed to get into my desired positions with a better prices.

Trading is random – let’s see how the day ends and whether it was worth it. Just kidding. If nothing else, my actions improved the in-life performance vs the theoretical equity curve of the system. Big deal!

Technical Difficulties – Exiting the Markets

That’s what happens when the computational server is not in the cloud. I noticed that the web site hasn’t been updated today (some content is refreshed daily, some of it is hidden) and I tracked the problem to some sort of failure in the computational server. As a result, I have no idea if I need to adjust my positions or not. Hence, I closed all positions in my trading account at the today’s close. Not an easy thing to do when my gut feeling is that the upside move is still intact (and I was 100% long at this point). A good lesson in discipline.

Went Long on the S&P 500

The short position was quite profitable, but now my system is seeing higher chances of an upside move. Accordingly, I reversed my position from short to long at the today’s close. Still using leverage of 1.5 – this only changes when volatility picks up significantly.

Went Short on the S&P 500

The S&P 500 exploded on the upside over the last few day, which forced my mean reversion strategy to switch to a short position at the close today. The leverage is 1.5.

On-Close Trading with LOC & MOC Orders

In a previous post I discussed how to implement in real trading a strategy back-tested on the close (the signal is generated on the close and the trading is performed on the close too). The main tool was pre-computing what I call tables of actions. In my opinion, the complexity of implementing a strategy in real trading depends on the types of tables of actions the strategy generates, and in this post I am going to show you a system which can be implemented using only the two on-close orders provided by Interactive Brokers and other retail brokerages.

Read More

Went Long on the S&P 500

At the close today, I flipped my position in the S&P 500 (SPY) from short to long. Using the usual leverage of 1.5.

Automatic ARMA/GARCH selection in parallel

In the original ARMA/GARCH post I outlined the implementation of the garchSearch function. There have been a few requests for the code so … here it is. Quite easy to use too:

library(quantmod)
source("garchAuto.R")

spy = getSymbols("SPY", auto.assign=FALSE)
rets = ROC(Cl(spy), na.pad=FALSE)
fit = garchAuto(rets, cores=8, trace=TRUE)

After the last code line above, fit contains the best (according to the AIC statistic) model, which is the return value of garchFit. The function has reasonable defaults, but also provides controls over various aspects of the model selection – check the code.

The function is called garchAuto, following the naming convention of the fGarch package. In fact, I am trying to get it into the fGarch package, but haven’t heard back yet. There are reasons why I don’t feel too optimistic about this happening, hence, my decision to publish it here.

Last, if you wonder why I abandoned the original garchSearch name, the reason is that a similar function from the forecast package is called auto.arima (“auto”, not “search”).