Repository navigation
Expand file tree
/
Copy pathCandle.java
More file actions
95 lines (73 loc) · 1.5 KB
/
Copy pathCandle.java
File metadata and controls
95 lines (73 loc) · 1.5 KB
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
79
80
81
82
83
84
85
86
87
88
import java.util.Calendar;
public class Candle {
private double abertura = 100.0, fechamento = 500.0, minimo = 60.0,
maximo = 550.0;
private Calendar data;
public Candle(double abertura, double fechamento, double minimo,
double maximo, Calendar data) {
this.abertura = abertura;
this.fechamento = fechamento;
this.minimo = minimo;
this.maximo = maximo;
this.data = data;
}
public Candle() {
}
@Coluna(posicao=4,
formato="R$ %,#.2f",
nome="Abertura")
public double getAbertura() {
return abertura;
}
@Coluna(posicao=1,
formato="R$ %,#.2f",
nome="Fechamento")
public double getFechamento() {
return fechamento;
}
@Coluna(posicao=3,
formato="R$ %,#.2f",
nome="Mínimo")
public double getMinimo() {
return minimo;
}
@Coluna(posicao=2,
formato="R$ %,#.2f",
nome="Máximo")
public double getMaximo() {
return maximo;
}
@Coluna(posicao=0,
formato="%1$Td/%1$Tm/%1$TY",
nome="Data")
public Calendar getData() {
return data;
}
public boolean isAlta() {
return fechamento > abertura;
}
public Candle setAbertura(
double abertura) {
this.abertura = abertura;
return this;
}
public Candle setFechamento(
double fechamento) {
this.fechamento = fechamento;
return this;
}
public Candle setMinimo(
double minimo) {
this.minimo = minimo;
return this;
}
public Candle setMaximo(
double maximo) {
this.maximo = maximo;
return this;
}
public Candle setData(Calendar data) {
this.data = data;
return this;
}
}