Weis Wave indicator code for Tradesignal

The Weis Wave indicator combines trend and volume information. It seems to be of some interest for timing short term market reversals. Here comes a version of this indicator for usage in Tradesignal.

The Weis Wave indicator for Tradesignal

The basic idea of the Weis Wave indicator is to sum up the traded volume, as long as the market moves in the same direction. The bullish volume wave is displayed in green. As soon as the market changes direction, a red wave is constructed. by comparing the magnitude of the Weis wave with the magnitude of the market move, valuable insights for short term market timing can be found.

More information can be found via a web search or from the page I got the idea form: https://weisonwyckoff.com/weis-wave/ Continue reading

Tradesignal Implied Volatility and IV Percentile Scanner

Implied volatility data is key in options trading. This article shows how to access free volatility data in the Tradesignal software suite.

Implied Volatility and IV Percentile

Thanks to https://www.optionstrategist.com/calculators/free-volatility-data  implied volatility and IV percentile data is available. For free on a weekly basis. Using this data and the given code the data can be loaded into Tradesignal. This enables you to do your custom market scans, combining Tradesignal technical analysis and the implied volatility data from the optionstrategist website.

Free implied volatility data

The first step to use the optionstrategist data would be to safe it into a text file. Just copy and paste the data, no additional formatting is required. The free data on the website is updated every Continue reading

IV Percentile – when to sell volatility

Volatility trading: when to buy and when to sell volatility

You got to know when to hold ’em,
Know when to fold ’em,
Know when to walk away,
And know when to run.
(Kenny Rogers)

When to sell implied volatility

Volatility is a nicely reverting time series. If it is high chances are good that it will come down again. The only problem is to find out when volatility is high, and when it is low. Unfortunately there are no absolute levels, you can’t say that 50% implied volatility is high, as this specific stock might have an implied volatility of 80% most of the time. So you can only compare the current volatility level to historic levels and so define if volatility is currently high or low. Continue reading

The Hindenburg Omen – Stock Market Crash Ahead?

The Hindenburg Omen is an indicator which is believed to forecast market crashes. Unfortunately it does not work, but the idea behind this indicator is worth to be discussed.

Market Breadth – Hindenburg Omen

The Hindenburg Omen is a market breadth indicator. It describes how correlated stocks are within a market behave.

I already had a market breadth indicator in this blog a long time ago, the percentage of stocks within a market above the 200 day average. The Hindenburg Omen does not use moving averages, it is based on the number of new highs and lows in the market.

Hindenburg Omen: idea and calculation

To get a warning signal for an upcoming stock market crash the Hindenburg Omen indicator observes the number of stocks making new 54 week highs and the number of stocks making 54 week lows. In a strong bull market you will usually see a lot of new highs but hardly any new lows, in a bear market you will see new lows, but no new highs. Continue reading

Implied vs. Realized Volatility for NASDAQ100 stocks

(1) You shall only trade when the chances are on your side

Comparing implied and realised volatility

Selling volatility can be a profitable game, but only if you sold a higher volatility than the market realises later on. Comparing realised and current implied volatility gives you an idea if the chances are on your side.

We already had a look at realised volatility and what the fair price for a straddle might be. Have a look at the kvolfair bet articles. These articles present a way to calculate the historically correct price for a straddle. Whenever you sell a straddle (to sell volatility), implied volatility should be higher than the fair bet price. Only then you will win on a statistical basis. Also have a look at the statistics of VIX, to get a clue when a downturn in volatility can be expected. Continue reading

Distribution of Returns

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

Distribution of Returns

Analysing 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 visualisation 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 behaviour on a statistical basis? An approaching visualisation of the statistical probabilities are the best way to understand market behaviour and find your chances in trading. Continue reading

Bet on Bollinger

Ever since John Bollinger introduced his Bollinger Bands in the early 1980s the bands have been a favourite indicator to all technical trades. This article is about the prediction capabilities of Bollinger bands.It researches the Bollinger breakout probability.

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 the market has got relative to today’s Bollinger band? What impact has overall volatility on these statistics? These questions will be answered below.

Bollinger Bands Breakout Probability

By definition of the indicator most of of the times the market will trade inside the Bollinger band. But this is only of minor interest to me. As a trader I am more interested on what will happen in a few days from now. Where will the future market be? Shall I bet on a breakout or sell a straddle?

So I did some tests 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. Then I analysed the positioning of the market in 20 days form now to see if Bollinger bands can be of any help with these questions. Continue reading

Scanning for Support and Resistance Probabilities

I have been in search for a signal I could use for a short vertical spread or naked short option strategy. So my main concern has been to find a level, which will most probably not be penetrated over the next few bars.

This is what I came up with.

Algorithmic RSI Support and Resistance Levels

We are all familiar with oscillators like the RSI indicator. It gives an idea if the market is oversold or overbought. Continue reading

Backtesting Market Volatility

If you want to trade 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. This article is about a back test of volatility.

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. Continue reading

Demystifying the 200 day average

The 200 day average is considered as a key indicator in everyday technical analysis. It tells us if markets are bullish or bearish. But can this claim be proved statistically, or is it just an urban legend handed down from one generation of technical analysts to the next? Let’s find out and demystify the 200 day moving average.

The 200 day moving average

Continue reading

Google EOD csv stock price data download

Sometimes my data provider has not got the data I am looking for. Searching for downloadable csv data I recently came across google spreadsheets. It provides an easy way to get historical stock price data. Save it as csv and use it with your Tradesignal.

The only thing you will have to do is to open a google spreadsheet in your browser, add a formula as shown in one cell and the data will be pulled. Copy&Paste the data to another spreadsheet and save it as csv. Continue reading

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.

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 K-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. Continue reading

A graphical approach to indicator testing

A graphical approach to indicator testing

The first step in algorithmic strategy design usually is to find some indicators which give you an edge and tell you something about tomorrow’s market behaviour. You could use a lot of statistics to describe this edge, but I like to take a graphical approach in indicator testing first, and only later on worry about the maths and statistics.

Scatter Charts

Continue reading

Using Autocorrelation for phase detection

Autocorrelation is the correlation of the market with a delayed copy of itself. Usually calculated for a one day time-shift, it is a valuable indicator of the trendiness of the market.

If today is up and tomorrow is also up this would constitute a positive autocorrelation. If tomorrows market move is always in the opposite of today’s direction, the autocorrelation would be negative.

Autocorrelation and trendiness of markets

If autocorrelation is high it just means that yesterdays market direction is basically today’s market direction. And if the market has got the same direction every day we can call it a trend. The opposite would be true in a sideway market. Without an existing trend today’s direction will most probably not be tomorrows direction, thus we can speak about a sideway market.

Autocorrelation in German Power

But best to have a look at a chart. It shows a backward adjusted daily time series of German Power.

The indicator shows the close to close autocorrelation coefficient, calculated over 250 days. You will notice that it is always fluctuating around the zero line, never reaching +1 or -1, but let`s see if we can design a profitable trading strategy even with this little bit of autocorrelation.

The direction of autocorrelation

Waiting for an autocorrelation of +1 would be useless. There will never be the perfect trend in real world data. My working hypothesis is, that a rising autocorrelation means that the market is getting trendy, thus a rising autocorrelation would be the perfect environment for a trend following strategy. But first we have to define the direction of the autocorrelation:

To define the direction of the autocorrelation I am using my digital stochastic indicator, calculated over half of the period I calculated the autocorrelation. Digital stochastic has the big advantage that it is a quite smooth indicator without a lot of lag, thus making it easy to define its direction. The definition of a trending environment would just be: Trending market if digital stochastic is above it`s yesterdays value.

Putting autocorrelation phase detection to a test

The most simple trend following strategy I can think about is a moving average crossover strategy. It never works in reality, simply as markets are not trending all the time. But combined with the autocorrelation phase detection, it might have an edge.

Wooha! That`s pretty cool for such a simple strategy. It is trading (long/short) if the market is trending, but does nothing if the market is in a sideway phase. Exactly what I like when using a trend following strategy.

To compare it with the original moving average crossover strategy, the one without the autocorrelation phase detection, you will see the advantage of the autocorrelation phase filter immediately: The equity line is way more volatile than the filtered one and you got lots of drawdowns when the market is sideways.

Stability of parameters

German power has been a quite trendy market over the last years, that`s why even the unfiltered version of this simple trend following strategy shows a positive result, but let`s have a test on the period of the moving average.

Therefore I calculated the return on account of both strategies, the unfiltered and the autocorrelation filtered, for moving average lengths from 3 to 75 days.

Return on account (ROA) =100 if your max drawdown is as big as your return.

The left chart shows the autocorrelation filtered ROA, the right side the straight ahead moving average crossover strategy. You don`t have to be a genius to see the advantage of the autocorrelation filter. Whatever length of moving average you select, you will get a positive result. This stability of parameters can not be seen with the unfiltered strategy.

Autocorrelation conclusion:

Trend following strategies are easy to trade, but only make sense when the market is trending. As shown with the tests above, autocorrelation seems to be a nice way to find out if the market is in the right phase to apply a trend following strategy.