1---
2Copyright (c) 2023 Taoshi Inc
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in all
12copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20SOFTWARE.
21---
1The models provided here were created using open source modeling techniques
2provided in https://github.com/taoshidev/time-series-prediction-subnet (TSPS).
3They were achieved using the runnable/miner_training.py, and tested against
4existing models and dummy models in runnable/miner_testing.py.
1The dataset used to build the models can be generated using the
2runnable/generate_historical_data.py. A lookback period between June 2022 and
3July 2023 on the 5m interval was used to train the model. Through analysis, the
4reason this dataset was used is because historical data beyond June 2022 provides
5strongly trending price movement or data movement that is from a period where
6Bitcoin's market cap was too small to be relevant to where Bitcoin is now.
7
8Therefore, using more recent data was used which correlates to the current market
9cap and macroeconomic conditions where its uncertain we'll continue to get highly
10trending Bitcoin data.
11
12Testing data was used between June 2023 and Nov 2023 to determine performance of
13the models. This was tested using the runnable/miner_testing.py file with a
14separately generated test dataset from runnable/generate_historical_data.py.
1As of now, the TSPS infrastructure only provides close, high, low, and volume. It
2also provides financial indicators such as RSI, MACD, and Bollinger Bands but they
3were not used for the purposes of training these models.
4
5The models were derived using a variety of windows and iterations through the June
62022 to June 2023 dataset. The strategy to derive the model was the following:
7
8base_mining_model = BaseMiningModel(len(prep_dataset.T)) \
9 .set_neurons([[1024, 0]]) \
10 .set_window_size(100) \
11 .set_learning_rate(0.0000001) \
12 .set_batch_size(500) \
13 .set_model_dir(f'mining_models/model1.h5')
14 base_mining_model.train(prep_dataset, epochs=25)
15
16where an LSTM model was created by using a few or no stacked layers. Most of the
17v4 models are actually not stacked as they performed better not being stacked for
18the most part. This could very likely change as more feature inputs are added (this
19is being worked on as part of the open source infra in TSPS). The window size of
20100 helped best predict the outcome, derived in mining_objects/base_mining_model.py
1Training the model used the previous 601 rows of data as an input. This is because
2500 rows were used to batch, and we are looking to predict 100 rows into the future
3(the challenge presented in the Time Series Prediction Subnet). Measures were taken
4to ensure all data was trained on in the training data.
5
6Each set of 601 rows was trained on 25 times, inside another loop which iterated on
7the entirety of the dataset from 6/22 to 6/23 50 times. This provided the model the
8ability to get granular with details yet not overfit to any single set of rows at
9once. Therefore, a multi-layered looping infrastructure was used to derive the models.
10
11for x in range(50):
12 for i in range(25):
13 train_model()
1The strategy to predict 100 closes of data into the future was to use a 1 step
2methodology of predicting 1 step at 100 intervals into the future and connect the
3information by generating a line from the last close to the prediction 100 closes
4into the future. By doing so, the model could learn to predict a single step rather
5than all 100 where loss could continue to increase with each misstep.
1Here's the text spaced out for readability in a README file:
2
3Recommendations on how to perform better than V4 and what Model V5 will look like
4are outlined below:
5
61. Concentrate on more difficult moves
72. Get more granular data (1m)
83. Get more data sources
94. Use more predicted steps
10
11-- Concentrate on more difficult moves
12
13The Time Series Prediction Subnet will reward models that are capable of predicting
14more "difficult" movements in the market more than those that are less difficult.
15Therefore, taking a strategy to train your model on larger movements or bigger
16magnitude movements would be a good consideration. Some additional details on how
17difficulty is calculated will be released soon but it is a combination of the
18magnitude of the movement with the std dev of the movement in the predicted interval.
19
20-- Get more granular data (1m)
21
22With these larger magnitude movements, a strategy to get more granular with the data
23would be recommended. Using 1m data to train rather than 5m would help the models
24better predict information.
25
26-- Get more data sources
27
28Beyond using financial market indicators like RSI, MACD, and Bollinger Bands, the
29TSPS open source infra will gather information for miners to help train.
30
31The TSPS infrastructure will be adding data scrapers and using those data scrapers
32to automatically gather information for you. The following pieces of information will
33be gathered & accessible through the open source infra:
34
35- Bitcoin open interest
36- Bitcoin OHLCV data
37- Bitcoin funding rate
38- DXY OHLCV data
39- Gold OHLCV data
40- S&P 500 OHLCV data
41- Bitcoin dominance
42- Historical news data (sentiment analysis)
43
44Using this information will provide models with information they can use to better
45predict prices as markets correlate in movement and Bitcoin responds to other markets.
46
47-- Use more predicted steps
48
49Rather than only predicting a single step at the 100th predicted close in the future,
50predict more steps. This can be achieved by training multiple models, for example,
5110 models each at 10 closes into the future (10, 20, 30, 40, 50, 60, 70, 80, 90, 100),
52or by using a multi-step model with 10 steps. Both will achieve more granularity when
53it comes to predictions and therefore can achieve a much greater RMSE score.
54