Remove asset restrictions and make asset groups smarter
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user