Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
778 blopes 1
package br.com.kronus.core;
2
 
3
import java.time.LocalDateTime;
4
 
5
public class Candle {
6
 
7
    private LocalDateTime time;
8
    private double abertura;
9
    private double maxima;
10
    private double minima;
11
    private double fechamento;
12
    private long volume;
13
    private Timeframe timeframe;
14
 
15
    public Candle(LocalDateTime time, double abertura, double maxima, double minima,
16
                  double fechamento, long volume, Timeframe timeframe) {
17
        this.time = time;
18
        this.abertura = abertura;
19
        this.maxima = maxima;
20
        this.minima = minima;
21
        this.fechamento = fechamento;
22
        this.volume = volume;
23
        this.timeframe = timeframe;
24
    }
25
 
26
    public boolean isCandleComprador() {
27
        return fechamento > abertura;
28
    }
29
 
30
    public boolean isCandleVendedor() {
31
        return fechamento < abertura;
32
    }
33
 
34
    public double getCorpoAlto() {
35
        return Math.max(abertura, fechamento);
36
    }
37
 
38
    public double getCorpoBaixo() {
39
        return Math.min(abertura, fechamento);
40
    }
41
 
42
    public LocalDateTime getTime() {
43
        return time;
44
    }
45
 
46
    public double getAbertura() {
47
        return abertura;
48
    }
49
 
50
    public double getMaxima() {
51
        return maxima;
52
    }
53
 
54
    public double getMinima() {
55
        return minima;
56
    }
57
 
58
    public double getFechamento() {
59
        return fechamento;
60
    }
61
 
62
    public long getVolume() {
63
        return volume;
64
    }
65
 
66
    public Timeframe getTimeframe() {
67
        return timeframe;
68
    }
69
}