Direct summing
This commit is contained in:
@ -27,6 +27,8 @@ namespace StockInfoCore
|
||||
public decimal TotalPlus { get; set; }
|
||||
public decimal TotalMinus { get; set; }
|
||||
|
||||
public decimal ExtraValueSum { get; set; }
|
||||
|
||||
public Dictionary<string, DiTraderStockRow> Stocks { get; set; }
|
||||
public IEnumerable<StockMember> CurrentStocks { get; set; }
|
||||
public Person ConnectedPerson { get; set; }
|
||||
@ -54,6 +56,7 @@ namespace StockInfoCore
|
||||
CurrentSum = 0m;
|
||||
TotalMinus = 0m;
|
||||
TotalPlus = 0m;
|
||||
ExtraValueSum = 0m;
|
||||
var tmpStocks = new List<StockMember>();
|
||||
var personStocks = new List<StockMember>();
|
||||
//Update all handled shares
|
||||
@ -96,7 +99,8 @@ namespace StockInfoCore
|
||||
txtTotalMinus.Refresh();
|
||||
txtTotalPlus.Text = TotalPlus.ToString();
|
||||
txtTotalPlus.Refresh();
|
||||
|
||||
txtSummaValue.Text = ExtraValueSum.ToString();
|
||||
txtSummaValue.Refresh();
|
||||
lbUpdateTimes.Items.Add($"{DateTime.Now.ToLongTimeString()} - {txtTotDiff.Text.Substring(0, txtTotDiff.Text.Length - 2)}");
|
||||
|
||||
}
|
||||
@ -134,9 +138,11 @@ namespace StockInfoCore
|
||||
var actValue = currStock.PostAmount * currStock.ActValue;
|
||||
var diffValue = actValue - buyValue;
|
||||
var diffproc = diffValue / buyValue * 100;
|
||||
var extraVal = currStock.ActAmount * currStock.ActValue;
|
||||
BoughtSum += buyValue;
|
||||
TotalDiff += diffValue;
|
||||
CurrentSum += actValue;
|
||||
ExtraValueSum += extraVal;
|
||||
if (diffValue < 0)
|
||||
{
|
||||
TotalMinus += diffValue;
|
||||
|
||||
Reference in New Issue
Block a user