fix next_day calculation
This commit is contained in:
parent
d5548fd61c
commit
3feaeccf25
@ -30,8 +30,12 @@ class TradingTime(IProtection):
|
|||||||
now.replace(hour=self._end_time.hour, minute=self._end_time.minute, second=0)
|
now.replace(hour=self._end_time.hour, minute=self._end_time.minute, second=0)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if now < self.trade_start:
|
||||||
|
self.next_trading_day = self.trade_start
|
||||||
|
else:
|
||||||
self.next_trading_day = self.trade_start + timedelta(days=1)
|
self.next_trading_day = self.trade_start + timedelta(days=1)
|
||||||
|
|
||||||
|
|
||||||
def short_desc(self) -> str:
|
def short_desc(self) -> str:
|
||||||
"""
|
"""
|
||||||
Short method description - used for startup-messages
|
Short method description - used for startup-messages
|
||||||
|
Loading…
Reference in New Issue
Block a user