get_somewhat_realistic_max_liquidity#
API documentation for tradingstrategy.utils.liquidity_filter.get_somewhat_realistic_max_liquidity Python function.
- get_somewhat_realistic_max_liquidity(liquidity_df, pair_id, samples=10, broken_liquidity=100000000)[source]#
Get the max liquidity of a trading pair over its history.
Get the token by its maximum ever liquidity, so we avoid survivorship bias
Instead of picking the absolute top, we pick n top samples and choose lowest of those
This allows us to avoid data sampling issues when the liquidity value, as calculated with the function of price, might have been weird when the token launched
- Parameters:
broken_liquidity – Cannot have more than 100M USD
- Return type: