Distribution of Probability

“Tomorrow never happens. It’s all the same fucking day, man. ”  Janis Joplin

Probability distribution

Analyzing history and hoping it will somehow repeat itself  is the big hope of all quantitative traders. This article is about the distribution of market returns, but not about normal distribution, Gauss and standard deviation. This article is about the visualization of market returns and what can be learned from it.

Probability distribution diagrams show the probability of a specific outcome. How likely is it that the market will be at a specific price sometimes in the future?  How does a specific bullish or bearish indicator signal affect the future market behavior on a statistical basis?

Distribution of returns

The chart below shows the distribution of returns of the American Express stock.

The probability of a specif future return is coded in shades of grey. The darker the distribution diagram, the higher the probability that the market will be there in the future. To generate this kind of chart all 1 to 50 day returns over the last 10 years have been analysed. A 50 day projection of returns is shown.

When changing the contrast settings of the distribution indicator, one gets a better impression on how likely specific events will be. As there are only 255 types of grey from white to black, a multiplication of the density by a contrast setting will overexpose the likely events. Everything that is not black, is very unlikely to happen.

As you can see, the shape of he probability distribution is something different than a normal distribution; and  the shape of the distribution will differ largely from market to market. This is the representation if different, inherent attributes of each market. The distribution of a Nasdaq will look different than that of EURUSD. To see these differences in the distribution helps when designing custom trading strategies, price targets and option prices.

The next chart is a returns projection for the VXX volatility ETF. We already had an article regarding the volatility of VIX ;this indicator offers a more intuitive representation of future returns than the classic distribution diagrams used back then. Data since 2011 has been used to generate this projection for the next 100 days.

 

Signal response and returns distribution

That different markets behave differently is nothing new to the experienced trader, this indicator just helps to visualize this fact.

An interesting usage of this distribution indicator is to analyze the behavior of the market after a specific signal has occurred. The chart below shows the answer of the yearly German power contract to a simple trend following signal. The loop shows the distribution of German power trading returns after a bullish-neutral-bearish signal. Significant differences between the expected returns after these 3 signals can be observed. These differences will finally lead to a trading strategy tailored to the specific signal-market response.

Also have a look at Demystifying the 200 day average for further ideas on how to analyze the quality of signals.

A picture says more than a thousand words..

Sorry Janis, it seems it`s not always the same f****** day…

 

Tradesignal Equilla indicator code

Continue reading

Bet on Bollinger

Ever since John Bollinger introduced his Bollinger Bands in the early 1980s they have been a favourite indicator to all technical trades. This article is about the probabilities of Bollinger bands.

How good are the chances to be outside or inside of the bands in the future? How do these probabilities relate to the current position of the market relative to the Bollinger bands? What impact has overall volatility on these statistics? These questions will be answered.

Bollinger Forward Prediction

By definition of the indicator most of of the times the market will trade inside the Bollinger band. But what happens in the future? Where will the market be in some days from now. These are the questions which interest me from a truing point of view.

So I did some test on the forward prediction qualities of the Bollinger band indicator. For all tests I used the 20 day, 2 standard deviations setting, which is the standard setting for most charting packages. I then looked at the positioning of the market 20 days after relative to its current Bollinger band.

 

The first test was done on the S&P500 index, using data since 1983. The indicator shown on the screenshot below gives the probability of the market being outside today’s Bollinger band in 20 days from now.

The red line is the probability of being outside todays band if we are already out of the band today.  The green line shows the probability of being outside of today’s band in 20 days from now if we are trading inside of the band today.

The outside starters being outside the band in the future more likely than the inside starters, is most probably due to the trend lines of the market. Once a break is done there is a high probability it either vigorously reverses or that it carries on. Both events lead to an outside of today’s Bollinger band event.

100%-outside probability is the probability to be inside todays band in 20 days from now. It is less than 50%, regardless of today’s market relative to the band.

Stability of results

Continue reading

Backtesting Market Volatility

If you want to predict volatility, you can place a bet on the option market. Just buy an at the money put and call, and at expiry day you will either win or lose, depending on the actual market move since you bought the straddle and the price you paid for the straddle. To put it simple, if the market moves more than you paid for the two options you will win, otherwise you will lose.

The fair price for volatility

When I look at the S&P500 I could buy or short a straddle with 16 business days until expiry right now for around 70$. That’s the implied volatility.

When I look at the standard deviation of 16 day returns, using the last 30 days to calculate it, it shows me a volatility of around 30$. That’s historical volatility.

When I use my own fair bet KVOL Volatility, it gives me a volatility of about 50$

Now I got three measures for volatility, but which one is the best prediction for future market volatility? And how big will the error (=wins and losses) be if we place this bet over and over again?

Backtesting volatility

Placing an perpetual bet on future volatility using the payback profile of a short straddle will give me an idea on how good historical volatility and Kahler’s volatility was able to predict future volatility. In a perfect world this virtual test strategy should be zero sum game; if not, future volatility is either over or underestimated by these 2 indicators.

If I know which indicator gives me the best volatility assumption, I can use this information to find out, if the current implied volatility of the market is too high or too low. Sell high, buy low…

The chart above gives you an idea on how I did the backtest. I place a weekly bet on volatility, based on a short straddle trade. So if I close outside the of the projected volatility, I have a loss. If the market closes inside the projection, I win. The maximum win will be the price of the volatility indicator at the beginning of the bet, the max loss is the point move within the week minus the price I got for volatility at the beginning of the bet.

Continue reading

Demystifying the 200 day average

The 200 day average is usually considered as a key indicator to tell if markets are bullish or bearish. But can this be proved statistically, or is it just an urban legend handed down from one generation to the next?

Let’s do some studies and find out.

The 200 day moving average

Looking at the chart of the S&P500 index and it’s 200 day average let’s me think that the 200 day average is actually a useful indicator to separate the bull and bear phases of the market. But the eye tends to see what the brain is looking for, so you might have focused on the crash 2008 and the bull market afterwards, but have ignored all these little breaches below the 200 day moving average which happened in between. As a trader I can`t make any money with knowing that there has been a long period under the 200 day average, i need to make my decision as soon as the market drops below the 200 day average.

Distribution of returns above and below the 200 day moving average

The chart above (on the right side) shows the returns distribution of 10 day returns. The green distribution represents the 10 day returns if S&P500 is trading above it`s 200 day moving average, the red line represents the 10 day returns returns when the market is trading below its 200 day moving average. Data from 1980 up to now has been used.

What are the curves telling us?

Continue reading

Money for nothing

We already had a post regarding the mean reverting tendency 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.

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.

Continue reading

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,  returns distribution indicator for tradesignal code

 

Kahler’s fair bet volatility

Volatility is a measure of risk. It describes how far a commodity will most probably move within a given period of time. The most common measure for volatility is historical volatility. But I do not like the complicated formula for standard deviation.

There has to be a better way to explain and calculate volatility….

Implied Volatility

The options market has got a perfect measure for volatility. Done without formulas, just by demand and supply. And as I believe in efficient markets, the option markets fair price for volatility will be my starting point.

To get the price for volatility at the option market you just have to place  a bet. Assume you want to know the (expected) volatility for the next 30 days, then you would just add the price for an at the money put and call with 30 days to expiry. Option traders call this bet a straddle, and you would win if the market moves more than the price you have payed for the (european style) put and call.

The fair price for a volatility bet

Implied volatility and this Straddle bet is the starting point to calculate my own volatility measure.

The fair price for this bet is, when neither the buyer nor the seller of the bet has got an advantage. In the long run it should be a zero sum game game for both of them. Calculating the fair bet price for a straddle is the idea behind my volatility measure.

Think about a simple coin flip game. If you bet on head you can either win 1€ if head is up or nothing if tail comes on top. What would be the fair price for such a bet?

As head and tail got the same probability, the expected return of a bet on head’s up would be 0.5€. If I would sell you a bet on the next coin flip, I would charge you this 0.5€ to make it a fair bet. So you would either lose the 0.5€ if tail’s up, or win 1€ -0.5€ if head’s up. In the long run this would be a zero sum game for both of us. Do the same thing for the tail is up bet. It also got a value of 0.5€.

Historical Volatility vs. Kahler’s Volatility:

Historical volatility uses standard deviation of daily log returns to describe the volatility of the market. The standard deviation of this +1 -1 coin flip experiment would be 1€. The same would be true if you would buy a head’s up and a tail’s up bet; it would also cost you 1€. So for this simple example the fair bet based volatility is the same as the historical volatility.

But the market is not a coin flip. There will be some differences between historical volatility and KVOL fair bet based volatility.

KVOL vs. historical volatility:

The chart shows you a comparison between KVOL (blue) and historical volatility (standard deviation). On the chart shown above both calculate the volatility for 10 day returns, using the previous 30 bars as data sample.

As you can see historical volatility and KVOL are highly correlated.

But there are some major differences:

As an example in the end of 2017/beginning of 2018 KVOL starts to rise as the market is exploding to the upside. This is due to the virtual call used to calculate KVOL gains value. At the same time historical volatility stays low, as the market has got one direction and no setbacks.

Another advantage of KVOL is it`s response to singular events. As you can see on Sept. 3rd on the chart above the singular big red candle leads to a spike in historical volatility. It also raises KVOL, but not as much. As both indicators are calculated over the same period of bars they both got the same speed of change, but when you have a look at the scale you will see the advantage of KVOL: Historical volatility jumps from 0.2 to over 0.5 – it more than doubles just because of a single event. KVOL also raises,but only from 0.2 to 0.3.

For me this mild response to to singular events is the main advantage. Imagine a portfolio based on value at risk – would it really be useful to half the exposure just because historical volatility jumps after a single red candle?

KVOL  – Tradesignal Equilla Code:

The code to calculate KVOL is simple and straightforward.

The inputs:

multi: just a multiplier, like you can display 1 or 2 standard deviations..

datapoints: The number of bars used to calculate KVOL

returnperiod: calculate the volatility for 1,2,3… bars

showresult: show the result as a percentage of the underlying or as an absolute number

show: show either kvol or the rank of  kvol within the last 100 bars. This gives an idea if volatility is high or low

Meta: subchart(true);
Inputs: multi(1.0), Datapoints(30), returnperiod(5), showresult(percent, absolute), show(result,rank);
Variables:Kvol, i, rp,rc, rpsum, rcsum, call, put, hh,ll;

rpsum=0;
rcsum=0;

for i =0 to datapoints-1 begin // loop over last bars
  rc=maxlist((close[i]-close[i+returnperiod])/close[i+returnperiod],0); // % return of call
  rp=maxlist((close[i+returnperiod]-close[i])/close[i+returnperiod],0); // % return of put
  rcsum=rcsum+rc; // sum of all %returns over time
  rpsum=rpsum+rp;
end;
      
call=rcsum/datapoints;
put=rpsum/datapoints;

Kvol=call+put;	
if show=result then drawline(multi*iff(showresult=percent,100*Kvol,Kvol*close),"KVOL");

hh=highest(kvol,100);
ll=lowest(kvol,100);
if show=rank and (hh-ll)>0 then drawline(100-100*(hh-kvol)/(hh-ll),"rank");

 

keep researching…