From 1a6ddfcaebaf2c75c67aca115379db70aa9d96c1 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 29 Apr 2020 10:37:48 +0200 Subject: [PATCH 1/3] Be clear on evaluation logic during backtesting --- docs/backtesting.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/backtesting.md b/docs/backtesting.md index d6775e17c..d5a4cf3a7 100644 --- a/docs/backtesting.md +++ b/docs/backtesting.md @@ -202,7 +202,8 @@ Since backtesting lacks some detailed information about what happens within a ca - Buys happen at open-price - Sell signal sells happen at open-price of the following candle -- Low happens before high for stoploss, protecting capital first. +- Low happens before high for stoploss, protecting capital first +- Stoploss is evaluated before ROI - ROI - sells are compared to high - but the ROI value is used (e.g. ROI = 2%, high=5% - so the sell will be at 2%) - sells are never "below the candle", so a ROI of 2% may result in a sell at 2.4% if low was at 2.4% profit From 74281a16fdda730216e13d1654766a14432e664b Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 29 Apr 2020 10:39:55 +0200 Subject: [PATCH 2/3] Move to the last point and clarify further --- docs/backtesting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/backtesting.md b/docs/backtesting.md index d5a4cf3a7..1f518658d 100644 --- a/docs/backtesting.md +++ b/docs/backtesting.md @@ -203,7 +203,6 @@ Since backtesting lacks some detailed information about what happens within a ca - Buys happen at open-price - Sell signal sells happen at open-price of the following candle - Low happens before high for stoploss, protecting capital first -- Stoploss is evaluated before ROI - ROI - sells are compared to high - but the ROI value is used (e.g. ROI = 2%, high=5% - so the sell will be at 2%) - sells are never "below the candle", so a ROI of 2% may result in a sell at 2.4% if low was at 2.4% profit @@ -213,6 +212,7 @@ Since backtesting lacks some detailed information about what happens within a ca - High happens first - adjusting stoploss - Low uses the adjusted stoploss (so sells with large high-low difference are backtested correctly) - Sell-reason does not explain if a trade was positive or negative, just what triggered the sell (this can look odd if negative ROI values are used) +- Stoploss (and trailing stoploss) is evaluated before ROI within one candle Taking these assumptions, backtesting tries to mirror real trading as closely as possible. However, backtesting will **never** replace running a strategy in dry-run mode. Also, keep in mind that past results don't guarantee future success. From 69b44234a48245c546ac0eb3d21b7fc6052e1034 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 29 Apr 2020 10:47:53 +0200 Subject: [PATCH 3/3] Update docs/backtesting.md Co-Authored-By: hroff-1902 <47309513+hroff-1902@users.noreply.github.com> --- docs/backtesting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/backtesting.md b/docs/backtesting.md index 1f518658d..9b2997510 100644 --- a/docs/backtesting.md +++ b/docs/backtesting.md @@ -212,7 +212,7 @@ Since backtesting lacks some detailed information about what happens within a ca - High happens first - adjusting stoploss - Low uses the adjusted stoploss (so sells with large high-low difference are backtested correctly) - Sell-reason does not explain if a trade was positive or negative, just what triggered the sell (this can look odd if negative ROI values are used) -- Stoploss (and trailing stoploss) is evaluated before ROI within one candle +- Stoploss (and trailing stoploss) is evaluated before ROI within one candle. So you can often see more trades with the `stoploss` and/or `trailing_stop` sell reason comparing to the results obtained with the same strategy in the Dry Run/Live Trade modes. Taking these assumptions, backtesting tries to mirror real trading as closely as possible. However, backtesting will **never** replace running a strategy in dry-run mode. Also, keep in mind that past results don't guarantee future success.