Proof of the Pudding

The proof of the pudding is in the eating – ancient proverb. My xgb model has been predicting a 2% rise for a couple of days. The prediction is actually for a 2% rise within the following three days, so time is running out for this to be proven true. I have a sell order in place to sell my trial ETH when/if it rises 2%. Will it be executed soon? Is this xgb pudding good?

Update:

Well, well, well. My model has decided over the past few hours that the price is not going to go up 2% after all. In fact it’s going to fall at least 2% in the next three days. What to do? I think I’ll just leave my sell order in place and hope it changes it’s mind again.

On reflection…

With ETH/BTC trending down, it’s actually to be expected that the ‘trading range’ will drop over time. So I simply adjust my selling price down a bit, and buy back price down a bit (to the ‘new low’) and make my 2% as before.

The model should cope with a downward trend, because I’m using returns rather than actual prices as inputs. Maybe my RL model, once I get it up and running, will deal with these issues. I am putting some time into rounding out my knowledge of PyTorch so that I can port any TF code to that framework. Issues of backwards compatibility seem to be a bit more serious with TF than with PT, and I’m thinking that a comprehensive understanding of one platform, rather than a ‘good enough’ understanding, will be the best way to go from here on.

Inconsistency!!

I hate inconsistency. It drives me crazy. I’m reviewing basic operations in PyTorch and I think I’ve discovered a major cause of the confusion I often feel when reading pytorch related code.

Given a matrix (or 2D tensor) m x n, one can select columns. If you select 2 or more columns you get an m x no. of cols tensor as a result. Two dimensions. But if you select only one column, you don’t. You get a one dimensional m vector as a result. The second dimension has been dropped!! No wonder there are so many squeeze and unsqueeze and reshape calls in pytorch code. To my simple mind if you select a column you should get a column, but no. Well, maybe now I can reduce my confusion when reading this sort of code somewhat. I just wish they hadn’t done that. I’m probably just proving what an idiot I am.

The Trend is Your Friend

This is one of those classic aphorisms in trading. I’m heeding it at the moment, only doing short trades given that ETH/BTC has been trending down for nearly two years. So, if the price goes up a bit (technically a retracement in a downward trend) I sell some borrowed ETH for BTC, and when it drops a couple of percent I buy the ETH back again. Backtesting with my XGBoost model over the past year gives approximately 100% profit doing this, on recently updated prices.

Since most of my schemes make some money for a while and then lose a lot I’m not putting too much capital into this. I make $100 here and there. If it remains profitable for six to twelve months I might consider increasing my positions. Probably by then the strategy will stop working. My pessimism comes from experience. Any sensible person would have given up by now.