Monday, February 19, 2018

Crypto Rotation Model

In a previous post I published results of an analysis I performed on oversold technical oscillators.  I ran this test on the historical data for the stocks in the Dow 30, S&P 100, and Nasdaq 100 (corrected for survivorship bias).  I computed an Indicator Edge Factor by first calculating the average 5-day percentage return of the entire data universe.  I then determined the average 5-day profit on the days where the technical indicator was in oversold territory.  Dividing the overall market return into the oversold return yielded the Indicator Edge Factor.  As you can see in my original results, the RSI oscillator outperformed the other indicators, providing a remarkable edge in the neighborhood of 10 to 1.

Creating an Analysis Tool


One of the responders on my LinkedIn post wondered what the results would look like if I ran this analysis on cryptocurrency data.  I realized that the ability to analyze technical indicators on a variety of markets had some value, so I decided to build a tool in the Quantacula Studio modeling platform to realize this.

The Indicator Edge Analyzer runs a massive analysis of all of the indicators installed in the platform, on whatever data universe you select.  There are numerous options you can configure, and a stage two analysis that lets you do a deep dive into the profile and performance of a single indicator.  If you'd like to learn more about the Indicator Edge Analyzer, check here.

Results on Cryptocurrencies


I created a universe of crypto historical data in Quantacula Studio using the free Cryptocompare historical data source extension.  I added the top crypto symbols to the universe, fired up the Analyzer, and clicked the button.  The results are shown below.  It turns out that the RSI wins the oscillator contest even in the crypto markets!

We're again analyzing the average percentage return after 5 bars, with a period of 20 for the indicators.  These options can be easily configured in the Analyzer to suit your tastes.  Buying the crypto market when then RSI was oversold resulted in an average 5 day return of 19.05%, and an Edge Factor of 3.64.  The second closest oscillator was Chande Momentum Oscillator (CMO, and another one of my long time favorites) at 2.30.


Crypto Rotation Model

A strategy that balances a fully invested portfolio of cryptos based on RSI does extremely well.  I quickly mocked up a new Rotation Model in Quantacula Studio that buys the 3 cryptos that have the lowest RSI(20), rebalancing daily.  The results consistently outperformed holding a single crypto such as Bitcoin.  Here is the equity curve of this model backtested for the past 1 year.  The Crypto Rotation model outperformed Bitcoin "Buy and Hold", even considering it got caught with a position in BitConnect Coin (BCCOIN) that lost 99% of its value!


Saturday, February 10, 2018

Indicator Edge Factors

Recently I conducted an analysis of technical oscillator Edge Factors and posted the findings on LinkedIn's Algorithmic Traders Association group, which garnered quite a bit of interest.  Right about this time, I received an email from a hardcore Wealth-Lab user who evaluated the demo version of my new project, Quantacula Studio.  His email contained a list of about a dozen features he'd like to see added to Quantacula Studio, including an automation of the indicator risk analysis that I'd wrote about.

Spurred by these two pieces of feedback, I recently completed an extension for Quantacula Studio that completely automates the process.  It's called the Indicator Edge Analyzer.  Not only does the extension reproduce and automate the analysis of an oscillator's overbought/oversold edge, but it also:
  • Adds two new Edge Factors: Indicator above/below signal line, and Indicator down/up a consecutive number of bars
  • Outputs two Edge Factors for each method, resulting in 6 Edge Factors for each indicator
  • Lets you control the data testing range, scale (daily, weekly, etc.), profit window, and indicator period
Read more about this powerful tool here:



Thursday, January 4, 2018

RSI - King of Oscillators

Which technical indicators work and which don't?  How can we objectively measure their effectiveness?  I just completed an interesting analysis of technical oscillators over several sets of historical data.  I calculated the oscillators' "Edge Factor" -  dividing the average 5-day return of buying the market when the oscillator is oversold by the average 5-day return of the entire universe of historical data.

Why Oscillators?


I analyzed technical oscillators because of their standardized overbought and oversold levels.  There is a commonly accepted interpretation that when a technical oscillator is below its oversold level this presents a buying opportunity.  Of course, it can be more complicated than that, and technicians often seek confirmation, but the very word "oversold" means that the underlying is due for a rebound.

Analysis Basis


I first determine the overall 5-day return of the entire universe of historical data by processing each bar of history.  In my analysis I used daily data, so each bar of data represents one day.  I generate a profit value by subtracting the closing price at bar+5 from the open price at bar+1, and then converting this to a percentage profit.  I use this bar+1 method to simulate taking a position on an indicator/oscillator value that is available when bar+0 is completed.

I add all of the percentage profits together, and then divide by the total number of occurrences (observations) in the historical data.  In this way I arrive at the average 5-bar % return of the underlying universe of historical data.

Next I perform a similar process, but I only consider bars of data that occur when the oscillator in question is below its oversold level.  We would hope that the average profit in this case is higher than the average profit of the overall market, and I found this to be the case for all the oscillators I tested (except for some of the oscillators on the S&P100).  I divide this value by the average return of the universe to determine the oscillator's "Edge Factor".

Universes Tested - Survivorship Bias


I created this analysis using Quantacula Studio, and if you wish to reproduce it be sure to have at least the Q99 build.  I performed the analysis on the Dow 30, S&P 100, and Nasdaq 100 over a ten year period, using the Q-Premium data.  Note that this data correctly uses the historical components of the respective indices, eliminating survivorship bias from the analysis.  The Quantacula Studio code for this analysis can be found in this Discussion Forum post.

Results


Here's a table that summarized the Edge Factors of the oscillators on the different historical data sets.


RSI was the clear king of oscillators in this analysis, at least using the parameters and historical data that I tested with.  Drop me a note if there's another oscillator you'd like to see added to this analysis.  And download Quantacula Studio (with 30 day free trial) to try this analysis for yourself.  I'll be producing a YouTube video shortly that describes how step by step.



Crypto Rotation Model

In a previous post I published results of an analysis I performed on oversold technical oscillators.  I ran this test on the historical dat...