You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
375 B
Python
15 lines
375 B
Python
def get_allowed(group, symbol, direction):
|
|
"""
|
|
Determine whether the trade is allowed according to the Asset Groups
|
|
linked to the strategy.
|
|
"""
|
|
# TODO: figure out what to do with direction
|
|
|
|
allowed = group.allowed
|
|
if not isinstance(allowed, dict):
|
|
return False
|
|
if symbol not in allowed:
|
|
return True
|
|
|
|
return allowed[symbol]
|