Add more hooks to active management

This commit is contained in:
2023-02-17 07:20:15 +00:00
parent dd3b3521d9
commit 1dbb3fcf79
17 changed files with 716 additions and 47 deletions

View File

@@ -53,7 +53,9 @@ def within_max_loss(strategy):
def within_trends(strategy, symbol, direction):
print("WITHIN TRENDS", symbol, direction)
if strategy.trend_signals.exists():
print("TREND SIGNALS EXIST")
if strategy.trends is None:
log.debug("Refusing to trade with no trend signals received")
sendmsg(
@@ -82,6 +84,9 @@ def within_trends(strategy, symbol, direction):
else:
log.debug(f"Trend check passed for {symbol} - {direction}")
return True
else:
log.debug("No trend signals configured")
return True
def within_position_size(strategy):