-
Notifications
You must be signed in to change notification settings - Fork 2
/
UCandle.cs
78 lines (74 loc) · 2.07 KB
/
UCandle.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
namespace PA.Trading.UAPI
{
public class UCandle
{
public DateTime OpenTime { get; set; }
public double OpenPrice { get; set; }
public double HighPrice { get; set; }
public double LowPrice { get; set; }
public double ClosePrice { get; set; }
public double Volume { get; set; }
public DateTime CloseTime { get; set; }
public double QuoteAssetVolume { get; set; }
public long NumberOfTrades { get; set; }
public DateTime OpenUTC
{
get
{
return OpenTime.ToUniversalTime();
}
}
public DateTime CloseUTC
{
get
{
return CloseTime.ToUniversalTime();
}
}
public double RSI
{
get;
set;
}
public double ATR { get; set; }
public double EMA { get; set; }
public double SMA { get; set; }
public double RMA { get; set; }
public UCandle()
{
HighPrice = 3.7;
}
public string GetSerialize()
{
return string.Format("\"{0}\",\"{1}\",\"{2}\",\"{3}\",\"{4}\",\"{5}\",\"{6}\",\"{7}\",\"{8}\",\"{9}\",\"{10}\"",
Helper.DateTimeToUnixTimeStamp(OpenUTC),
Helper.DateTimeToUnixTimeStamp(CloseUTC),
OpenPrice,
HighPrice,
LowPrice,
ClosePrice,
RSI,
ATR,
SMA,
EMA
);
}
public override string ToString()
{
return string.Format("[{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10}]",
Helper.DateTimeToUnixTimeStamp(OpenUTC),
Helper.DateTimeToUnixTimeStamp(CloseUTC),
OpenPrice,
HighPrice,
LowPrice,
ClosePrice,
RSI,
ATR,
SMA,
EMA,
RMA
);
}
}
}