API documentation for tradingstrategy.utils.groupeduniverse.fix_bad_wicks Python function.
- fix_bad_wicks(df, threshold=(0.1, 1.9), too_slow_threshold=15)#
Correct out bad high/low values in OHLC data.
On Uniswap v2 and compatibles, Bad wicks are caused by e.g. very large flash loan, oracle price manipulation attacks, and misbheaving bots.
This function removes bad high/low values and sets them to open/close if they seem to be wildly out of sample.