gdemos01 / crypto-trading-ai-bot-basic

MIT License
281 stars 102 forks source link

Can't add more historical information #9

Open Goro2030 opened 3 years ago

Goro2030 commented 3 years ago

I liked the concept and wanted to extend the training dataset ... so I pulled the data for one more month and then moved the resulting file from the "raw_historic_data" to the datasets/BTC-USD folder.

Then changed the config.py to extend it by one more month, like this:

TRAINING_MONTHS = ["2018_06","2018_07","2018_08","2018_09","2018_10","2018_11","2018_12","2019_01",
                   "2019_02","2019_03","2019_04","2019_05","2019_06","2019_07","2019_08","2019_09",
                   "2019_10","2019_11","2019_12","2020_01","2020_02","2020_03","2020_04","2020_05",
                    "2020_06","2020_07","2020_08","2020_09","2020_10"]

TESTING_MONTHS = ["2020_11"]

..... but I'm getting the following "type mismatch" error:

Traceback (most recent call last):
  File "c:\Development\crypto-trading-ai-bot-basic\Controller.py", line 68, in <module>
    x_test, y_test, prices = dataset.createTrainTestSets(COIN_PAIR, data, training_window=TRAINING_WINDOW, labeling_window=LABELING_WINDOW)
  File "c:\Development\crypto-trading-ai-bot-basic\Dataset.py", line 169, in createTrainTestSets
    change_rate = (next_close_price/latest_close_price) - 1
TypeError: unsupported operand type(s) for /: 'str' and 'float'