Added short and exit_short to strategy

This commit is contained in:
Sam Germain
2021-08-08 03:38:34 -06:00
parent 98fe3e73de
commit d4a7d2d444
24 changed files with 862 additions and 152 deletions

View File

@@ -51,6 +51,7 @@ class HyperOptResolver(IResolver):
if not hasattr(hyperopt, 'populate_sell_trend'):
logger.info("Hyperopt class does not provide populate_sell_trend() method. "
"Using populate_sell_trend from the strategy.")
# TODO-lev: Short equivelents?
return hyperopt

View File

@@ -202,9 +202,14 @@ class StrategyResolver(IResolver):
strategy._populate_fun_len = len(getfullargspec(strategy.populate_indicators).args)
strategy._buy_fun_len = len(getfullargspec(strategy.populate_buy_trend).args)
strategy._sell_fun_len = len(getfullargspec(strategy.populate_sell_trend).args)
strategy._short_fun_len = len(getfullargspec(strategy.populate_short_trend).args)
strategy._exit_short_fun_len = len(
getfullargspec(strategy.populate_exit_short_trend).args)
if any(x == 2 for x in [strategy._populate_fun_len,
strategy._buy_fun_len,
strategy._sell_fun_len]):
strategy._sell_fun_len,
strategy._short_fun_len,
strategy._exit_short_fun_len]):
strategy.INTERFACE_VERSION = 1
return strategy