-
Notifications
You must be signed in to change notification settings - Fork 114
Home
Welcome to the BTCpredictor wiki!
This is going to collect some of the questions that I receive regularly. Reminder - this is not financial advice.
Q) Recommendations on re-implementing the code so it's suitable for live trading: A)
-
Not Matlab. I used Python because it combines scientific computing librairies that make linear regressions and KMeans clustering very simple (I like sklearn: http://scikit-learn.org/stable/modules/clustering.html#k-means) as well as the requests module, which makes crypto-exchange REST APIs easy to handle. (and no, it's not available here because if multiple people run the exact same trader, it will lose effect ... sad I know. To kill the suspense, I didn't get good results live-trading anyways. Read onwards for a guess why)
-
Unless you have serious computing resources at hand like the authors in the paper, it's going to take you approximately forever (several hours per day's worth of data) to run KMeans clustering over every single consecutive interval. Implement sampling. Take 1 in every 15 intervals or so and the training will be a lot faster with very little loss in data quality.
Q) Does it work ? A) TLDR; Not yet. I think it has the potential. Consider HODLing.
I reimplemented it in Python, where it performs rather well in simulation (looking at real time exchange prices, predicting trades and assuming instant execution).
When I tried live trading, it performed neutral/slightly negative using limit orders. Yes, it's notoriously difficult to model adding to the order book, and no, I'm not a quant but crypto exchange market fees are still too high to place market orders willy-nilly. Market order percentage-wise execution fees would have eaten the predicted profit-per-trade. I believe the futures markets for Bitcoin have a more amenable pricing structure, at a fixed ~$2 per trade.
The trader had lots of difficulty placing the trades as limit orders. The market would 'move' against the order once it was placed, and the order would rarely get executed. This is called adversarial action and it's expected in live trading, unless you have a very good pricing strategy and are very fast. The trades that did get placed were barely profitable. This was all back in September.
Q) Isn't 10 seconds not much time for a price jump? Shouldn't the price change very little ?
A) You're right, price changes over that interval are very small. For most intervals, the predicted price change is approximately 0.001, and that will generally match the actual change in the market over 10 seconds. Generally. This is definitely not true right now (December 2017), since btc is going crazy.
A couple times an hour, an interval will have a predicted change that passes the threshold, and then you act. The thresholds are also very small though, so I'm not sure why the simulation showed such positive results.
My intuition is that a strong prediction is generally followed by a price movement in that direction over the span of several timesteps - so for example if you predict a price increase ten seconds out at time t, you hopefully buy right away and the price keeps increasing slowly. The next move you can make is to sell, and you don't sell until you predict the price is going down quickly enough to hit the threshold. So if everything is working the price has been increasing in the interim timesteps right before selling.*
Since you've read all this way, why don't you read this? https://www.reddit.com/r/Bitcoin/comments/1lfobc/i_am_a_timetraveler_from_the_future_here_to_beg/