public Portfolio Reconstruct(DateTime dateTime) { Portfolio portfolio = new Portfolio(); foreach (Transaction transaction in this.transactions) { if (transaction.DateTime <= dateTime) { portfolio.Add(transaction); } } portfolio.Account.Clear(); foreach (AccountTransaction transaction in this.account.Transactions) { if (transaction.DateTime <= dateTime) { portfolio.Account.Add(transaction); } } return(portfolio); }
public Portfolio Consolidate(Portfolio portfolio) { TransactionList transactionList = new TransactionList(); foreach (Transaction transaction in this.Transactions) { transactionList.Add(transaction, false); } foreach (Transaction transaction in portfolio.Transactions) { transactionList.Add(transaction, false); } transactionList.Sort(); Portfolio portfolio1 = new Portfolio(); foreach (Transaction transaction in transactionList) { portfolio1.Add(transaction); } portfolio1.Account.Clear(); AccountTransactionList accountTransactionList = new AccountTransactionList(); foreach (AccountTransaction transaction in this.Account.Transactions) { accountTransactionList.Add(transaction); } foreach (AccountTransaction transaction in portfolio.Account.Transactions) { accountTransactionList.Add(transaction); } foreach (AccountTransaction transaction in accountTransactionList) { portfolio1.Account.Add(transaction); } return(portfolio1); }
private void DdBEZNiZyZ(Portfolio obj0) { obj0.LwTsbC870d(true); IDbCommand command1 = this.connection.CreateCommand(); // command1.CommandText = gUqQbWj9pYGI8tO6Z8.iW3dklQ6Dr(7996); // FIXDbServer.SetCommandParameter(command1, gUqQbWj9pYGI8tO6Z8.iW3dklQ6Dr(8138), DbType.Int32, (object) obj0.Id); IDataReader dataReader1 = command1.ExecuteReader(); while (dataReader1.Read()) { int int32_1 = dataReader1.GetInt32(0); dataReader1.GetInt32(1); string string1 = dataReader1.GetString(2); int int32_2 = dataReader1.GetInt32(3); DateTime dateTime = dataReader1.GetDateTime(4); int int32_3 = dataReader1.GetInt32(5); string string2 = dataReader1.GetString(6); double double1 = dataReader1.GetDouble(7); double double2 = dataReader1.GetDouble(8); string string3 = dataReader1.GetString(9); string string4 = dataReader1.GetString(10); string string5 = dataReader1.GetString(11); double double3 = dataReader1.GetDouble(12); string string6 = dataReader1.GetString(13); Transaction transaction = new Transaction(); transaction.nx8WA03O1L(int32_1); transaction.ClOrdID = string1; transaction.ReportId = int32_2; transaction.DateTime = dateTime; transaction.Instrument = InstrumentManager.Instruments.GetById(int32_3); transaction.Side = FIXSide.FromFIX(string2[0]); transaction.Price = double1; transaction.Qty = double2; transaction.Text = string3; TransactionCost transactionCost = (TransactionCost)Activator.CreateInstance(Type.GetType(string.Format("s", (object)string5, (object)string4)), true); transactionCost.CommType = FIXCommType.FromFIX(string6[0]); transactionCost.Commission = double3; transaction.TransactionCost = transactionCost; if (transaction.Instrument == null) { transaction.Instrument = this.xKIEA4RkYI(int32_3); } obj0.Add(transaction); } dataReader1.Close(); command1.Dispose(); IDbCommand command2 = this.connection.CreateCommand(); // command2.CommandText = gUqQbWj9pYGI8tO6Z8.iW3dklQ6Dr(8180); FIXDbServer.SetCommandParameter(command2, "sss", DbType.Int32, (object)obj0.Id); IDataReader dataReader2 = command2.ExecuteReader(); while (dataReader2.Read()) { int int32 = dataReader2.GetInt32(0); dataReader2.GetInt32(1); DateTime dateTime = dataReader2.GetDateTime(2); string @string = dataReader2.GetString(3); double @double = dataReader2.GetDouble(4); string str = dataReader2.IsDBNull(5) ? "" : dataReader2.GetString(5); AccountTransaction transaction = new AccountTransaction(); transaction.G7YBAhR7LA(int32); transaction.DateTime = dateTime; transaction.Currency = CurrencyManager.Currencies[@string]; transaction.Value = @double; transaction.Text = str; obj0.Account.Add(transaction); } dataReader2.Close(); command2.Dispose(); obj0.LwTsbC870d(false); }
public Portfolio Consolidate(Portfolio portfolio) { TransactionList transactionList = new TransactionList(); foreach (Transaction transaction in this.Transactions) transactionList.Add(transaction, false); foreach (Transaction transaction in portfolio.Transactions) transactionList.Add(transaction, false); transactionList.Sort(); Portfolio portfolio1 = new Portfolio(); foreach (Transaction transaction in transactionList) portfolio1.Add(transaction); portfolio1.Account.Clear(); AccountTransactionList accountTransactionList = new AccountTransactionList(); foreach (AccountTransaction transaction in this.Account.Transactions) accountTransactionList.Add(transaction); foreach (AccountTransaction transaction in portfolio.Account.Transactions) accountTransactionList.Add(transaction); foreach (AccountTransaction transaction in accountTransactionList) portfolio1.Account.Add(transaction); return portfolio1; }
public Portfolio Reconstruct(DateTime dateTime) { Portfolio portfolio = new Portfolio(); foreach (Transaction transaction in this.transactions) { if (transaction.DateTime <= dateTime) portfolio.Add(transaction); } portfolio.Account.Clear(); foreach (AccountTransaction transaction in this.account.Transactions) { if (transaction.DateTime <= dateTime) portfolio.Account.Add(transaction); } return portfolio; }
private void DdBEZNiZyZ(Portfolio obj0) { obj0.LwTsbC870d(true); IDbCommand command1 = this.connection.CreateCommand(); // command1.CommandText = gUqQbWj9pYGI8tO6Z8.iW3dklQ6Dr(7996); // FIXDbServer.SetCommandParameter(command1, gUqQbWj9pYGI8tO6Z8.iW3dklQ6Dr(8138), DbType.Int32, (object) obj0.Id); IDataReader dataReader1 = command1.ExecuteReader(); while (dataReader1.Read()) { int int32_1 = dataReader1.GetInt32(0); dataReader1.GetInt32(1); string string1 = dataReader1.GetString(2); int int32_2 = dataReader1.GetInt32(3); DateTime dateTime = dataReader1.GetDateTime(4); int int32_3 = dataReader1.GetInt32(5); string string2 = dataReader1.GetString(6); double double1 = dataReader1.GetDouble(7); double double2 = dataReader1.GetDouble(8); string string3 = dataReader1.GetString(9); string string4 = dataReader1.GetString(10); string string5 = dataReader1.GetString(11); double double3 = dataReader1.GetDouble(12); string string6 = dataReader1.GetString(13); Transaction transaction = new Transaction(); transaction.nx8WA03O1L(int32_1); transaction.ClOrdID = string1; transaction.ReportId = int32_2; transaction.DateTime = dateTime; transaction.Instrument = InstrumentManager.Instruments.GetById(int32_3); transaction.Side = FIXSide.FromFIX(string2[0]); transaction.Price = double1; transaction.Qty = double2; transaction.Text = string3; TransactionCost transactionCost = (TransactionCost)Activator.CreateInstance(Type.GetType(string.Format("s", (object)string5, (object)string4)), true); transactionCost.CommType = FIXCommType.FromFIX(string6[0]); transactionCost.Commission = double3; transaction.TransactionCost = transactionCost; if (transaction.Instrument == null) transaction.Instrument = this.xKIEA4RkYI(int32_3); obj0.Add(transaction); } dataReader1.Close(); command1.Dispose(); IDbCommand command2 = this.connection.CreateCommand(); // command2.CommandText = gUqQbWj9pYGI8tO6Z8.iW3dklQ6Dr(8180); FIXDbServer.SetCommandParameter(command2, "sss", DbType.Int32, (object)obj0.Id); IDataReader dataReader2 = command2.ExecuteReader(); while (dataReader2.Read()) { int int32 = dataReader2.GetInt32(0); dataReader2.GetInt32(1); DateTime dateTime = dataReader2.GetDateTime(2); string @string = dataReader2.GetString(3); double @double = dataReader2.GetDouble(4); string str = dataReader2.IsDBNull(5) ? "" : dataReader2.GetString(5); AccountTransaction transaction = new AccountTransaction(); transaction.G7YBAhR7LA(int32); transaction.DateTime = dateTime; transaction.Currency = CurrencyManager.Currencies[@string]; transaction.Value = @double; transaction.Text = str; obj0.Account.Add(transaction); } dataReader2.Close(); command2.Dispose(); obj0.LwTsbC870d(false); }