Improve backtest performance

This commit is contained in:
Matthias
2021-03-13 10:16:32 +01:00
parent ef9977fc1e
commit d1acc8092c
5 changed files with 42 additions and 9 deletions

View File

@@ -191,7 +191,7 @@ def create_mock_trades(fee, use_db: bool = True):
if use_db:
Trade.session.add(trade)
else:
LocalTrade.trades.append(trade)
LocalTrade.add_bt_trade(trade)
# Simulate dry_run entries
trade = mock_trade_1(fee)

View File

@@ -1196,6 +1196,6 @@ def test_Trade_object_idem():
# Fails if only a column is added without corresponding parent field
for item in localtrade:
if (not item.startswith('__')
and item not in ('trades', )
and item not in ('trades', 'trades_open', 'total_profit')
and type(getattr(LocalTrade, item)) not in (property, FunctionType)):
assert item in trade