Great discount if you pay using cryptocurrencies! Bitcoin, Litecoin & Dash accepted.



First of all, what is backtesting? It is the general method for seeing how well a strategy would have done in the past. Backtesting verifies the viability of a trading strategy by simulating how it would play out using historical data.

We’ll backtest the strategy example strategy we created using Bollinger Band and RSI using freqtrade

After setting up the strategy, and placing it on user_data/strategies, we change our directory to the freqtrade main folder and proceed as follows:

$ freqtrade -c configfile backtesting –-strategy-list strategy1 –-ticker-interval=timeframe –-timerange=YEARMMDAY-YEARMMDAY

We’ll replace configfile by the name of our configuration file, strategy1 with the class name of the strategy, ticker interval with the supported timeframe that I want to test on the given exchange, in this case, we’ll be using 15m and we want to test on the timerange 20190601 to 20190701. We will test this strategy on the following USDT pairs: BTC, ETH, LTC, XMR and LINK (which are set on the configuration file) so it looks like this (add –refresh-pairs-cached if you need to download the trading data from binance)

$ freqtrade -c config.usdt.json backtesting –-strategy-list bbrsi –-ticker-interval=15m –-timerange=20190601-20190701 –refresh-pairs-cached

You only need to use –refresh-pairs-cached to refresh your historical database which is located on freqtrade/user_data/data/binance/

You can see the whole backtesting result at:

Interpreting the results

Whoops, this section is for members only. If you have a membership, please log in. If not, you can definitely get access by buying one of our plans! Purchase the essential plan or Purchase the Professional Plan .

Modify parameters and re-test

Let’s re-test this strategy on a bigger time frame, say 4 hour, we just need to run the same command as before but changing ticker-interval to 4hr

$ freqtrade -c config.usdt.json backtesting --strategy-list bbrsi --ticker-interval=4h --timerange=20190601-20190701 --refresh-pairs-cached

On this new ticker interval we get a 2.61% profit in just a single month, with a total of 12 buys, 7 stop_loss hit, 4 roi hits (meaning the position did reach our roi target, and 1 sell signal.

You can see the whole backtesting result here:

Feel free to play around with more pairs, indicators, roi %, stoploss %, etc but try to avoid over fitting as it might give you unreliable results that might not repeat in the future. In our next post we’ll speak about common back testing mistakes from author Ernest Chan.

Leave a Reply

Your email address will not be published. Required fields are marked *

Privacy Settings
We use cookies to enhance your experience while using our website. If you are using our Services via a browser you can restrict, block or remove cookies through your web browser settings. We also use content and scripts from third parties that may use tracking technologies. You can selectively provide your consent below to allow such third party embeds. For complete information about the cookies we use, data we collect and how we process them, please check our Privacy Policy
Consent to display content from Youtube
Consent to display content from Vimeo
Google Maps
Consent to display content from Google
Consent to display content from Spotify
Sound Cloud
Consent to display content from Sound
Cart Overview