diff --git a/docs/recursive-analysis.md b/docs/recursive-analysis.md index 86b358830..10c1fe077 100644 --- a/docs/recursive-analysis.md +++ b/docs/recursive-analysis.md @@ -17,10 +17,10 @@ This command is built upon backtesting since it internally chains backtests to p This is done by not looking at the strategy itself - but at the value of the indicators it returned. After multiple backtests are done to calculate the indicators of different startup candles value, the values of last rows are compared to see hoe much differences are they compared to the base backtest. - `--cache` is forced to "none". -- Since we are only looking at indicators' value, using more than one pair is redundant. It is recommended to set the pair used in the command using `-p` flag, preferably using pair with high price, such as BTC or ETH, to avoid having rounding issue that can make the results inaccurate. If no pair is set on the command, the pair used for this analysis the first pair in the whitelist. +- Since we are only looking at indicators' value, using more than one pair is redundant. It is recommended to set the pair used in the command using `-p` flag, preferably using pair with high price, such as BTC or ETH, to avoid having rounding issue that can make the results inaccurate. If no pair is set on the command, the pair used for this analysis is the first pair in the whitelist. - It's recommended to set a long timerange (at least consist of 5000 candles), so that the initial backtest that going to be used as benchmark have very small or no recursive issue at all. For example, for a 5m timeframe, timerange of 5000 candles would be equal to 18 days. -Beside recursive formula check, this command also going to do a simple lookahead bias check on the indicators' value only. It won't replace [Lookahead-analysis](lookahead-analysis.md), since this check won't check the difference in trades' entries and exits. It will only check whether there is any difference in indicators' value if the end of the data are moved. +Beside recursive formula check, this command also going to do a simple lookahead bias check on the indicators' value only. It won't replace [Lookahead-analysis](lookahead-analysis.md), since this check won't check the difference in trades' entries and exits, which is the important effect of lookahead bias. It will only check whether there is any lookahead bias in indicators if the end of the data are moved. ## Recursive-analysis command reference @@ -40,36 +40,16 @@ usage: freqtrade recursive-analysis [-h] [-v] [--logfile FILE] [-V] [-c PATH] ### Summary -Checks a given strategy for look ahead bias via lookahead-analysis -Look ahead bias means that the backtest uses data from future candles thereby not making it viable beyond backtesting -and producing false hopes for the one backtesting. - -### Introduction - -Many strategies - without the programmer knowing - have fallen prey to look ahead bias. - -Any backtest will populate the full dataframe including all time stamps at the beginning. -If the programmer is not careful or oblivious how things work internally -(which sometimes can be really hard to find out) then it will just look into the future making the strategy amazing -but not realistic. - -This command is made to try to verify the validity in the form of the aforementioned look ahead bias. +Checks a given strategy for recursive formula issue via recursive-analysis. +Recursive formula issue means that the indicator's calculation don't have enough data for its calculation to produce correct value. ### How does the command work? -It will start with a backtest of all pairs to generate a baseline for indicators and entries/exits. -After the backtest ran, it will look if the `minimum-trade-amount` is met -and if not cancel the lookahead-analysis for this strategy. - -After setting the baseline it will then do additional runs for every entry and exit separately. -When a verification-backtest is done, it will compare the indicators as the signal (either entry or exit) and report the bias. -After all signals have been verified or falsified a result-table will be generated for the user to see. +It will start with a backtest using the supplied timerange to generate a baseline for indicators' value. +After setting the baseline it will then do additional runs for each different startup candles. +When the additional runs are done, it will compare the indicators at the last rows and report the differences in a table. ### Caveats -- `lookahead-analysis` can only verify / falsify the trades it calculated and verified. -If the strategy has many different signals / signal types, it's up to you to select appropriate parameters to ensure that all signals have triggered at least once. Not triggered signals will not have been verified. -This could lead to a false-negative (the strategy will then be reported as non-biased). -- `lookahead-analysis` has access to everything that backtesting has too. -Please don't provoke any configs like enabling position stacking. -If you decide to do so, then make doubly sure that you won't ever run out of `max_open_trades` amount and neither leftover money in your wallet. +- `recursive-analysis` will only calculate and compare the indicators' value at the last row. If there are any differences, the table will only tell you the percentage differences. Whether it has any real impact on your entries and exits isn't checked. +- The ideal scenario is to have your indicators have no difference at all despite the startup candle being varied. But in reality, some of publicly-available formulas are using recursive formula. So the goal isn't to have zero differences, but to have the differences low enough to make sure they won't have any real impact on trading decisions.