Repository: freqtrade/freqtrade

Issue:
trades_remove_duplicates() doesn't work for trades stored using hdf5
<!-- 
Have you searched for similar issues before posting it?

If you have discovered a bug in the bot, please [search our issue tracker](https://github.com/freqtrade/freqtrade/issues?q=is%3Aissue). 
If it hasn't been reported, please create a new issue.

Please do not use bug reports to request new features.
-->

## Describe your environment

  * Operating system: Windows 10
  * Python Version: 3.8.5
  * CCXT version: 1.36.85
  * Freqtrade Version: 2020.10
  
Note: All issues other than enhancement requests will be closed without further comment if the above template is deleted or not filled out.

## Describe the problem:

trades stored as hdf5 look like this when imported:
 ```[1600387752313, nan, 'limit', 'buy', 39.95, 33.61046059, 1342.7379005705002] ```
downloaded trades look like this: 
 ```[1600387752313, None, 'limit', 'buy', 39.95, 33.61046059, 1342.7379005705002] ```
because nan ≠ None, trades_remove_duplicates() will think they are different trades and therefore not remove the duplicate
### Steps to reproduce:

  1. run ```freqtrade download-data --data-format-trades hdf5```
  2. run ```freqtrade download-data --data-format-trades hdf5``` again
  3. As you can see in the log below, the new amount of trades is always exactly 999 higher than the current amount of trades, which means that duplicates are not being removed

### Relevant code exceptions or logs

Note: Please copy/paste text of the messages, no screenshots of logs please.

  ```
2020-11-15 08:14:18,228 - freqtrade.configuration.configuration - INFO - Using config: user_data/config-all.json ...
2020-11-15 08:14:18,239 - freqtrade.loggers - INFO - Verbosity set to 0
2020-11-15 08:14:18,239 - freqtrade.configuration.configuration - INFO - Parameter --timerange detected: 20201110- ...
2020-11-15 08:14:18,248 - freqtrade.configuration.configuration - INFO - Using user-data directory: /freqtrade/user_data ...
2020-11-15 08:14:18,252 - freqtrade.configuration.configuration - INFO - Using data directory: /freqtrade/user_data/data/kraken ...
2020-11-15 08:14:18,253 - freqtrade.configuration.configuration - INFO - timeframes --timeframes: ['1m', '5m']
2020-11-15 08:14:18,253 - freqtrade.configuration.configuration - INFO - Detected --dl-trades: True
2020-11-15 08:14:18,253 - freqtrade.configuration.configuration - INFO - Using "hdf5" to store OHLCV data.
2020-11-15 08:14:18,253 - freqtrade.configuration.configuration - INFO - Using "hdf5" to store trades data.
2020-11-15 08:14:18,253 - freqtrade.configuration.check_exchange - INFO - Checking exchange...
2020-11-15 08:14:18,253 - freqtrade.configuration.check_exchange - INFO - Exchange "kraken" is officially supported by the Freqtrade development team.
2020-11-15 08:14:18,253 - freqtrade.configuration.configuration - INFO - Using pairlist from configuration.
2020-11-15 08:14:18,254 - freqtrade.configuration.config_validation - INFO - Validating configuration ...
2020-11-15 08:14:18,264 - freqtrade.commands.data_commands - INFO - About to download pairs: ['ADA/EUR', 'ALGO/EUR', 'ATOM/EUR', 'BAL/EUR', 'BAT/EUR', 'BCH/EUR', 'BTC/EUR', 'COMP/EUR', 'CRV/EUR', 'DAI/EUR', 'DASH/EUR', 'DOGE/EUR', 'DOT/EUR', 'EOS/EUR', 'ETC/EUR', 'ETH/EUR', 'FIL/EUR', 'GNO/EUR', 'ICX/EUR', 'KAVA/EUR', 'KNC/EUR', 'KSM/EUR', 'LINK/EUR', 'LSK/EUR', 'LTC/EUR', 'MLN/EUR', 'NANO/EUR', 'OMG/EUR', 'OXT/EUR', 'PAXG/EUR', 'QTUM/EUR', 'REP/EUR', 'REPV2/EUR', 'SC/EUR', 'SNX/EUR', 'STORJ/EUR', 'TRX/EUR', 'USDC/EUR', 'USDT/EUR', 'UNI/EUR', 'WAVES/EUR', 'XLM/EUR', 'XMR/EUR', 'XRP/EUR', 'XTZ/EUR', 'YFI/EUR', 'ZEC/EUR'], intervals: ['1m', '5m'] to /freqtrade/user_data/data/kraken
2020-11-15 08:14:18,264 - freqtrade.exchange.exchange - INFO - Instance is running with dry_run enabled
2020-11-15 08:14:18,264 - freqtrade.exchange.exchange - INFO - Using CCXT 1.34.40
2020-11-15 08:14:18,265 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'enableRateLimit': True}
2020-11-15 08:14:18,270 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'enableRateLimit': True, 'rateLimit': 3100}
2020-11-15 08:14:18,276 - freqtrade.exchange.exchange - INFO - Using Exchange "Kraken"
2020-11-15 08:14:18,276 - freqtrade.resolvers.exchange_resolver - INFO - Using resolved exchange 'Kraken'...
2020-11-15 08:14:18,276 - freqtrade.exchange.exchange - INFO - Markets were not loaded. Loading them now..
2020-11-15 08:14:21,444 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair ADA/EUR.
2020-11-15 08:14:21,490 - numexpr.utils - INFO - NumExpr defaulting to 8 threads.
2020-11-15 08:14:30,235 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for ADA/EUR since: 2020-11-13T19:13:13.
2020-11-15 08:14:30,235 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 1311965
2020-11-15 08:14:43,986 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 1312964
2020-11-15 08:14:44,296 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair ALGO/EUR.
2020-11-15 08:14:45,766 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for ALGO/EUR since: 2020-11-13T18:21:15.
2020-11-15 08:14:45,767 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 200289
2020-11-15 08:14:49,399 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 201288
2020-11-15 08:14:49,438 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair ATOM/EUR.
2020-11-15 08:14:53,744 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for ATOM/EUR since: 2020-11-13T19:07:46.
2020-11-15 08:14:53,745 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 463418
2020-11-15 08:15:01,700 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 464417
2020-11-15 08:15:01,790 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair BAL/EUR.
2020-11-15 08:15:02,449 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for BAL/EUR since: 2020-11-13T18:59:57.
2020-11-15 08:15:02,449 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 14399
2020-11-15 08:15:03,124 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 15398
2020-11-15 08:15:03,128 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair BAT/EUR.
2020-11-15 08:15:04,561 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for BAT/EUR since: 2020-11-13T18:58:35.
2020-11-15 08:15:04,561 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 201466
2020-11-15 08:15:10,825 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 202465
2020-11-15 08:15:10,863 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair BCH/EUR.
2020-11-15 08:15:43,090 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for BCH/EUR since: 2020-11-13T19:16:17.
2020-11-15 08:15:43,091 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 5005570
2020-11-15 08:16:32,564 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 5006569
2020-11-15 08:16:33,474 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair BTC/EUR.
2020-11-15 08:17:43,566 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for BTC/EUR since: 2020-11-13T19:21:05.
2020-11-15 08:17:43,567 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 9742060
2020-11-15 08:19:17,944 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 9743059
2020-11-15 08:19:19,634 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair COMP/EUR.
2020-11-15 08:19:21,128 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for COMP/EUR since: 2020-11-13T19:21:29.
2020-11-15 08:19:21,129 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 77100
2020-11-15 08:19:22,335 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 78099
2020-11-15 08:19:22,353 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair CRV/EUR.
2020-11-15 08:19:22,815 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for CRV/EUR since: 2020-11-13T19:16:29.
2020-11-15 08:19:22,815 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 36140
2020-11-15 08:19:28,103 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 37139
2020-11-15 08:19:28,112 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair DAI/EUR.
2020-11-15 08:19:29,403 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for DAI/EUR since: 2020-11-13T19:17:59.
2020-11-15 08:19:29,403 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 176916
2020-11-15 08:19:35,653 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 177915
2020-11-15 08:19:35,691 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair DASH/EUR.
2020-11-15 08:19:44,369 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for DASH/EUR since: 2020-11-13T19:09:35.
2020-11-15 08:19:44,370 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 1528581
2020-11-15 08:20:00,909 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 1529580
2020-11-15 08:20:01,166 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair DOGE/EUR.
2020-11-15 08:20:02,474 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for DOGE/EUR since: 2020-11-13T18:04:58.
2020-11-15 08:20:02,474 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 104323
2020-11-15 08:20:04,188 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 105322
2020-11-15 08:20:04,214 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair DOT/EUR.
2020-11-15 08:20:06,537 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for DOT/EUR since: 2020-11-13T19:14:48.
2020-11-15 08:20:06,538 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 265276
2020-11-15 08:20:11,422 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 266275
2020-11-15 08:20:11,474 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair EOS/EUR.
2020-11-15 08:20:23,553 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for EOS/EUR since: 2020-11-13T19:20:18.
2020-11-15 08:20:23,553 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 1888801
2020-11-15 08:20:42,485 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 1889800
2020-11-15 08:20:42,840 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair ETC/EUR.
2020-11-15 08:21:02,195 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for ETC/EUR since: 2020-11-13T18:13:17.
2020-11-15 08:21:02,196 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 2882986
2020-11-15 08:21:31,656 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 2883985
2020-11-15 08:21:32,162 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair ETH/EUR.
2020-11-15 08:22:26,418 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for ETH/EUR since: 2020-11-13T19:26:58.
2020-11-15 08:22:26,418 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 7176012
2020-11-15 08:24:05,833 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 7187692
2020-11-15 08:24:07,166 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair FIL/EUR.
2020-11-15 08:24:07,903 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for FIL/EUR since: 2020-11-13T19:23:02.
2020-11-15 08:24:07,903 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 16562
2020-11-15 08:24:08,542 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 17561
2020-11-15 08:24:08,547 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair GNO/EUR.
2020-11-15 08:24:11,206 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for GNO/EUR since: 2020-11-13T17:49:23.
2020-11-15 08:24:11,206 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 411327
2020-11-15 08:24:19,077 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 412326
2020-11-15 08:24:19,153 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair ICX/EUR.
2020-11-15 08:24:20,062 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for ICX/EUR since: 2020-11-13T19:06:29.
2020-11-15 08:24:20,062 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 194458
2020-11-15 08:24:22,722 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 195457
2020-11-15 08:24:22,768 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair KAVA/EUR.
2020-11-15 08:24:23,648 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for KAVA/EUR since: 2020-11-13T19:02:12.
2020-11-15 08:24:23,648 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 124831
2020-11-15 08:24:27,730 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 125830
2020-11-15 08:24:27,757 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair KNC/EUR.
2020-11-15 08:24:28,100 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for KNC/EUR since: 2020-11-13T19:25:50.
2020-11-15 08:24:28,101 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 43916
2020-11-15 08:24:33,136 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 44915
2020-11-15 08:24:33,148 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair KSM/EUR.
2020-11-15 08:24:33,397 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for KSM/EUR since: 2020-11-13T19:10:07.
2020-11-15 08:24:33,398 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 15472
2020-11-15 08:24:39,348 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 16471
2020-11-15 08:24:39,353 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair LINK/EUR.
2020-11-15 08:24:43,459 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for LINK/EUR since: 2020-11-13T19:20:25.
2020-11-15 08:24:43,459 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 647465
2020-11-15 08:24:52,080 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 648464
2020-11-15 08:24:52,191 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair LSK/EUR.
2020-11-15 08:24:53,069 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for LSK/EUR since: 2020-11-13T19:23:39.
2020-11-15 08:24:53,069 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 99138
2020-11-15 08:24:54,537 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 100137
2020-11-15 08:24:54,560 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair LTC/EUR.
2020-11-15 08:25:30,795 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for LTC/EUR since: 2020-11-13T19:28:57.
2020-11-15 08:25:30,795 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 5038065
2020-11-15 08:26:19,292 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 5039064
2020-11-15 08:26:20,206 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair MLN/EUR.
2020-11-15 08:26:22,098 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for MLN/EUR since: 2020-11-13T19:29:12.
2020-11-15 08:26:22,099 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 182909
2020-11-15 08:26:24,392 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 183908
2020-11-15 08:26:24,433 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair NANO/EUR.
2020-11-15 08:26:25,116 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for NANO/EUR since: 2020-11-13T17:10:35.
2020-11-15 08:26:25,117 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 125229
2020-11-15 08:26:29,263 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 126228
2020-11-15 08:26:29,295 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair OMG/EUR.
2020-11-15 08:26:30,275 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for OMG/EUR since: 2020-11-13T19:14:06.
2020-11-15 08:26:30,275 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 173187
2020-11-15 08:26:36,520 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 174186
2020-11-15 08:26:36,553 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair OXT/EUR.
2020-11-15 08:26:37,547 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for OXT/EUR since: 2020-11-13T18:38:35.
2020-11-15 08:26:37,547 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 146077
2020-11-15 08:26:42,318 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 147076
2020-11-15 08:26:42,348 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair PAXG/EUR.
2020-11-15 08:26:42,896 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for PAXG/EUR since: 2020-11-13T19:26:18.
2020-11-15 08:26:42,896 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 77899
2020-11-15 08:26:47,769 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 78898
2020-11-15 08:26:47,788 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair QTUM/EUR.
2020-11-15 08:26:49,941 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for QTUM/EUR since: 2020-11-13T19:10:30.
2020-11-15 08:26:49,942 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 349436
2020-11-15 08:26:56,539 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 350435
2020-11-15 08:26:56,603 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair REP/EUR.
2020-11-15 08:27:07,987 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for REP/EUR since: 2020-11-13T19:02:17.
2020-11-15 08:27:07,987 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 1810662
2020-11-15 08:27:26,165 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 1811661
2020-11-15 08:27:26,472 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair REPV2/EUR.
2020-11-15 08:27:26,783 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for REPV2/EUR since: 2020-11-13T18:22:12.
2020-11-15 08:27:26,784 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 19962
2020-11-15 08:27:28,327 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 20961
2020-11-15 08:27:28,333 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair SC/EUR.
2020-11-15 08:27:29,883 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for SC/EUR since: 2020-11-13T19:13:11.
2020-11-15 08:27:29,883 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 215283
2020-11-15 08:27:35,192 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 216282
2020-11-15 08:27:35,232 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair SNX/EUR.
2020-11-15 08:27:35,424 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for SNX/EUR since: 2020-11-13T19:23:06.
2020-11-15 08:27:35,424 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 17850
2020-11-15 08:27:39,474 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 18849
2020-11-15 08:27:39,479 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair STORJ/EUR.
2020-11-15 08:27:40,037 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for STORJ/EUR since: 2020-11-13T19:17:31.
2020-11-15 08:27:40,037 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 89620
2020-11-15 08:27:47,066 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 90619
2020-11-15 08:27:47,086 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair TRX/EUR.
2020-11-15 08:27:50,013 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for TRX/EUR since: 2020-11-13T19:21:32.
2020-11-15 08:27:50,013 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 136467
2020-11-15 08:27:52,993 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 137466
2020-11-15 08:27:53,022 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair USDC/EUR.
2020-11-15 08:27:55,960 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for USDC/EUR since: 2020-11-13T19:31:43.
2020-11-15 08:27:55,961 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 311789
2020-11-15 08:28:00,900 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 312788
2020-11-15 08:28:00,961 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair USDT/EUR.
2020-11-15 08:28:11,728 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for USDT/EUR since: 2020-11-13T19:32:09.
2020-11-15 08:28:11,729 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 1693374
2020-11-15 08:28:28,386 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 1694373
2020-11-15 08:28:28,658 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair UNI/EUR.
2020-11-15 08:28:28,877 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for UNI/EUR since: 2020-11-13T19:27:55.
2020-11-15 08:28:28,878 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 6553
2020-11-15 08:28:29,417 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 7552
2020-11-15 08:28:29,419 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair WAVES/EUR.
2020-11-15 08:28:30,626 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for WAVES/EUR since: 2020-11-13T18:22:44.
2020-11-15 08:28:30,626 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 189003
2020-11-15 08:28:37,060 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 190002
2020-11-15 08:28:37,098 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair XLM/EUR.
2020-11-15 08:28:50,431 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for XLM/EUR since: 2020-11-13T19:14:21.
2020-11-15 08:28:50,431 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 2039788
2020-11-15 08:29:10,708 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 2040787
2020-11-15 08:29:11,031 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair XMR/EUR.
2020-11-15 08:29:28,853 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for XMR/EUR since: 2020-11-13T19:27:06.
2020-11-15 08:29:28,854 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 2598298
2020-11-15 08:29:54,619 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 2599297
2020-11-15 08:29:55,133 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair XRP/EUR.
2020-11-15 08:30:54,530 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for XRP/EUR since: 2020-11-13T19:37:03.
2020-11-15 08:30:54,531 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 8825664
2020-11-15 08:32:36,797 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 8832167
2020-11-15 08:32:38,424 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair XTZ/EUR.
2020-11-15 08:32:49,047 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for XTZ/EUR since: 2020-11-13T19:34:02.
2020-11-15 08:32:49,047 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 1373390
2020-11-15 08:33:02,590 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 1374389
2020-11-15 08:33:02,857 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair YFI/EUR.
2020-11-15 08:33:03,197 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for YFI/EUR since: 2020-11-13T19:37:43.
2020-11-15 08:33:03,197 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 6551
2020-11-15 08:33:04,191 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 7550
2020-11-15 08:33:04,194 - freqtrade.data.history.history_utils - INFO - Downloading trades for pair ZEC/EUR.
2020-11-15 08:33:14,707 - freqtrade.data.history.history_utils - INFO - Using last trade date -5s - Downloading trades for ZEC/EUR since: 2020-11-13T19:29:55.
2020-11-15 08:33:14,708 - freqtrade.data.history.history_utils - INFO - Current Amount of trades: 1669804
2020-11-15 08:33:31,070 - freqtrade.data.history.history_utils - INFO - New Amount of trades: 1670803
  ```



Discussion:
A quick way to verify this is the following (first downloading 2 days, and then only one day).

``` bash
freqtrade download-data --data-format-trades hdf5 --config config_kraken.json.example --pairs XRP/EUR --days 2

freqtrade download-data --data-format-trades hdf5 --config config_kraken.json.example --pairs XRP/EUR --days 1
```

Currently, with HDF5, the amount of data increases with each iteration by 1000 trades (as you correctly state).
I expected this to be then just 1000 above the expected, but NaN is not removed at all - causing this to break.

Will fix this shortly - thanks for discovering!

Resolving patch:
diff --git a/freqtrade/data/history/hdf5datahandler.py b/freqtrade/data/history/hdf5datahandler.py
--- a/freqtrade/data/history/hdf5datahandler.py
+++ b/freqtrade/data/history/hdf5datahandler.py
@@ -3,6 +3,7 @@
 from pathlib import Path
 from typing import List, Optional
 
+import numpy as np
 import pandas as pd
 
 from freqtrade import misc
@@ -175,7 +176,8 @@ def _trades_load(self, pair: str, timerange: Optional[TimeRange] = None) -> Trad
             if timerange.stoptype == 'date':
                 where.append(f"timestamp < {timerange.stopts * 1e3}")
 
-        trades = pd.read_hdf(filename, key=key, mode="r", where=where)
+        trades: pd.DataFrame = pd.read_hdf(filename, key=key, mode="r", where=where)
+        trades[['id', 'type']] = trades[['id', 'type']].replace({np.nan: None})
         return trades.values.tolist()
 
     def trades_purge(self, pair: str) -> bool:


Test patch:
diff --git a/tests/data/test_history.py b/tests/data/test_history.py
--- a/tests/data/test_history.py
+++ b/tests/data/test_history.py
@@ -724,6 +724,8 @@ def test_hdf5datahandler_trades_load(testdatadir):
 
     trades2 = dh._trades_load('XRP/ETH', timerange)
     assert len(trades) > len(trades2)
+    # Check that ID is None (If it's nan, it's wrong)
+    assert trades2[0][2] is None
 
     # unfiltered load has trades before starttime
     assert len([t for t in trades if t[0] < timerange.startts * 1000]) >= 0