public string GetLastExecutionDescription() { if (LastExecution == null) { return("None"); } return(LastExecution.ToString()); }
protected virtual void ReadExecutions() { var query = $"select [side], [execType], [ordStatus], [ordType], [price], [stopPx], [leavesQty], [cumQty], [orderQty], [lastQty], [execID], [orderID], [timestamp] from [{ExecutionTable}] where [timestamp] > '{LastExecution.ToString(Const.DATETIME_FORMAT)}'"; var result = Database.Select(query).Rows; Executions.Clear(); foreach (DataRow row in result) { var execution = new Execution(row); Executions[execution.OrderId] = execution; updateTimestamps(execution); } void updateTimestamps(Execution execution) { if (execution.Timestamp > LastExecution) { LastExecution = execution.Timestamp; } if (execution.OrdStatus == OrdStatus.Filled) { LastFills[(Side)execution.Side] = execution.Timestamp; } } }