Prepare protections for backtesting

This commit is contained in:
Matthias
2020-11-16 20:09:34 +01:00
parent 3426e99b8b
commit 98c88fa58e
6 changed files with 84 additions and 34 deletions

View File

@@ -44,11 +44,8 @@ class MaxDrawdown(IProtection):
Evaluate recent trades for drawdown ...
"""
look_back_until = date_now - timedelta(minutes=self._lookback_period)
filters = [
Trade.is_open.is_(False),
Trade.close_date > look_back_until,
]
trades = Trade.get_trades(filters).all()
trades = Trade.get_trades_proxy(is_open=False, close_date=look_back_until)
trades_df = pd.DataFrame([trade.to_json() for trade in trades])