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?
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!
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.
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.
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.
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.
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.
Flipped the position at the Monday’s close. The leverage is 1.5.
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”).
Flipped my position in the S&P 500 (SPY) from short to long at the today’s close. The leverage is still 1.5.