forked from silahian/VisualHFT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcEquity.cs
24 lines (23 loc) · 835 Bytes
/
cEquity.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using System.Collections.Generic;
using System.Linq;
namespace VisualHFT.Model
{
public class cEquity
{
public DateTime Date { get; set; }
public decimal Equity { get; set; }
public decimal Commission { get; set; }
public decimal VolumeQty { get; set; }
public static cEquity GetMinBetween2Points(cEquity fromElement, cEquity toElement, List<cEquity> aList)
{
if (fromElement == null || toElement == null)
return null;
var aPeriod = (from x in aList where x.Date >= fromElement.Date && x.Date <= toElement.Date select x).ToList();
if (aPeriod != null && aPeriod.Count > 0)
return aPeriod.OrderBy(x => x.Equity).FirstOrDefault();
else
return null;
}
}
}