Remove asset restrictions and make asset groups smarter

This commit is contained in:
2023-02-13 07:20:40 +00:00
parent 287facbab2
commit dcfb963be6
10 changed files with 383 additions and 172 deletions

View File

@@ -12,3 +12,22 @@ def get_allowed(group, symbol, direction):
return True
return allowed[symbol]
def check_asset_aggregation(value, trigger_above, trigger_below):
"""
Check if the value is within the bounds of the aggregation
"""
# If both are defined
if trigger_above is not None and trigger_below is not None:
if value > trigger_above and value < trigger_below:
return True
return False
if trigger_below is not None:
if value < trigger_below:
# Value is less than lower bound, match
return True
if trigger_above is not None:
if value > trigger_above:
return True
return False