public SellTransaction(DateTime date, Instrument instrument, int quantity, Price amount, double tax, double brokerage) : base(date, instrument, quantity, amount) { this.Tax = tax; this.Brokerage = brokerage; }
public Transaction(DateTime date, Instrument instrument, int quantity, Price unitPrice) { this.Quantity = quantity; this.Instrument = instrument; this.Date = date; this.UnitPrice = unitPrice; }
public Net For(Instrument instrument) { if(!instruments.ContainsKey(instrument)) { instruments[instrument] = new Net(Price.Null,0); } return instruments[instrument]; }
public double CalculateRealizedProfits(ITransactionCollection statement, Instrument instrument) { ITransactionCollection instrumentSpecificTransaction = new TransactionCollection(); foreach (Transaction transaction in statement.TransactionList) { if (transaction.Instrument == instrument) { instrumentSpecificTransaction.Add(transaction); } } return instrumentSpecificTransaction.RealizedProfit().Profit.Value; }
public UnitDividendTransaction(Instrument instrument, int quantity, DateTime transactionDate) : base(instrument, quantity, transactionDate) { }
public DividendTransaction(Instrument instrument, Price dividendAmount, DateTime transactionDate) : base(transactionDate, instrument, 0,dividendAmount) { }
public DividendTransaction(Instrument instrument, int quantity, DateTime transactionDate) : base(transactionDate, instrument, quantity, Price.Null) { }
public CashDividendTransaction(Instrument instrument, Price dividendAmount, DateTime transactionDate) : base(instrument, dividendAmount, transactionDate) { }
public virtual bool Equals(Instrument other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return other.Id == Id; }