Login Page - Create Account

Support Board


Date/Time: Mon, 16 Sep 2024 19:20:31 +0000



Post From: Error with Sim Lock & Orders being executed

[2024-07-04 15:32:16]
ForgivingComputers.com - Posts: 929
If you want to know if 15 minutes have passed, save the lock time, then keep checking if the current time is 15 minutes later.


SCDateTime& LockDateTime = sc.GetPersistentSCDateTime(1);
SCDateTime CurrentDateTime;

if (sc.IsReplayRunning())
  CurrentDateTime = sc.CurrentDateTimeForReplay;
else
  CurrentDateTime = sc.CurrentSystemDateTime;

bool Locked = false;
if (!Locked && sc.TradingIsLocked)
{
LockDateTime = CurrentDateTime;
Locked = true;
}

if (Locked && (CurrentDateTime - LockDateTime ) >= SCDateTime::MINUTES(15))
{
sc.SetTradingLockState(0);
Locked = false;
}


Date Time Of Last Edit: 2024-07-04 15:33:02