updated docs

This commit is contained in:
hippocritical
2023-06-09 23:32:58 +02:00
parent 6656740f21
commit 94ca2988a0
+23 -19
View File
@@ -5,8 +5,7 @@ Checking look ahead bias is the bane of any strategy since it is sometimes very
but very hard to detect. but very hard to detect.
Backtesting initializes all timestamps at once and calculates all indicators in the beginning. Backtesting initializes all timestamps at once and calculates all indicators in the beginning.
This means that if you are allowing your indicators (or the libraries that get used) then you would This means that if your indicators or entry/exit signals could look into future candles and falsify your backtest.
look into the future and falsify your backtest.
Lookahead-analysis requires historic data to be available. Lookahead-analysis requires historic data to be available.
To learn how to get data for the pairs and exchange you're interested in, To learn how to get data for the pairs and exchange you're interested in,
@@ -14,13 +13,15 @@ head over to the [Data Downloading](data-download.md) section of the documentati
This command is built upon backtesting This command is built upon backtesting
since it internally chains backtests and pokes at the strategy to provoke it to show look ahead bias. since it internally chains backtests and pokes at the strategy to provoke it to show look ahead bias.
This is done by looking not at the strategy itself - but at the results it returned. This is done by not looking at the strategy itself - but at the results it returned.
The results are things like changed indicator-values and moved entries/exits compared to the full backtest. The results are things like changed indicator-values and moved entries/exits compared to the full backtest.
You can use commands of [Backtesting](backtesting.md). You can use commands of [Backtesting](backtesting.md).
It also supports the lookahead-analysis of freqai strategies. It also supports the lookahead-analysis of freqai strategies.
--cache is enforced to be "none" - --cache is forced to "none"
- --max_open_trades is forced to be at least equal to the number of pairs
- --dry_run_wallet is forced to be basically infinite
## Backtesting command reference ## Backtesting command reference
@@ -46,7 +47,7 @@ optional arguments:
#### Summary #### Summary
Checks a given strategy for look ahead bias via backtest-analysis 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 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. and producing false hopes for the one backtesting.
@@ -61,19 +62,22 @@ but not realistic.
This command is made to try to verify the validity in the form of the aforementioned look ahead bias. This command is made to try to verify the validity in the form of the aforementioned look ahead bias.
#### How does the command work? #### How does the command work?
It will not look at the strategy or any contents itself but instead will run multiple backtests It will start with a backtest of all pairs to generate a baseline for indicators and entries/exits.
by using precisely cut timeranges and analyzing the results each time, comparing to the full timerange. After the backtest ran, it will look if the minimum-trade-amount is met
and if not cancel the lookahead-analysis for this strategy.
At first, it starts a backtest over the whole duration After setting the baseline it will then do additional runs for every entry and exit separately.
and then repeats backtests from the same starting point to the respective points to watch. When a verification-backtest is done, it will compare the indicators as the signal (either entry or exit)
In addition, it analyzes the dataframes form the overall backtest to the cut ones. and report the bias.
After all signals have been verified or falsified a result-table will be generated for the user to see.
At the end it will return a result-table in terminal. #### Caveats:
- The lookahead-analysis can only verify / falsify the trades it calculated through.
Hint: If there was a strategy with signals that were not triggered in the lookahead-analysis
If an entry or exit condition is only triggered rarely or the timerange was chosen then it will not have it verified that entry/exit signal either.
so only a few entry conditions are met This could then lead to a false-negative (the strategy will then be reported as non-biased).
then the bias checker is unable to catch the biased entry or exit condition. - lookahead-analysis has access to everything that backtesting has too.
In the end it only checks which entry and exit signals have been triggered. Please don't provoke any configs like enabling position stacking.
If you decide to do so,
---Flow chart here for better understanding--- then make doubly sure that you won't ever run out of max_open_trades
amount and neither leftover money in your wallet.