Money for nothing

We already had a post regarding the mean reverting behaviour of Volatility, now it`s time to make some money using this information.

Trading Volatility

The VIX volatility index on the chart above looks like an easy to trade instrument, just buy when it is around 10 and sell when it has doubled, tripled, quadrupled…

But unfortunately life is not that easy, VIX is just an index and you will not be able to buy or sell it. You might try to trade volatility using options, but there is a better plan to make money on this wonderful asset class, the VXX, BRCL BK IPTH S&P 500 VIX SH FTRS ETN.

VXX – the perfect money printing machine

The VXX is an ETN which tries to follow the vix on a short timescale buy having exposure to the first 2 VIX futures contracts. But like with commodities, where the further out contracts cost more money (a risk premium), this leads to severe losses in the long run. You buy expensive (far out) and then the premium melts away. This is a general problem of all ETFs which try to follow a physical market, and will be my edge in making money.

Like VXX also USO and UNG (physical Gas and Oil ETFs) are doomed to go to ZERO in the long run. Only reverse splits could hold them from reaching this target by now.

I am not up to track or trade the VIX on a short term basis, I am more interested in making money due to this structural bug build in in the methodology used to track the VIX. So for me VXX (similar to USO and UNG) is a long term short investment.

Having a look at a long term comparison between VIX and VXX will surely give you the same idea:

note the logarithmic scale for VXX!

No risk, no return

The above chart gives you the returns distribution of VXX over 5 -50 -250 trading days. On a yearly basis you hardly had any positive return, and the median loss (=win for shorties) would have been 47%. Even the 2-month 50 day return has got a median of -17%, with only a 20% chance of a positive return over this period of time. So the odds are clearly with you, the longer you hold, the more you gain.

On the other side, things are never that easy as they seem,  it would be suicide just to invest all your money in a VXX short trade.

Even when the odds are on your side, you will get a problem with risk. While VIX has the nasty tendency to quadruple from time to time, it even went from 10 to 90 in 2008, VXX as a short term tracker of VIX could also behave like this. Since 2013 when the instrument came into existence, there has been several incidents when VXX at least doubled on the short term. That would be the incident when your broker gives you a markin call or closes your position at the worst possible moment. To be on the safe side don`t invest more than 25% of your account into a VXX short trade!

VXX, USO, UNG – my short list for short trades

Your edge in trading VXX is not the trend down, but this fundamental problem in tracking the VIX index using the next two months futures contracts. The same problem which brings down the united states oil and gas fund USO und UNG. Like the VXX the returns distribution (50 and 250 days) gives a clear indication to trade these instruments only on the short side.

These returns distributions, caused by the the fundamental tracking problem of a futures market, make VXX, USO and UNG my private money printing machines. VXX is a clear “short and hold”, USO and UNG are a “short when strong” opportunity.

Research pays off!

 

 

 

Seasonal trouble ahead

If a bitchy prime minister and a crazy president weren’t enough, for the upcoming months the seasonal chart is also indicating further price setbacks.

Seasonality of DAX

Analyzing the average monthly performance of the German DAX index a distinct pattern of seasonality can be observed. On average June has been down 0.6%, but the big trouble is yet to come.

 

The chart shows the average monthly performance of the DAX index, using data since 1999.

Each bar of the histogram represents a specific months percent performance. Starting with the dark blue bar in January, the green bar right now represents the average June performance.

Seasonal  and Volatility Prognosis:

As you can see on the above chart June always has had a bearish prognosis over the last years. July might bring some relief (the positive magenta bar behind June), but therefore August and September surely got a strong bearish setup. Although the markets have been bullish over the last 20 years, the average combined performance of August and September is -4%.

The average performance of a month is not a good indication for the actual magnitude of the upcoming market move, it just is an indication for its direction.

Where the move might go you can see on the market neutral volatility prognosis. The shown prognosis is based on Kvolatility and uses the DAX returns since 1999 to calculate the average expected move for the next year.

Due to reasons I have got some trouble in hoping for a move to the upper boundary of the Kvolatility projection, but I surely will structure my trades to profit from a bearish move within the next few months.

Tradesignal Equilla Indicator code:

Continue reading

KVOL Volatility part 2

How to calculate volatility based on the expected return of a straddle strategy has been shown in part 1 of fair bet volatility KVOL.

Using and Displaying Volatility:

KVOL uses the given amount of historic returns to calculate an expected value of an at the money put and call option. The sum of these prices are the historic fair value for implied volatility. It can be used to compare current market implied volatility to historic fair values.

Beside calculating KVOL for a specific return period it can also be used to show it as a projection indicator on the chart.

The example on the chart gives such an expectation channel for the s&P500 at the beginning of each month. The 250 days before are used to calculate KVOL. The line underneath the chart is running KVOL for 13 trading days.

Simplified trading:

to win, with higher volatility expected: you would have bought a straddle at the beginning of the month, expiring at the end of the month. You should not have paid more than a KVOL for 25 bars (working days to expiry) would have suggested. You win if the chart is outside of the projection at the end of the month.

The shown example uses the 250 daily bars before  the beginning of the month to calculate the returns and the price of KVOL. The projected lines represent the winning boundaries of the straddle at expiry.

Comparing this to actual prices for a straddle you will notice…

… that current KVOL around 50 is higher than the given straddle price of 44.90. This might suggest that a long straddle is a better deal than a short straddle would be…

Statistics of VIX

The CBOE volatility index VIX  measures the market’s expectation of future volatility. It is the gauge of S&P500 equity market volatility.

The spikes to the top and the long phases of relatively low volatility are reflected in a left-leaning distribution diagram and a long tail towards the higher panic levels. The median value is 17%, meaning 50% of the prices are above (below) this level.

The next chart shows the distribution of returns over 25 trading days. The median price movement being slightly shifted to the negative area shows the mean reverting characteristics of volatility.

Analysing the level of VIX and the returns afterwards yields an even more interesting picture:

The green line gives the 25 bar percentage returns of VIX, with VIX noting above 25, the red line gives the returns with VIX below 15. Observe the median of the two lines:

The median 25 bar return with VIX above 25 (green) is around -15%, only 20% of the returns are positive. The return with vix below 15 (red) is above 0% and with a fat tail to positive returns. Data from 2004-2018

 

The above chart suggests that going short on volatility, if VIX is above 25, seems to be a good idea, the next chart shows what will most probably go wrong during the next 25 days. The distribution diagram gives the maximum adverse movement of the VIX.

The green line, VIX above 25, shows a +10% median maximum up movement over 25 days. So do not expect a short vola position to be without risk.

 

On the other side, the distribution of the maximum loss of the VIX during a 25 day period shows a median of below -20%.

 

Best to test for yourself, Tradesignal Equilla Code on request

 

Machine Learning – KNN using Tradesignal Equilla

I always thought that inspiration and experience is a key factor in trading. But everytime my chess computer beats me without any inspiration, just by brute force, I start to reconsider this assumption. This article will be about a brute force approach in trading.

Rule based trading

I have never been a great believer in classical technical analysis. If you ask 2 analysts about the current trend in the market, you get at least 3 answers. So I turned to algorithmic trading, using the tools of technical analysis in a new way, doing if..then conditions, backtesting them, refining the rules and parameters until the desired result was shown. These if..then based conditions, like if the market is above it`s 200 day line then go long, are mostly found by experience and inspiration. Isn’t my brain just a neural network which can be trained with historic data (experience), enhanced with a glass of wine for the inspiration?

Today I would like to take a voyage into machine learning. I would like to let my computer find the rules by itself, and just decide if I like the results or not. I’ll have the glass of wine with some friends and let the machine do the job; This sounds tempting to me, but can life really be as easy?

Unsupervised machine learning – kNN algorithm

The knn algorithm is one of the most simple machine learning algorithms. Learning might be the wrong label, in reality it is more of a classification algorithm. But first let’s see how it works.

The scatter chart above is a visualization of a two dimensional kNN data set. For this article I used a long term and a short term RSI. The dots represent the historic RSI values. Have a look at the fat circled point. It just means, that todays RSI1 has a value of 63, and RSI2 got a value of 70. Additionally the dots have got colours. A green dot means the market moved up on the following day, a red dot shows a falling market on the day after.

kNN – k nearest neighbours

To do a prediction of tomorrow’s market move, the kNN algorithm has a look at the historic data (shown on the scatter plot) and finds the k nearest neighbours of today’s RSI values. As you can see, our current fat point is surrounded by red dots. This means, that every time the 2 RSI values have been in this area, the market fell on the day after. That’s why today’s data point is classified as red. Call it classification or prediction, the kNN algorithm just has a look on what has happened in the past when the RSI indicators had a similar level. Have a look at this video, it is a great explanation on how the algorithm works.

kNN as Tradesignal Equilla Code

Computer kiddies would implement this algorithm in Python or R, but I would like to show you an implementation with the Tradesignal programming language Equilla. It is way faster than Python, and has got the advantage that I can directly see all the advantages and disadvantages on the chart. It is not just number crunching.

To implement the algorithm in Tradesignal we first have to do the shown scatter plot, but not graphically but store the 2 rsi values and the next days market move(colour of dots) into an array.

In line 8&9 the rsi values are calculated, line 12&13 calculates the next day`s market move. Line 15 to 20 then stores the data into the training data array. This is done for the first half of the data set, for my example I will use the data from bar 50 to 1000 on my chart of 2000 data points.

The next task to complete is to calculate the distances of today’s rsi point to all the historic points in the training data set.

Line 23 to 27 calculates the euclidean distance of today’s point to all historic points, line 29 then creates a sorted list of all these distances to find the k nearest historic data points in the training data set.

We are nearly done. The next step is just to find out what classification (colour) the nearest points have got and use this information to create a prediction for tomorrow. This is done in lines 33 to 35

Have a look at the scatter chart at the beginning. If this would be the data stored in our training data set, the prediction, using the 5 nearest neighbours, would be -5. All the 5 nearest neighbours of our current data point are red.

Now that we got a prediction for tomorrow, we just have to trade it:

kNN algorithm performance

Lets have a look if this simple machine learning algorithm works. Using 2000 days of backward adjusted brent data, I used a 14 and 28 day RSI to predict the next day move. The training was done on bar 50 to 1000, and I used the 5 nearest neighbours for the classification.

Knn algorithm – conclusion

Judging on the shown graph it seems to work. It seems to be possible to use these 2 RSI indicators to predict tomorrow’s brent move.

kNN algorithm gives me a framework to test all kind of indicators or even different data sets easily and see if they have got any predictive value.

This is definitely an addition to classical algorithmic trading, using if..then conditions build from experience and intuition.

But you might still need some intuition to find the right data sets, indicators and parameters to get a useful prediction. Not everything can be done by machine learning…

 

 

 

Position sizing – the easy way to great performance

Working on your position sizing algorithm is an easy way to pimp an existing trading strategy. Today we have a look at an energy trading strategy and how the position sizing can influence the performance of the strategy.

The screenshot shows you the returns of the same trading strategy, trading the same markets, the same time frames and using the same parameters. The returns on the left side look nice, making money every year. The returns on the right side are somehow shaky, and you would have to love volatility of returns if you would think about trading this basket. The only difference between the basket on the right and on the left side is the position sizing.

The energy basket:

The basket trades German power, base and peak (yearly, quarterly, monthly), coal, gas, emissions. All instruments are traded on a daily and weekly time frame chart, using the same parameters. If the daily trading uses a 10-period parameter, the weekly trading would use a 10-week parameter. This limits the degrees of freedom I have when doing the strategy-time frame-parameter merge, thus minimizing the curve fitting trap.

Continue reading

Sutton’s law: Go where the money is

There is an apocryphal story about the famous american bank robber and jail breaker William Sutton being asked why he was robbing banks. His genius answer was “That`s where the money is”.

There is a second famous quote of William Sutton, asked why he used a machine gun for robbing a bank: “You can’t rob a bank on charm and personality,” Both quotes come up to my mind when I am asked about the key things in trading.

Sutton’s law #1: Go where the money is

I am a trend follower, just because it is easier to do than picking tops or bottoms. Robbing a bank might not be a good idea, but going where the big money is, certainly is. Big money is invested over a long time, markets are just not liquid enough so that pension funds and other big players could switch their position every day, so once a trend, or call it bullish market environment, is established, chances are great that people come in, stay in and fuel the further movements. It becomes a self fulfilling prophecy. That`s where the money is, that`s where I can do my day-to-day small scale market robbery.

Sutton’s law #2: You can’t rob a bank on charm and personality

Sutton’s law #2 is my reason for being an algorithmic traders. The market basically is a fight of everybody against everybody, all weapons and tricks allowed (well, there have been some regulations introduced..) It would be suicide to risk your money on just your charm or personal beliefs. If there is big data available, use it. If you got an algorithmic trading software available, use it. If you lose, don`t blame the market, blame yourself for not being prepared.

Continue reading

Monthly Seasonal Performance of Stocks

Seasonality changes over time!

First have a look at a screenshot of one of my favorite website investopedia.com They have some nice articles about the seasonal performance of stocks and the effects in trading. But unfortunately the information is not precise, and therefore misleading.

The chart shown suggests that the average return for the S&P500 (index or stocks?) has been positive, except for September. Further down they speak about the January effect, suggesting an average positive performance of stocks in January.

Continue reading

EEX Phelix Base Yearly – Buy Wednesday, short Thursday?

When it comes to simple trading strategies, the day of the week is surely one of the best things to start with. That’s nothing new when it comes to equity markets. Everybody knows about the calendar effects, based on when the big funds get and invest their money. I do not know about any fundamental reason for the day-of-week effect in German power trading, but is seems to be a fruitful approach.

First of all I have to point out that it is not only the day of the week which is important. A strategy that just buys on Wednesdays and sells 1 or 2 days later would be doomed. But if you add a little filter which confirms the original idea, you will end up with a profitable trading strategy.

This filter will just be a confirmation of the expected move: If you suspect that Wednesday ignites a bullish movement, then wait until Thursday and only buy if the market exceeds Wednesdays high. Same for the short side, wait for a new low before you enter!

Have a look at the chart. The strategy shown buys on Thursdays if Wednesdays high is exceeded. The position is closed 2 days after the entry.

If you run a simple test which day of the week is the best to get ready for a long trade the day after then the next chart shows the return on account of the strategy using data from 2012 up to now: (exit one day after entry)

Continue reading

Bitcoin – end of the bullish bubble

Bitcoin has come a long way but now it is time to say good bye.

Being a trend following trader on the long side, the chart right now suggest anything else but a trend following long strategy. It might all look completely different in a few weeks or months, but right now the bitcoin market is done. The ichimoku scanner indicator still shows 100% bullish, but have a look at the history and the formed indicator-market patterns:  As marked on the chart we can see a nice bearish divergence. This is not a long entry signal!

 

Lower highs, lower lows; goodbye bitcoin, loved to trade you, but with a bearish behavior like now you are not my friend any more.

Continue reading