Support multis-strategy backtests with protections

This commit is contained in:
Matthias
2020-11-25 09:53:13 +01:00
parent a3f9cd2c26
commit 75a5161650
5 changed files with 64 additions and 4 deletions

View File

@@ -327,6 +327,14 @@ class Trade(_DECL_BASE):
'open_order_id': self.open_order_id,
}
@staticmethod
def reset_trades() -> None:
"""
Resets all trades. Only active for backtesting mode.
"""
if not Trade.use_db:
Trade.trades = []
def adjust_min_max_rates(self, current_price: float) -> None:
"""
Adjust the max_rate and min_rate.

View File

@@ -21,6 +21,14 @@ class PairLocks():
timeframe: str = ''
@staticmethod
def reset_locks() -> None:
"""
Resets all locks. Only active for backtesting mode.
"""
if not PairLocks.use_db:
PairLocks.locks = []
@staticmethod
def lock_pair(pair: str, until: datetime, reason: str = None, *, now: datetime = None) -> None:
"""