forked from silahian/VisualHFT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcTop20.cs
51 lines (47 loc) · 1.89 KB
/
cTop20.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System.Collections.Generic;
namespace VisualHFT.AnalyticReports.ViewModel
{
public class cTop20
{
public string Symbol { get; }
public decimal WinsPnL { get; }
public decimal LossesPnL { get; }
public decimal TotalPnl { get; }
public int WinsCount { get; }
public int LossesCount { get; }
public int TotalCount { get; }
public cTop20(string symbol, decimal winsPnL, decimal lossesPnL, decimal totalPnl, int winsCount, int lossesCount, int totalCount)
{
Symbol = symbol;
WinsPnL = winsPnL;
LossesPnL = lossesPnL;
TotalPnl = totalPnl;
WinsCount = winsCount;
LossesCount = lossesCount;
TotalCount = totalCount;
}
public override bool Equals(object obj)
{
return obj is cTop20 other &&
Symbol == other.Symbol &&
WinsPnL == other.WinsPnL &&
LossesPnL == other.LossesPnL &&
TotalPnl == other.TotalPnl &&
WinsCount == other.WinsCount &&
LossesCount == other.LossesCount &&
TotalCount == other.TotalCount;
}
public override int GetHashCode()
{
int hashCode = -2079422780;
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Symbol);
hashCode = hashCode * -1521134295 + WinsPnL.GetHashCode();
hashCode = hashCode * -1521134295 + LossesPnL.GetHashCode();
hashCode = hashCode * -1521134295 + TotalPnl.GetHashCode();
hashCode = hashCode * -1521134295 + WinsCount.GetHashCode();
hashCode = hashCode * -1521134295 + LossesCount.GetHashCode();
hashCode = hashCode * -1521134295 + TotalCount.GetHashCode();
return hashCode;
}
}
}