fix: 开仓时间读CTP OpenDate,止盈止损持久化且重启不丢失
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -77,8 +77,8 @@ def today_str() -> str:
|
||||
|
||||
def calc_holding_duration(open_time: str, close_time: str) -> str:
|
||||
try:
|
||||
o = datetime.fromisoformat(open_time.strip())
|
||||
c = datetime.fromisoformat(close_time.strip())
|
||||
o = datetime.fromisoformat(open_time.strip().replace(" ", "T")[:19])
|
||||
c = datetime.fromisoformat(close_time.strip().replace(" ", "T")[:19])
|
||||
delta = c - o
|
||||
if delta.total_seconds() < 0:
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user