Live data from Hacker News

Analyzing Cryptocurrency Markets Using Python

blog.patricktriest.com

21–30 of 56 posts

Re: Analyzing Cryptocurrency Markets Using Python

#21
Don't think I've ever really seen the full $BTCUSD chart since inception like that. More than slight resemblance to Nasdaq-100 chart circa late 1999-early 2000. Just saying, exercise caution out there ;)

Next step: prediction! As an active research subject, crypto-currencies may be the ideal candidate for using deep learning to forecast non-stationary time series data.

Theory and Algorithms for Forecasting Non-Stationary Time Series

http://www.cs.nyu.edu/~mohri/talks/NIPSTutorial2016.pdf

Re: Analyzing Cryptocurrency Markets Using Python

#22
(Shameless self-promotion)

You can watch a couple dozen the Bitcoin markets trade in real-time all on one chart with my site: https://bitcoin.clarkmoody.com/tickers/

It gets very interesting when the price really starts to move, since all the markets tend to move in lockstep. The response time reveals how active the trading bots are, making sure to reduce arbitrage opporunities.

Re: Analyzing Cryptocurrency Markets Using Python

#23

I wanted to do something like that, eventually I did it on the elasticsearch. Then I wanted to share with the society and added grafana. The final result is real-time analytics of trading on main exchanges and for major pairs: https://cointradeanalysis.com

Wow, that is very cool. Some feedback/ideas: 1) things like xrp_usd need more decimal places for price (Max price 0.16, Min price 0.15, you really need at least 4 decimal places.) 2) What you call "Amount" should really be called "Volume".. "Count orders" should be "Count Trades" or perhaps just "Trades". 3) The buy/sell graph: i would place the buy/sell bars beside each other (instead of having sell underneath point…

1) I'll try to fix it.

2) Corrected, thank you very much.

3) The first option was like you describe, but something I did not like about it - I'll think about it :)

Re: Analyzing Cryptocurrency Markets Using Python

#24
post #2

My 2 cents: - it is not really pertinent to compute the correlation between prices. This takes the currencies trend into account since prices, contrary to e.g. "returns", are non stationary. This will lead to a biased higher correlation. Just do a ".pct_change()" before the correlation. - also averaging the price between exchanges is a bit naive. It hides arbitrage opportunities and does not reflect the underlying tr…

Thanks for the tips! I'll update the tutorial code with that info in the next day or so. Until then, I've just added a note warning about the bias, and recommending the use of the ".pct_change()" method.

I think it helps to "step out" with correlation/regression to understand why something may be spurious or why you get the high correlation values that you do. In some cases, there is no logical connection between variables which leads to spurious regression. However, in this case, if you "step out", the reason for the correlation is pretty obvious.

There has been a lot of money pouring into crypto recently because most people are speculating on the space as a whole. Bitcoin's price is too high for smaller investors to make a significant amount of money on, but when a big Bitcoin move makes the news, those investors want a piece. They then pour money into the smaller coins, hoping to get a larger return on their investment.

All of this is to say that I think this is the opposite of spurious correlation. However, that doesn't make the correlation meaningful in any way. When ETH or BTC jumps and makes the news, the other coins tend to follow because the whole space is speculative right now.

Re: Analyzing Cryptocurrency Markets Using Python

#25
I'm surprised they didn't mentioned Machine Learning to further analyze the cryptocurrencies. Especially, that a few years ago an experiment shown, that if we would trade algorithmically on S&P500 via Machine Learning, traders could earn 8.5% returns comparing to the 5.6% by a random tactic. Here is a nice explanation: https://sigmoidal.io/machine-learning-for-trading/

Re: Analyzing Cryptocurrency Markets Using Python

#26
It's great how readily available financial data is with cryptocurrencies! As a complement to this post, I've been recently working with Jupyter notebooks to analyze high-frequency trading activity in Bitcoin markets [1]. I've been listening to the GDAX socket since end July, so I have almost a month's worth of tick data (~ 7GB+ gzip compressed JSON data, it surely explodes to ~100 GB after extracting). If somebody is interested to carry out further analysis I can give you a link to download it.

[1] https://nbviewer.jupyter.org/github/ghgr/HFT_Bitcoin/blob/ma...

Re: Analyzing Cryptocurrency Markets Using Python

#28
post #25

I'm surprised they didn't mentioned Machine Learning to further analyze the cryptocurrencies. Especially, that a few years ago an experiment shown, that if we would trade algorithmically on S&P500 via Machine Learning, traders could earn 8.5% returns comparing to the 5.6% by a random tactic. Here is a nice explanation: https://sigmoidal.io/machine-learning-for-trading/

I've started dabbling with R (started with Python and just got fed up with it and switched to R) and ML to analyze bitcoin from GDAX over the past few days. Coming from a non-stats background (I did time-series analysis in undergrad ala Econometrics but that was over a decade ago) I've had issues trying to create meaningful models. With packages like Caret[1] it is easy to slap code together and throw factors at the algorithms to see what sticks. The problem is that the models that are generated typically suck (I think the best RMSE I was able to get was around 12 and that was with linear regression model)

ML can definitely help trading by using things like Ensemble Learning[2] but I would argue that for the novice it isn't going to add much to a trading strategy than doing other analysis on their own would do.

[1] https://cran.r-project.org/web/packages/caret/index.html

[2] https://en.wikipedia.org/wiki/Ensemble_learning

Re: Analyzing Cryptocurrency Markets Using Python

#29
post #12

Nice and everything, but you can't make money with this, or can you?

From the anlysis that was written up you would most likely not make consistent money on. That said, it could be used as a basis to start exploring more to try and find other factors that could influence price and try to trade on that.

Re: Analyzing Cryptocurrency Markets Using Python

#30
post #26

It's great how readily available financial data is with cryptocurrencies! As a complement to this post, I've been recently working with Jupyter notebooks to analyze high-frequency trading activity in Bitcoin markets [1]. I've been listening to the GDAX socket since end July, so I have almost a month's worth of tick data (~ 7GB+ gzip compressed JSON data, it surely explodes to ~100 GB after extracting). If somebody is…

What are you using to listen to GDAX sockets? I've been able to successfully connect using their node library but when trying to connect directly without using their library I'm unable to connect.
Post reply on HN