Write tests for asset filter
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user