paint-brush
How to Increase your Bitcoin Holdings in a Bear Marketby@julian-molina
2,037 reads
2,037 reads

How to Increase your Bitcoin Holdings in a Bear Market

by Julian MolinaOctober 4th, 2019
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

An open-source project building a Collective Trading Intelligence. Co-founder of Superalgos.org, writes about the bitcoin crash last week. His strategy hit a 26% ROI trade during last week's bitcoin crash. He says the strategy is free for everyone to use. It is an opportunity to dive deep into the subject of building trading strategies. Even if you can't grasp the minutiae, you should still be able to follow the logical thinking that leads to building a strategy, which should be of great value.

Company Mentioned

Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - How to Increase your Bitcoin Holdings in a Bear Market
Julian Molina HackerNoon profile picture

Our strategy hit a 26% ROI trade during last week's bitcoin crash. If you pay attention you might be able to catch the next ride too.

September 6th, 5 PM UTC. I'm on my way to take my kid to her singing lessons.

Back at home, the Weak-hands buster strategy is carefully ticking—one by one—the conditions we set to define the situation in which we wish to sell
bitcoin. We bet that—given such a situation—chances are the market is turning south.

I'm still kicking my own ass for not trading actively during last year's bear market. I held the bag throughout the nightmarish crypto-winter instead.

I used to be a hardcore hodler; a fanatic that would put most of his cash in bitcoin "knowing" that bitcoin would rule the world sooner or later.

I still am a bit of a fanatic, to be honest, but now I know better. Had I been smarter back then, I would probably have ended 2018 with 549% more bitcoin—or at least Weak-hands buster would have, according to backtests.

Fast-forward to September 24th, 5 PM UTC. Bitcoin is trading at $9,500 while Coindesk's Omkar Godbole explains that the "recent low-volatility price squeeze has ended with a downside break" of the Bollinger Bands.

We get a message in our Telegram group from the pro-trader in the team—our trading mentor—who'd been out in the mountains for a few days, asking if we were getting a signal to sell bitcoin. 

I explain we sold on September 6th, at $10,371 and that we are still in the trade. He seems surprised we got a signal so early. We spend a few minutes discussing the details of our take position event and eventually move on with a pat on the back for the good trade in development.

An hour later, the red candle dropped to the floor below $8,000, costing bitcoin a few billion in market cap in what was the hardest hourly fall of 2019.

Seeing bitcoin plummet used to be a crushing experience… like watching your kid fall off her bike from the distance. You know she will hurt and you'd give anything to save her the trauma, but can do nothing about it as you watch her free-fall, in slow motion. An acrid mix of desperation and impotence flushes your mouth with a sour taste before she connects with the hard surface. Then, it's all pain.

Now that I'm trading both rallies and corrections, watching bitcoin go south is a completely different story. It's more like watching the kids in the park throwing stones at a mango tree, knowing that sooner or later, they will hit a ripe fruit and go back home feasting on the sweet nectar.

Catching the Fall

What happened at 5 PM UTC on September 6th that made the Weak-hands buster strategy decide to take a short position on bitcoin?

To start with, there was a clear break down of the Bollinger Bands in the 1-hour chart; a similar kind of event that signaled the crash a couple of weeks later, on the 24th.

But before getting to the core of the analysis, allow me a quick pause, if I may. 

This seems like a good moment to let the reader know that the explanation ahead is about to get a bit technical. However, this shouldn't discourage newbie or aspiring traders. On the contrary, it is an opportunity to dive deep into the subject of building trading strategies. Even if you can't grasp the minutiae, you should still be able to follow the logical thinking that leads to building a strategy, which should be of great value.

Furthermore, the strategy I'm about to explain is open-source. That not only means that it's free for everyone to use. Most importantly, it means that there is a group of people maintaining it, which are willing to share it and help people use it. So, you are not going to be alone if you wish to learn it.

Now, back to the point of the break down, Bollinger Bands rules indicate that the bands...

"provide a relative definition of high and low [prices]. By definition, price is high at the upper band and low at the lower band"

Rule 8 dictates that...

"closes outside the Bollinger Bands are initially continuation signals, not reversal signals"

However, this is where our strategy innovates:

We found that—in the USDT-BTC market—Bollinger Bands break downs may predict short-term trend reversals as well as continuations and deepening of trends when combined with the right set of filters.

The image below shows the 4-hours chart and what we call Bollinger Channels—a simple indicator deriving from the Bollinger Bands Moving Average (BB MA). Green trapezoids indicate periods in which the BB MA is rising, while red trapezoids indicate periods in which the BB MA goes down; in other words, short-term reversals.

The main trading idea behind the Weak-hands buster strategy is to identify short-term reversals as well as continuations and deepening of trends marked by a break down of the Bollinger Bands (BB) in the 1-hour chart, using the Percentage Bandwidth (%B) indicator, the Bollinger Bands Moving Average (BB MA) and the Bollinger Band deviation to assess momentum and volatility, optimize the take position event, and filter out late entries.

I'd like to emphasize that we agree with rule 8 in that a break of the BB does not on its own signal a reversal. The Weak-hands buster strategy uses the break down to trigger the strategy, not to take the position. 

This is a very important distinction, so allow me to expand on it.

Trigger-On Event

As I explained in a recent article about how to structure your trading system, the trigger-on event is a set of rules that determine which strategy (of the many you may have in your arsenal) you should consider using at any point in time. In other words, this set of rules or conditions describe the market situation in which you decide to use a certain strategy.

In the case of the Weak-hands buster strategy the trigger-on event is defined by the following four conditions:

Condition 1: Three consecutive candles must close below the BB MA. 

During an uptrend, a few candles closing below the Moving Average may be the first sign of exhaustion, that is, a short-term reversal may be in the making. In a downtrend, this may be a common occurrence and may be interpreted as a mild indication of downwards momentum.

A quick note: the Weak-hands buster strategy trades over the 1-hour chart, therefore, all mentions to indicators, candles or periods refer to the 1-hour chart, unless stated otherwise.

To build a successful strategy the strategy must be backtested over a significant data set. In crypto-timeframes, that should be at least two years. 

The most efficient way to do such backtests is by using algorithms. This leads us to the need of describing these conditions in mathematical terms so that they can be fed to the backtesting engine. 

Worth noting is the fact that once you describe your conditions in mathematical terms, you are also one step closer to automating your trading, should you be interested in such modern endeavors.

To describe conditions in mathematical terms, we use simple statements, referring to the variables made available by the trading automation platform, and comparison operators such as:

  • ===
    which means equal to
  • !=
    which means not equal to
  • >
    is greater than (or the variant
    =>
    which means equal or greater than)
  • <
    which means smaller than (or the variant
    =<
    which means equal or smaller than)

We may also use logical operators such as

&&
which means and, and
||
which means or.

The statement to define this first condition is the following:

candle.close < bollingerBand.movingAverage &&

candle.previous.close < BollingerBand.previous.movingAverage &&

candle.previous.previous.close < bollingerBand.previous.previous.movingAverage

Let's dissect the above statement…

  • candle.close < bollingerBand.movingAverage is pretty much self-explanatory; it means that the current candle closes below the BB MA;
  • candle.previous.close < bollingerBand.previous.movingAverage introduces the concept of the previous candle, making the same kind of comparison: the previous candle closes below the BB MA (at the value of the previous candle);
  • candle.previous.previous.close < bollingerBand.previous.previous.movingAverage should now be evident as well: the reference previous.previous means we are evaluating two candles behind the current candle.

Notice how the three statements are joined by the && (and) operator. This means that for this first condition to be true, all three statements need to be true. And that is how we arrive at the original English-language statement in mathematical terms: three consecutive candles must close below the BB MA.

Condition 2: There must be a break down of the Bollinger Bands. 

As explained above, we interpret the break down both as a signal of continuation or deepening of a trend or—in certain cases—as a potential short-term reversal signal.

In mathematical terms, this condition is described with the following statement:

candle.close < bollingerBand.movingAverage - bollingerBand.deviation

Quick dissection:

  • Bollinger Band Moving Average minus the deviation indicates de lower Bollinger Band.

Condition 3: The Bollinger Band deviation is greater than 200. 

The deviation of the Bollinger Bands is a measure of volatility, as it indicates the difference between relatively low and high prices. This condition filters out low volatility situations, in which a break down has no meaning at all.

In mathematical terms:

bollingerBand.deviation > 200

Pretty much self-explanatory, right? Needless to say, this is a simplistic implementation, as it uses a constant for the minimum volatility desired. In future iterations of the strategy, it will likely be replaced by a more universal approach.

Condition 4: The market is not in oversold territory. 

Going short in oversold conditions is seldom a good idea, as signs of oversold conditions may put a bullish pressure indicating it may be a good time to buy, not to sell. During an uptrend, you will seldom find signs of oversold conditions; therefore, this condition is a filter to avoid late entries in cases of continuations.

To check for oversold conditions, we use the Percentage Bandwidth (%B) indicator. We consider the market is oversold when %B is below 30 at the 8-hours chart and all time periods below 8-hours, up to 2 hours. What we want is that at least one of the time periods between 2 and 8 hours is not oversold.

In mathematical terms:

chart.at02hs.percentageBandwidth.movingAverage >= 30 ||

chart.at03hs.percentageBandwidth.movingAverage >= 30 || 

chart.at04hs.percentageBandwidth.movingAverage >= 30 ||

chart.at06hs.percentageBandwidth.movingAverage >= 30 ||

chart.at08hs.percentageBandwidth.movingAverage >= 30

Dissecting the statement:

  • The expression chart.at X hours indicates which chart the statement is checking. So we are checking all five charts (2, 3, 4, 6 and 8-hour charts).
  • We are also using the || (or) logical operator to connect all statements, which means that if %B MA is equal or greater than 30 in any of the time periods, then the condition will be true.

The first three conditions are illustrated in the image above. It would take five different images to illustrate condition four, so we'll skip that one for the time being.

A quick recap…

The four conditions we just reviewed describe the situation leading us to start considering that there might be an opportunity around the corner to trade with the Weak-hands buster strategy. 

This means we are just getting started, so bear with me. Feel free to go and get some coffee before we dive into the next section.

Take Position Event

The take position event determines in which situation we wish to take a position.

Once again, this situation will be described by a number of conditions that need to be true before entering the trade. 

This new set of conditions is practically adding up to the trigger-on event conditions.

Condition 1:  There is downward momentum in the 2-hours chart. 

If the BB MA at the 2-hours chart is going down, then it's the first indication that the break down may have some momentum to back a short-term reversal.

In mathematical terms, we express this as follows:

chart.at02hs.bollingerChannel.direction === "Down"

Dissecting the above statement:

  • The direction of the Bollinger Channel is a property of the indicator I mentioned earlier when discussing short-term trends. If it is going down, that means the BB MA is decreasing.

Condition 2: The slope of the BB MA is not extreme. If it is extreme, then several more rules need to be met: 

A- The BB MA slope may have been extreme for no longer than 6 candles; 

B- The BB MA at 4, 6 and 8 hours must be going down; 

C- The slope of the BB MA at the 2-hours chart must also be extreme or steep.

Wow! Even my head is spinning! I guess I will have to explain this one more thoroughly.

Let me start by saying that this condition does not necessarily derive entirely from a technical perspective, although it may make technical sense. This condition derives mainly from a statistical perspective, meaning that we have verified on historic data that this works best.

Let's tackle the first bit first: The slope of the BB MA is not extreme.

The slope of the Moving Average refers to the inclination of the curve or, if you wish, the rate of descent/ascent of the MA. This is an indication of momentum. We do not wish to enter the trade when momentum is extreme, as—statistically—we have found that such entries seldom end in good trades, mostly because too many late entries result from doing so.

So, we take the position if the slope of BB MA is not extreme. 

However, there are situations in which the slope of the BB MA is extreme, but we may still consider taking the position. That is what the second part of the statement addresses.

If the slope of the BB MA is extreme, we want to make sure that it has been extreme for a short period: no more than 6 candles, therefore, six hours (point A above). 

We also want to see that the 4, 6 and 8-hours charts show the MA going down; this confirms that we already are in a downtrend, at least in the short-term (point B above). 

And we add a final check, this time on the 2-hours chart: that the slope at the 2-hours chart is also extreme or at least steep (point C above). I will explain how extreme and steep slopes are calculated later on; bear with me.

These three rules aim to filter out very sudden moves typical of choppy markets which may continue with more sudden moves in the opposite direction immediately hitting your stop and resulting in a quick loss.

Let's try to visualize this on the charts.

In the case of the September 6th trade we are analyzing, the condition for the take position event was met because the BB MA had a steep slope, not extreme. So, the first statement of the condition was met.

This other opportunity illustrated below occurred on November 14th, 2018 during the last stages of the bear market. It shows the initial break down happening in a moment of low volatility. Remember this strategy is triggered only after the BB deviation is higher than 200.

However, the move down continued with significant momentum, with many candles closing below the lower band. By the time the trigger-on event occurred, the BB MA was already going down with an extreme slope.

The point to take home is that there is a dichotomy we need to manage: we wish to take the opportunity as soon as possible, but we sometimes need to let the move develop until we get a proper confirmation; if we don't wait long enough, we may be acting on a false signal, and if we wait too long, we may be getting in too late.

These nuances make very clear that a strategy that is not tried and tested over a significant data set has slim chances of being truly profitable. 

This also points to one of the reasons why amateur traders not working within the clear structure of a solid trading system are at a great disadvantage.

Now, let's zoom out and see how this particular trade went on…

52% profit in BTC, on a single trade, at the late stages of the bear market! Stunning, right? 

Are you starting to see why bitcoin crashes are not that painful for me anymore?

Now, how do we put this condition in mathematical terms? It's quite straightforward:

bollingerSubChannel.slope != "Extreme" || 

(bollingerSubChannel.period <=6 &&

chart.at08hs.bollingerChannel.direction === "Down" &&

chart.at06hs.bollingerChannel.direction === "Down"  && 

chart.at04hs.bollingerChannel.direction === "Down" && 

chart.at02hs.bollingerSubChannel.slope === ("Extreme" || "Steep"))

Dissecting the statement:

  • The first line implements the first part of the condition. The condition would be true if the BB MA slope is anything but extreme
  • The Bollinger Sub Channel is another simple indicator derived from the BB. We use it to gauge the slope of the MA. The indicator does all the math to determine the slope of the curve and outputs the results in colloquial English language: "Side", "Gentle", "Medium", "Steep" or "Extreme" are the possible results.
  • The second line is there to make sure that, in case the MA slope is extreme, then a maximum of 6 periods have passed in that situation.
  • Lines 3 to 5 are self-explanatory: they require that the MA points down on the 4, 6 and 8-hours charts to be true.
  • The final line checks for the BB MA slope to be either extreme or steep.

Condition 3: The current candle must be of moderate size. 

Taking a position right after an unusually large drop is not a good idea, as those candles are usually followed by a considerable bounce that may hit our stop. If that is the case, we'd rather pass on the opportunity. This condition works as a direct filter.

The condition in math terms may be implemented in many ways. The easiest is as follows:

candle.max - candle.min < 750

This is likely a bit too simplistic. We are checking that the candle, from the top of the upper shadow (max or high) to the bottom of the lower shadow (min or low)  is not bigger than $750. In a future iteration of the Weak-hands buster strategy, this will probably evolve into a percentage of the open price.

Condition 4:  Volatility must be on the moderate side too. 

Extreme volatility makes it difficult to find a safe moment to take a position. This strategy does not cope well with extremely choppy markets. This last condition acts as a direct filter of specific situations in which we prefer not to trade.

In math terms, a simplistic implementation would be:

bollingerBand.deviation < 1000

I'm sure a more elaborate approach will be pursued in future iterations of the strategy.

What's next?

We just covered how to catch the fall and take the position at the optimal time. This is certainly an important aspect of a trading strategy that you need to get right, as it will significantly affect results.

However, what comes next—the fundamental aspects of risk management—is what truly makes a difference in the long run.

In a follow-up piece, I will explain how the Weak-hands buster strategy handles initial stop and take profit target. But most importantly, I will show how those two are managed by dynamically tightening the stop and pushing the take profit target further as the trade develops.

In the meantime, you may go and take a close look at the Weak-hands buster strategy on Github and join the community maintaining it.

Acknowledgment: Thanks to Andreja Cobeljic for his technical review/editing.

Disclaimer: I am not a financial advisor and this is not financial advice. I share strategies and my own trading experiences as a means to disseminate knowledge. You are responsible for whatever you choose to do with the information I share.

Disclosure: The author is a core team member of the Superalgos Project.

Featured Image Credit: Photo by Angel Luciano on Unsplash.