Fix some type errors
This commit is contained in:
parent
52acacbed5
commit
394a6bbf2a
@ -274,7 +274,7 @@ class Backtesting:
|
|||||||
except DependencyException:
|
except DependencyException:
|
||||||
stake_amount = 0
|
stake_amount = 0
|
||||||
min_stake_amount = self.exchange.get_min_pair_stake_amount(pair, row[OPEN_IDX], -0.05)
|
min_stake_amount = self.exchange.get_min_pair_stake_amount(pair, row[OPEN_IDX], -0.05)
|
||||||
if stake_amount and stake_amount > min_stake_amount:
|
if stake_amount and (not min_stake_amount or stake_amount > min_stake_amount):
|
||||||
# print(f"{pair}, {stake_amount}")
|
# print(f"{pair}, {stake_amount}")
|
||||||
# Enter trade
|
# Enter trade
|
||||||
trade = Trade(
|
trade = Trade(
|
||||||
@ -341,7 +341,7 @@ class Backtesting:
|
|||||||
indexes: Dict = {}
|
indexes: Dict = {}
|
||||||
tmp = start_date + timedelta(minutes=self.timeframe_min)
|
tmp = start_date + timedelta(minutes=self.timeframe_min)
|
||||||
|
|
||||||
open_trades: Dict[str, List] = defaultdict(list)
|
open_trades: Dict[str, List[Trade]] = defaultdict(list)
|
||||||
open_trade_count = 0
|
open_trade_count = 0
|
||||||
|
|
||||||
# Loop timerange and get candle for each pair at that point in time
|
# Loop timerange and get candle for each pair at that point in time
|
||||||
|
@ -479,9 +479,9 @@ def text_table_add_metrics(strat_results: Dict) -> str:
|
|||||||
('', ''), # Empty line to improve readability
|
('', ''), # Empty line to improve readability
|
||||||
|
|
||||||
('Min balance', round_coin_value(strat_results['csum_min'],
|
('Min balance', round_coin_value(strat_results['csum_min'],
|
||||||
strat_results['stake_currency'])),
|
strat_results['stake_currency'])),
|
||||||
('Max balance', round_coin_value(strat_results['csum_max'],
|
('Max balance', round_coin_value(strat_results['csum_max'],
|
||||||
strat_results['stake_currency'])),
|
strat_results['stake_currency'])),
|
||||||
|
|
||||||
('Drawdown', f"{round(strat_results['max_drawdown'] * 100, 2)}%"),
|
('Drawdown', f"{round(strat_results['max_drawdown'] * 100, 2)}%"),
|
||||||
('Drawdown', round_coin_value(strat_results['max_drawdown_abs'],
|
('Drawdown', round_coin_value(strat_results['max_drawdown_abs'],
|
||||||
|
Loading…
Reference in New Issue
Block a user