Files
2024-02-23 06:53:16 -05:00

50 lines
2.1 KiB
C#

using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.IO;
//using MarketData.Utils;
//using System.Collections.ObjectModel;
//using MarketData.Generator.GainLoss;
//using MarketData.DataAccess;
namespace MarketData.MarketDataModel.GainLoss
{
// ****************************************************************************************************************************************************
// ********************************************************************** T O T A L G A I N L O S S *************************************************
// ****************************************************************************************************************************************************
// This Gain/Loss provides a picture of the total Gain/Loss. This is Gain/Loss generated by all trades
public class TotalGainLossItem : IComparable
{
public TotalGainLossItem(DateTime date,double totalGainLoss,double totalGainLossPercent,double totalExposure,double totalMarketValue)
{
Date=date;
TotalGainLoss=totalGainLoss;
TotalExposure=totalExposure;
TotalMarketValue=totalMarketValue;
TotalGainLossPercent=totalGainLossPercent;
}
public TotalGainLossItem(DateTime date,double totalGainLoss,double totalGainLossPercent,double totalExposure,double totalMarketValue,double totalDividendsPaid)
{
Date=date;
TotalGainLoss=totalGainLoss;
TotalExposure=totalExposure;
TotalMarketValue=totalMarketValue;
TotalGainLossPercent=totalGainLossPercent;
TotalDividendsPaid=totalDividendsPaid;
}
public DateTime Date{get;private set;}
public double TotalGainLoss{get;private set;}
public double TotalGainLossPercent{get;private set;}
public double TotalExposure{get;private set;}
public double TotalMarketValue{get;private set;}
public double TotalDividendsPaid{get;private set;}
public int CompareTo(Object obj)
{
if (!obj.GetType().IsInstanceOfType(this)) throw new Exception("Expected GainLoss");
TotalGainLossItem that = (TotalGainLossItem)obj;
return Date.CompareTo(that.Date);
}
}
}