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

@@ -167,8 +167,15 @@ class Edge:
pair_data = pair_data.sort_values(by=['date'])
pair_data = pair_data.reset_index(drop=True)
df_analyzed = self.strategy.advise_sell(
self.strategy.advise_buy(pair_data, {'pair': pair}), {'pair': pair})[headers].copy()
df_analyzed = self.strategy.advise_exit(
dataframe=self.strategy.advise_enter(
dataframe=pair_data,
metadata={'pair': pair},
is_short=False
),
metadata={'pair': pair},
is_short=False
)[headers].copy()
trades += self._find_trades_for_stoploss_range(df_analyzed, pair, self._stoploss_range)