Imrpove code by reusing available properties

This commit is contained in:
Matthias
2022-01-23 18:59:09 +01:00
parent cc3852daf3
commit 7429f535c1
6 changed files with 7 additions and 8 deletions

View File

@@ -383,8 +383,7 @@ class Backtesting:
if self.strategy.position_adjustment_enable:
check_adjust_buy = True
if self.strategy.max_buy_position_adjustment > -1:
filled_buys = trade.select_filled_orders('buy')
count_of_buys = len(filled_buys)
count_of_buys = trade.nr_of_successful_buys
check_adjust_buy = (count_of_buys <= self.strategy.max_buy_position_adjustment)
if check_adjust_buy:
trade = self._get_adjust_trade_entry_for_candle(trade, sell_row)