Updating your historical data is a must in order to create a reliable strategy when doing algorithmic trading.
Initially, it’s good that you have a default configuration file for this purpose, which has to contain all pairs of data you want to download, say USDT or BTC or ETH.
We’ll assume you have your freqtrade folder in your home folder.
- For our bash script we’ll create an empty file in your home folder with name “download-data” and copy-paste the script below
- Modify the initial variables to match your desired configuration
$ chmod +x download-data(this will make the script executable)
#!/bin/bash #Replace the following variables to match your own environment #--------------------- CONFIG=algo.json TIMEFRAMES='15m 1h 4h 6h 12h 1d 1w' EXCHANGE=binance #--------------------- echo "starting downloading data" cd ~/freqtrade/ freqtrade -c /home/$USER/freqtrade/$CONFIG download-data -t $TIMEFRAMES --days 9 --exchange $EXCHANGE
We’ll be using crontab in order to execute a bash script that will run freqtrade with the command to download all the historical data you want from a specific config file.
$ crontab -e
- Type in the following line
0 0 * * 0 /home/$USER/download-data
That command will then execute every week at 12 AM on at the beginning of the week and proceed to download all the historical data of the pairs included in your json file.
Using Historical Data
The data downloaded by freqtrade is on
~/freqtrade/user_data/data/exchange. There are multiple ways to use it:
- You can download it to your data analysis station and run statistics on it by hand
- You can use it to backtest within freqtrade.