mate-h / sorosbot.com

Site
1 stars 3 forks source link

Train and backrest basic ML based strategy #13

Open mate-h opened 3 years ago

mate-h commented 3 years ago

Note: machine learning is not magic. It can’t predict a random sequence, and you have to be very careful of your own biases when training models.

For example, twitter and reddit data correlates with crypto asset price is a bad assumption.

Task

Prepare test and training data, determine model inputs/outputs.

Design proposal

Proposed short name: sv1, and for subsequent versions use semantic versioning sv1.1, sv2. Base model name: LTSM Convolutional Classifier

Convolutional layers are the ML equivalent of candlestick data which visually orders the patterns in price into convolutions, a.k.a. time intervals where the horizontal data is a time series. This assumption needs to be verified by a few citations.

The key to the success of this approach fundamentally relies on a fast, realtime implementation that works on live market data and can be run on accelerated hardware, like the GPU.

image

Neural network architecture

Hyperparameters:

Inputs:

Outputs:

Implementation

Use keras library and python to implement a basic realtime recurrent ML model that is also backtestable. Examples: https://github.com/manthanthakker/BitcoinPrediction Conclusions:

ARIMA performs well for next days predictions but performs poor for longer terms like given last few days price predict next 5-7 days prices. RNN perform consistently upto 6 days. Random Forest usually perform poorly on validation set and unseen patterns. RNN and ARIMA model perform well but fail to predict the hype or the unusal spike caused by rumors or fake news. One can use sentiments from twitter to incorporate these changes.

https://github.com/Alro10/deep-learning-time-series This is a more general example, a collection of papers with code for time series forecasting.

https://github.com/timeseriesAI/tsai https://timeseriesai.github.io/tsai/models.MINIROCKET.html# Hot :fire:

Look around Google and GitHub for existing implementations to base this code off of. Make sure it can be wrapped as a freqtrade compatible strategy.

Guides and reference

https://machinelearningmastery.com/

mate-h commented 3 years ago

This needs some extensive R & D, and proper documentation of the technique for reproducibility.

Especially look into 1D convolutional layers and see if such an ML model architecture has been applied to time series data - like the data from binance API

mate-h commented 3 years ago

Findings

Long term stake = fixed return, low risk, low volatility, stoploss Short term stake = high return, high risk, high volatility, stoploss

Therefore, long term stakes should stake the amount proportional to when to sell the asset once it's been bought. Short term stakes on the other hand will put on a smaller amount, proportional to the hold time.