Using Genetic Algorithms to Find Signal in Cryptocurrency Noise

Jan 5, 2018 · 6 min read

The Gatsiva API is a cryptocurrency analysis and insight engine that is currently in limited beta . To find out more, visit or follow us on Medium for insights delivered directly to you.

Here in our underground skunkworks, we’ve been hunkered down as winter storm Grayson winds down and people on the eastern seaboard of the US begin to dig out. While buried, what better time to look at the results of our genetic algorithms (GA) which have been searching for trading patterns on Bitcoin and Ethereum for the past month.

Negative Signals at the Positive Party

It is awfully easy to find great trading strategies that work when everything is going up, up, up. 🚀. But its much harder to find negative signals during the positive party. This is exactly the task that we set our genetic algorithms against.

We started by looking at the period between May 2017 and early December 2017 which saw a remarkably different trading pattern in general versus prior periods. In addition, though this period did have a strong upward trend for both Bitcoin and Ethereum, it was also marked with many short-lived downturns that could represent trading opportunities.

Parameters of Research

Our proprietary genetic algorithm utilizes numerous hyper parameters as part of the training process. However, critical to this process is finding conditions over a training period and validating them over a confirmation period to avoid data-snooping bias. Conditions that are found during the training period, but exhibit poor performance during the confirmation period are discarded.

In addition, we set population sizes and various rates for mortality, mating, and mutation. However, for simplicity the key parameters have been listed below.

Lastly each rule is evaluated by a fitness function. In this case, the fitness function we utilized is a custom measure of the extent to which returns within a specific confidence interval were below 0 within 2 weeks. Conditions could then be assigned a fitness score based on how far the returns within a certain confidence interval were less than 0%.

We’ll save the math for another article, but put simply, the more confident we could show that returns were almost always negative the higher the fitness score for the rule.

Generation Period: 5/15/2017 to 9/15/2017

Confirmation Period: 9/16/2017 to 12/06/2017

Cryptocurrency Pairs: BTC_USD / ETH _USD

Time Analysis: Hourly data

Fitness Function: Best returns below 0 within 2 weeks utilizing a 1.5 standard deviation confidence interval

The Results

Over a period of about 3 weeks we’ve run over 10,000 generations and have evaluated more than 10 million rules. What floated to the top based on overall fitness was interesting.

Ethereum Priced in USD

Results for Ethereum were numerous (over 20 in fact) and mostly constructed from conditions utilizing the RSI, MACD Line, and Full Stochastics technical indicators. Let’s take a look at one in particular.

full stochastics k(28,75,95) < macd line(15,235,4)

In the following graphs we illustrate the results in the training period, confirmation period, and over the full period.

Figure 1. Ethereum Condition Analysis

In the training period we found 43 observations of this event. In the data you can see a gradual increase in confidence of returns below zero from 0 to 336 periods (representing the number of hours in 2 weeks). However, the standard deviation is fairly consistent, meaning the width of the band is pretty stable. This indicates that these returns all occurred within the same relative period, most likely in succession.

Looking at the confirmation period results we found 30 observations of this event and see a very different pattern. Not all periods indicate good confidence of negative returns, but we do see a wider standard deviation band occur from returns generated 50 hours after the event until about 120 hours.

Looking at the result in aggregate over the entire period, we can see that around 80 hours after the event occurs, the average return was -6.9% with a 1.5 standard deviation band range of -3.25% to -10.6%. An interesting result that probably warrants further tracking and simulation.

Bitcoin Priced in USD

There were, let’s say, less interesting results for Bitcoin. Only four noteworthy conditions rose up to the top and did so only marginally. In addition, each of these four conditions are difficult to rationalize from a technical analysis perspective. For example, the most interesting result below, compares the square root of the hourly closing price to the MACD histogram.

the square root of close(1) < macd histogram(185,279,148)

In analyzing the results, we see a similar trend of clustered results implied by the very tight and unchanging standard deviation band. This indicates that most of these results occurred within a very short period of time and in fact if you look at the details of when this event occurred this is the case.

Figure 2. Bitcoin Condition Analysis

Looking at the total results however, we can see that after 20 hours there was an overage return of -3.33% with a 1.5 standard deviation band of returns of -0.8% to -5.86%. Probably not a high confidence indicator, but something that may support a trader on the fence about whether or not to take some money off the table.

Paths for Follow-up Analysis

It is pretty clear that taking these results and beginning to trade on them is potentially a very poor path to future returns at the moment. But utilized as an additional component to a broader strategy may traders looking for more information. In addition, putting those hunches to the test using this same type of analysis may be useful. For an example, please see our prior post of Buy on Dip or Buy on Rip? An entry based analysis of return confidence for Bitcoin, Ethererum, and Litecoin.

That said, there are some threads that may be worth following up on in future analyses:

1. We could take a look at when these events actually occurred; for example, where they clustered in sequence, or were these events evenly distributed throughout the generation and confirmation periods. Though this article did not get into that analysis in detail, its quite trivial to do so.

2. We could look at different time periods for generation; the crypto market in general seemed to exhibit a vastly different pattern post May 2017 than it did prior to that time. In addition, the recent ramp up at the end of the year from December 6th onward.

3. We could penalize clustering in the fitness function to avoid results that only look compelling because they occurred multiple times in succession at a critical time.

4. We fully recognize that price itself may not be driving these moves, but other factors. Modeling those factors as time series data that can be processed by our platform could also lead to more interesting results.


At Gatsiva, we believe that genetic algorithms have a place in helping to find price trends that are hard to discern in this overly emotional and volatile market. Our initial analysis indicates that this approach can find strategies that work, but more research and perhaps more breadth in experimentation is required.

With the Gatsiva API, we are aiming to improve our returns analysis transaction to provide more granular data on events as well as dashboards and visualizations to allow analysts to do their own digging. In addition we are continuing to publish insights on our collaboration platform to our early-adopters and later to the general audience via Medium and Twitter.

Join our platform or follow us on Twitter and Medium to stay in touch or contribute! And, if you like this article, send us some claps!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade