The Weekly

My system finally signalled a switch to a short from the long position on the S&P 500 (on the SPY ETF more precisely) held since Oct 23rd. Despite of the long duration, the position finished virtually at 0.

That’s in theory, in practice, things didn’t go so well. At the Wednesday close, I decided to close my trading positions so that I don’t have to deal with the short trading day on Friday (markets closing at 1) and to avoid being exposed to the long time off. As a result, I missed the 1.35% rally today, and for me, the position resulted in a loss of about 2% accounting for leverage.

Most likely I will be establishing my short on Monday’s close. Psychologically that’s a pretty tough position to take, since December is usually bullish. As always, only the future will tell.

The indicators on the S&P 500 page seems to suggest that a short position is not a bad idea, but for Monday, not for Tuesday. While the monthly moving averages as well the 200-day moving average are suggesting long, everything else suggests a short. Probably worth looking into a short on the futures market, hmm, that got me thinking.:)

Parallelized Back Testing

As mentioned earlier, currently I am playing with trading strategies based on Support Vector Machines. At a high level, the approach is quite similar to what I have implemented for my ARMA+GARCH strategy. Briefly, the simulation goes as follows: we step through the series one period (day, week, etc) at a time. For each period, we use history of pre-defined length to determine the best model parameters. Then, using these parameters, we forecast the next period.

Read More

The Weekly

No trades this week, but some interesting developments took place. The SPY lost 2.4% for the week. These down moves were sufficient to take the S&P 500 below its 200-day moving average as of the Thursday’s close. Last time this happened was in June, back then the S&P 500 stayed below its 200-day moving average for only two days.

On Friday, another moving average got broken – the 20-week. Currently only the monthly long term moving averages are intact, but let’s not forget that they are updated only on a monthly basis.

All in all, technical trend indicators are starting to confirm this down move and whoever is taking investment decisions based on some of them should strongly consider exiting the market. The SPY has lost only 6% so far from its 2012 peak, so there is a long way to go if this turns to be a significant correction, let’s forget a bear market.

Back-testing Rules

Nowadays there are many trading strategies shared online with reproducible, decent, results. Have you asked yourself, if the strategies are so profitable, why the author bother even sharing them, when the path to riches is clear – just implement the strategy and use it?

There are people, of course, who are fascinated and challenged by the market mechanics and for them coming up with a theoretical result how to beat the market is all that they are looking for. A quick “fix” it is, but that’s not the entire story.

Read More

Unstable parallel simulation, or after finishing testing, test some more

Lately I have been working on a trading system based on Support Vector Machine (SVM) regression (and yes, if you wonder, there are a few posts planned to share the results). In this post however I want to share an interesting problem I had to deal with.

Few days ago, I started running simulations using my latest code over years of historic data. Everything seemed to work fine, and the results looked promising. Experience has thought me that there is nothing like too much testing when it comes to trading strategy simulations, in other words, when your money is on the line. So, I decided to run one more test, which I usually do – to confirm that simulations with the same parameters, produce the same indicator.

Read More

The Monthly

S&P 500 (and many other markets) finished the month of October in the red, down 1.8%. This downturn took the index within striking distance of its 10-month moving average, but wasn’t sufficient to penetrate it. Still, another 1.78% in November and the index will close below the 10-month moving average.

The Weekly

Another trade during this week, and again a winning one. A two day short position opened on Oct 19th and closed on Oct 23th, two trading days in total, 1.37% gain without leverage, about 2% with the leverage. Not bad at all. The long position opened on Oct 23th doesn’t look so good though.

The recent pull back in markets has brought the S&P 500 close to its long term moving averages. The 50-day is already broken, and the index is only about 2.5% above its 200-day moving average. This coming week is the end of the month, the time for an update on the 10- and 12-month moving averages. According to my computations, for the 10-month moving average to be broken, the S&P 500 (SPY) has to close below $137.72 on Wednesday. That’s more than 2% away from the Friday’s close, but certainly not out of reach.

A Greedy ARMA/GARCH Model Selection

An idea that I have been toying for a while, has been to study the effect of a domain-specific optimization strategy in the ARMA+GARCH models. If you recall from this long tutorial, the implemented approach cycles through all models within a the specified ranges for the parameters and chooses the best model based on the AIC statistic. One idea which I have studied recently is to try to improve the model selection by using a different criteria to determine the “best” model, namely to use a domain-specific strategy.

Here is where greed enters the picture: Since our domain is finance, and they claim greed is good. What if we choose the model which has best performance in-sample?

Read More

Long the S&P 500

Lately, my S&P 500 system doesn’t want to stay short for too long. Switched from short to long at the close today, using a position size of about 1.5.

The Weekly

Friday was interesting – it was the first big down day in a while. The S&P 500 lost 1.67%. As the press reported, the last bigger drop in the S&P 500 was on June 21. The S&P 500 shed 2.23% on that day, but this was long time ago.

Since I am using both long and shorts (a big positive day could be as damaging as a big negative one) on the S&P 500, there is another piece of information which I am more interested: how far ago was the last bigger daily (positive or negative) return. The last bigger absolute daily return was on Sep 6, when the S&P 500 advanced 2.04%. This was also quite some time ago.

At the end, a single daily spike is nothing more but a good news material. What matters in practice is volatility and it’s yet to be seen whether it will pick up or not.

Back to trading. On the close of Friday, I switched from long to short on the S&P 500. This long was established on Oct 11 and was worth … 0%. In other words, all the gains evaporated during the Friday’s massacre. Nothing to worry though, we have seen worse, much worse. 🙂