Files
2025-03-25 21:42:32 -04:00

53 lines
2.2 KiB
C#
Executable File

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()
//{
//}
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);
}
}
}