
Cryptocurrency Analysis with Python – Buy and Hold - HIP_HOP
https://romanorac.github.io/cryptocurrency/analysis/2017/12/25/cryptocurrency-analysis-with-python-part2.html
======
minimaxir
Unless you can include the _complete irrationality_ of the users fueling the
crypto bubble to get rich into the statistical model, any statistical analysis
of those prices will be misleading.

Traditional historical trend analyses of stock prices assume the market is
_somewhat_ rational. (but not 100% efficient, which is where money can be
made)

~~~
down
if Gold can be irrational for 2k years, I don't see why not bitcoin can't, the
only think gold has going for "longer history", yet HN folk love to say "past
performance are not an...bla bla", yes it also has the 5% - 10% industrial
use, but bitcoin has that too by being able to transfer it without third
party, so will also not go to zero because will be useful as transfer of
value.

~~~
davewritescode
Gold has a price floor because it has some industrial utility and is useful
for making jewelry.

All that has to happen to destroy bitcoin is a flaw in the implementation.

Seriously, look at OpenSSL and tell me the same issues aren’t possible in
bitcoin.

When did we get so trusting of software that we decided it’d be a good idea to
base currency on a distributed algorithm?

~~~
throwaway30yo
The project can always fork if major issues are found.

Bitcoin is very very far from a perfect solution, but it is a solution to many
problems currencies have.

~~~
UncleMeat
Given how hard it is for the community to do something as simple as increase
the block size a tiny bit, I'm not confident that a fork could fix such a
problem.

------
zitterbewegung
At our local Chicago Python User group chapter (chipy.org) one of the
organizers of the Financial Group did a similar analysis. HODL is extremely
hard to beat if not impossible.

See [https://github.com/Chipy-
Finance/CryptoTechnicals/blob/maste...](https://github.com/Chipy-
Finance/CryptoTechnicals/blob/master/FinSIG%20Dec%202017%20-%20Technical%20Crypto%20Strategy.key)

[https://github.com/Chipy-
Finance/CryptoTechnicals/blob/maste...](https://github.com/Chipy-
Finance/CryptoTechnicals/blob/master/Buy%20and%20Hold.ipynb)

There is more in the github directory also.

~~~
HIP_HOP
thank you. Gonna look at it

------
dperfect
I ran some tests of my own with simulated automated trading strategies over
the past few years of historical Bitcoin price data. I used a genetic
algorithm to encode a range of time parameters for MACD, along with different
trading triggers and amounts. After a day or two of running it against a huge
number of permutations and generations optimized for highest overall return, I
came to a similar conclusion: the fittest configurations could do fairly well
in automated trading (the more active ones were highly sensitive to trading
fees [which were simulated] and market depth [was not simulated]), but over
the span of more than a few months, a simple buy and hold strategy produced
better returns in almost any time window.

~~~
thisisit
Not to be rude but I stopped reading at "MACD". TA is not the go-to strategy
in stock trading for a reason. Indicators like MACD, RSI, Bollinger Bands etc
re-paint a lot. So the perfect signals everyone sees on the charts are, for
the most part, are just "profitable system" mirage.

~~~
dperfect
Thanks. The conclusions may be obvious to experts in algo trading (and I heard
similar things about the problems of TA for stock trading prior to doing
this), but it was educational for me to go through the exercise because (1) it
confirmed to me that the crypto markets behave similar to other markets, and
(2) it helped me understand exactly where and how a technical indicator like
MACD falls short for making trade decisions.

Before trying it myself, I was somewhat skeptical when reading about how these
indicators don't work well. The overlays on charts always _looked_ like good
buy/sell indicators, so I didn't really understand why they couldn't make for
a good algorithm. Only after trying it myself did I gain insight as to why
they don't actually work so well.

I guess it's better to learn the hard way than to learn the hard-and-painful
way with real money ;)

~~~
ValentineC
> _Only after trying it myself did I gain insight as to why they don 't
> actually work so well._

Would you care to elaborate on which indicators you tried, and what happened?

~~~
dperfect
From my experience with MACD specifically, it basically came down to the fact
that with longer periods (or less sensitive thresholds), you lose out on most
of a price swing by the time your trigger fires, and with shorter periods (or
more sensitive thresholds), you end up making a lot of trades that don't move
the needle (can also rack up significant fees if you aren't careful). You can
find something reasonable in the middle, but by doing so, you're decreasing
both risk and potential returns.

There are at least two other important considerations apart from the indicator
itself: how to actually execute effectively with limited funds (when your
trigger fires, do you trade everything you can, only a certain percentage, or
some variable amount based on technical factors? - that's an entirely separate
algorithmic rabbit hole); and even if you do find a good algorithm and it
performs great in backtesting historical data, it's almost always harder to
achieve the same results in real market conditions (it's difficult to simulate
the spread and dynamics of limited market depth).

------
viridian
This may be a bit pedantic, but the phrase the author uses in his disclaimer
"Experts agree that cryptocurrencies are a bubble." bothers me because it's
kind of misleading.

The actual fact at hand is ~96% of economists think that the crypto market has
been subject to a massive speculation bubble as of November. While that's sort
of close to Roman's disclaimer, there is some nuance that ought to be given,
since a) 4% of professionals dissent, and b) the question asked of economists
had a temporal element to it, and they might have answered differently if the
market hadn't tripled in value in as many months. It's the difference between
'the housing market is in a bubble currently', and 'housing is a bubble'.

~~~
tbrownaw
_there is some nuance that ought to be given, since a) 4% of professionals
dissent, and b)_

That's roughly the same % of professionals that I've heard dissent about
global warming, yet dissenting about _that_ will get you labeled as stupid
and/or corrupt. So what makes it worth calling out for nuance here?

------
hendzen
Don't work with closing prices for statistical analysis. Work with returns
(really log returns). This would have simplified some of the code, and made
the plots in the same units rather than requiring separate axes.

More detail: [https://quantivity.wordpress.com/2011/02/21/why-log-
returns/](https://quantivity.wordpress.com/2011/02/21/why-log-returns/)

~~~
turnersr
What do you mean by those plots currently have different units? Don't they
consider the price in dollars as the unit?

~~~
HIP_HOP
They have the dollar as a unit, just y-axis scale is different. For BTC is
from $4000 to $20000 and for LTC is from $50 to $350. This is a useful
technique to check if curves move together or not.

------
bhaak
It's an open secret that "buy and hold" is hard to beat.

This is the reason why ETFs and other unmanaged asset options have become so
popular in recent years.

But that insight is not new. The phrase "time in the market beats timing the
market" goes way back and also popular stock market participants like Buffet
or Kostolany have been saying this for decades.

With regards to cryptocurrencies, we are seeing in a condensed time frame the
same development that for example the stock market went through.
Cryptocurrencies might become a new asset class but that doesn't mean that it
works financially differently than the other asset classes. So it should be no
surprise that the same trading strategies end up being the most profitable.

------
HIP_HOP
My next step is to implement strategy testing. I would like to end this series
with a classifier that predicts buy or hold.

Follow me on Twitter to get the latest updates:
[https://twitter.com/romanorac](https://twitter.com/romanorac)

~~~
minimaxir
A classifier that _flips a coin_ would probably have higher accuracy.

~~~
HighlandSpring
Give the coin a bias towards long and you've got a winner!

------
brndnmtthws
I think you meant HODL.

