/// <summary>Reset the simulation back to the start time</summary> public void Reset() { // Reset the account Acct.AccountId = "Simulation"; Acct.BrokerName = "Rylogic Ltd"; Acct.Currency = "Spon"; Acct.Balance = StartingBalance; Acct.Equity = StartingBalance; Acct.FreeMargin = 100.0; Acct.IsLive = false; Acct.Leverage = 500; Acct.Margin = 100.0; Acct.UnrealizedGrossProfit = 0.0; Acct.UnrealizedNetProfit = 0.0; // Reset trades Positions.Clear(); Pending.Clear(); // Reset the sim clock UtcNow = StartTime; // Update the simulated account status SendAccountStatus(); SendCurrentPositions(); SendPendingPositions(); // Notify reset OnSimReset(); }
public Task Import(Stream xmlData, bool append) { return(Task.Run(() => { var import = EntitySerializer.Deserialize <ToDoItem[]>(xmlData); if (append) { _db.Todo.Save(import); } else { _db.Todo.DeleteAll(); _db.Todo.Save(import); } _application.CurrentDispatcher.Invoke(() => { Pending.Clear(); Pending.AddRange(_db.Todo.GetUncompleted()); Completed.Clear(); Completed.AddRange(_db.Todo.GetCompleteded()); }); })); }
public void Clear() { CurrentList.Clear(); Pending.Clear(); }
void IDisposable.Dispose() { _disposeJobs(); Pending.Clear(); Finished.Clear(); }