예제 #1
0
 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;
 }
예제 #2
0
 public Transaction(DateTime date, Instrument instrument, int quantity, Price unitPrice)
 {
     this.Quantity = quantity;
     this.Instrument = instrument;
     this.Date = date;
     this.UnitPrice = unitPrice;
 }
예제 #3
0
 public Net For(Instrument instrument)
 {
     if(!instruments.ContainsKey(instrument))
     {
         instruments[instrument] = new Net(Price.Null,0);
     }
     return instruments[instrument];
 }
예제 #4
0
 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;
 }
예제 #5
0
 public UnitDividendTransaction(Instrument instrument, int quantity, DateTime transactionDate)
     : base(instrument, quantity, transactionDate)
 {
 }
예제 #6
0
 public DividendTransaction(Instrument instrument, Price dividendAmount, DateTime transactionDate)
     : base(transactionDate, instrument, 0,dividendAmount)
 {
 }
예제 #7
0
 public DividendTransaction(Instrument instrument, int quantity, DateTime transactionDate)
     : base(transactionDate, instrument, quantity, Price.Null)
 {
 }
예제 #8
0
 public CashDividendTransaction(Instrument instrument, Price dividendAmount, DateTime transactionDate)
     : base(instrument, dividendAmount, transactionDate)
 {
 }
예제 #9
0
 public virtual bool Equals(Instrument other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other.Id == Id;
 }