Write tests for asset filter

This commit is contained in:
2023-02-11 18:22:49 +00:00
parent ce0b75ae2d
commit 313c7f79d0
5 changed files with 49 additions and 5 deletions

View File

@@ -326,8 +326,15 @@ def execute_strategy(callback, strategy, func):
price_bound = round(price_bound, display_precision)
# Callback now verified
# Check against the asset groups
if func == "entry":
allowed = assetfilter.get_allowed(strategy, symbol, direction)
if strategy.assetgroup is not None:
allowed = assetfilter.get_allowed(strategy, symbol, direction)
if not allowed:
log.debug(f"Asset trading not allowed for {strategy}: {symbol}")
return
if func == "exit":
check_exit = crossfilter(account, symbol, direction, func)
if check_exit is None: