Rev 760 | Rev 762 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 760 | Rev 761 | ||
|---|---|---|---|
| Line 41... | Line 41... | ||
| 41 | private BigDecimal minima; |
41 | private BigDecimal minima; |
| 42 | private BigDecimal fechamento; |
42 | private BigDecimal fechamento; |
| 43 | private BigDecimal volume; |
43 | private BigDecimal volume; |
| 44 | private String periodo; |
44 | private String periodo; |
| 45 | 45 | ||
| - | 46 | private String nomeAtivo; |
|
| - | 47 | private Integer contadorCandle; |
|
| 46 | private LocalDateTime dataHoraTime; |
48 | private LocalDateTime dataHoraTime; |
| 47 | private Timeframe periodoTimeFramde; |
49 | private Timeframe periodoTimeFramde; |
| 48 | 50 | ||
| 49 | public Candle() {} |
51 | public Candle() {} |
| 50 | 52 | ||
| Line 55... | Line 57... | ||
| 55 | this.maxima = situacaoCandle.getMaxima(); |
57 | this.maxima = situacaoCandle.getMaxima(); |
| 56 | this.minima = situacaoCandle.getMinima(); |
58 | this.minima = situacaoCandle.getMinima(); |
| 57 | this.fechamento = situacaoCandle.getFechamento(); |
59 | this.fechamento = situacaoCandle.getFechamento(); |
| 58 | this.periodo = periodoCandle; |
60 | this.periodo = periodoCandle; |
| 59 | }
|
61 | }
|
| 60 | - | ||
| - | 62 | ||
| - | 63 | public Candle(String ativoDescricao, LocalDateTime time, BigDecimal abertura, BigDecimal topo, BigDecimal fundo, |
|
| - | 64 | BigDecimal fechamento, String periodoCandle) { |
|
| - | 65 | this.nomeAtivo = ativoDescricao; |
|
| - | 66 | this.dataHora = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); |
|
| - | 67 | this.abertura = abertura; |
|
| - | 68 | this.maxima = topo; |
|
| - | 69 | this.minima = fundo; |
|
| - | 70 | this.fechamento = fechamento; |
|
| - | 71 | this.periodo = periodoCandle; |
|
| - | 72 | }
|
|
| - | 73 | ||
| 61 | @Id |
74 | @Id |
| 62 | @SequenceGenerator(name = "sq_candle") |
75 | @SequenceGenerator(name = "sq_candle") |
| 63 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
76 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 64 | @Column(name="seq_candle", nullable=false) |
77 | @Column(name="seq_candle", nullable=false) |
| 65 | public Long getSequencial() { |
78 | public Long getSequencial() { |
| Line 157... | Line 170... | ||
| 157 | public Timeframe getPeriodoTimeFramde() { |
170 | public Timeframe getPeriodoTimeFramde() { |
| 158 | return periodoTimeFramde; |
171 | return periodoTimeFramde; |
| 159 | }
|
172 | }
|
| 160 | public void setPeriodoTimeFramde(Timeframe periodoTimeFramde) { |
173 | public void setPeriodoTimeFramde(Timeframe periodoTimeFramde) { |
| 161 | this.periodoTimeFramde = periodoTimeFramde; |
174 | this.periodoTimeFramde = periodoTimeFramde; |
| - | 175 | }
|
|
| - | 176 | ||
| - | 177 | @Transient |
|
| - | 178 | public String getNomeAtivo() { |
|
| - | 179 | return nomeAtivo; |
|
| - | 180 | }
|
|
| - | 181 | public void setNomeAtivo(String nomeAtivo) { |
|
| - | 182 | this.nomeAtivo = nomeAtivo; |
|
| - | 183 | }
|
|
| - | 184 | ||
| - | 185 | @Transient |
|
| - | 186 | public Integer getContadorCandle() { |
|
| - | 187 | return contadorCandle; |
|
| - | 188 | }
|
|
| - | 189 | public void setContadorCandle(Integer contadorCandle) { |
|
| - | 190 | this.contadorCandle = contadorCandle; |
|
| 162 | }
|
191 | }
|
| 163 | 192 | ||
| 164 | @Override |
193 | @Override |
| 165 | public int hashCode() { |
194 | public int hashCode() { |
| 166 | final int prime = 31; |
195 | final int prime = 31; |