사는 시점 현재 갖고 있는 데이터 Count

This commit is contained in:
kyh
2024-03-01 14:57:56 +09:00
parent c45276378b
commit 5e476c22a1

View File

@@ -97,11 +97,17 @@ namespace Million.HunterSubForm
// 보유한 종목 수 계산
foreach (var item in _analysisDatas)
{
/**
* 사는 시점에 갖고 있는 Count 수로 정정
*/
var count = _analysisDatas.Count(t => t.StartDate <= item.StartDate && t.EndDate >= item.StartDate && t != item);
// Ts <= Os <= Te
// Ts <= Oe <= Te
var count = _analysisDatas.Count(target => (target.StartDate <= item.StartDate && target.EndDate >= item.StartDate) ||
(target.StartDate <= item.EndDate && target.EndDate >= item.EndDate)
);
//var count = _analysisDatas.Count(target => (target.StartDate <= item.StartDate && target.EndDate >= item.StartDate) ||
//(target.StartDate <= item.EndDate && target.EndDate >= item.EndDate)
//);
item.PurchasedCount = count;
evaeragePurchasedCount += count;