public final class Candle extends Object implements TimeSeriesEvent<CandleSymbol>, LastingEvent<CandleSymbol>
aggregation period
using
a specified price type
with a data taken
from the specified exchange
from
the specified trading session
.Modifier and Type | Field and Description |
---|---|
static int |
MAX_SEQUENCE
Maximal allowed sequence value.
|
Constructor and Description |
---|
Candle()
Creates new candle with default values.
|
Candle(CandleSymbol eventSymbol)
Creates new candle with the specified candle event symbol.
|
Modifier and Type | Method and Description |
---|---|
long |
getAskVolume()
Returns ask volume in this candle.
|
long |
getBidVolume()
Returns bid volume in this candle.
|
double |
getClose()
Returns the last (close) price of this candle.
|
long |
getCount()
Returns total number of original trade (or quote) events in this candle.
|
long |
getEventId()
Returns identifier of this event.
|
CandleSymbol |
getEventSymbol()
Returns candle event symbol.
|
double |
getHigh()
Returns the maximal (high) price of this candle.
|
double |
getLow()
Returns the minimal (low) price of this candle.
|
double |
getOpen()
Returns the first (open) price of this candle.
|
int |
getSequence()
Returns sequence number of this event to distinguish events that has the same
time . |
long |
getTime()
Returns timestamp of original event in milliseconds.
|
long |
getVolume()
Returns total volume in this candle.
|
double |
getVWAP()
Returns volume-weighted average price (VWAP) in this candle.
|
void |
setAskVolume(long askVolume)
Changes ask volume in this candle.
|
void |
setBidVolume(long bidVolume)
Changes bid volume in this candle.
|
void |
setClose(double close)
Changes the last (close) price of this candle.
|
void |
setCount(long count)
Changes total number of original trade (or quote) events in this candle.
|
void |
setEventId(long eventId)
Changes identifier for this event.
|
void |
setEventSymbol(CandleSymbol eventSymbol)
Changes candle event symbol.
|
void |
setHigh(double high)
Changes the maximal (high) price of this candle.
|
void |
setLow(double low)
Changes the minimal (low) price of this candle.
|
void |
setOpen(double open)
Changes the first (open) price of this candle.
|
void |
setSequence(int sequence)
Changes
getSequence() sequence number} of this event. |
void |
setTime(long time)
Changes timestamp of event in milliseconds.
|
void |
setVolume(long volume)
Changes total volume in this candle.
|
void |
setVWAP(double vwap)
Changes volume-weighted average price (VWAP) in this candle.
|
String |
toString()
Returns string representation of this candle.
|
public static final int MAX_SEQUENCE
setSequence(int)
,
Constant Field Valuespublic Candle()
public Candle(CandleSymbol eventSymbol)
eventSymbol
- candle event symbol.public CandleSymbol getEventSymbol()
getEventSymbol
in interface EventType<CandleSymbol>
public void setEventSymbol(CandleSymbol eventSymbol)
setEventSymbol
in interface EventType<CandleSymbol>
eventSymbol
- candle event symbol.public long getEventId()
time
and sequence
.
Changing either time or sequence changes event identifier.getEventId
in interface TimeSeriesEvent<CandleSymbol>
public void setEventId(long eventId)
time
and sequence
,
invocation of this method changes time and sequence.
Do not use this method directly.
Change time
and/or sequence
.eventId
- the event identifier.getEventId()
public long getTime()
getTime
in interface TimeSeriesEvent<CandleSymbol>
System.currentTimeMillis()
public void setTime(long time)
time
- timestamp in milliseconds.getTime()
public int getSequence()
time
. This sequence number does not have to be unique and
does not need to be sequential. Sequence can range from 0 to MAX_SEQUENCE
.public void setSequence(int sequence)
getSequence()
sequence number} of this event.sequence
- the sequence.IllegalArgumentException
- if sequence is below zero or above MAX_SEQUENCE
.getSequence()
public long getCount()
public void setCount(long count)
count
- total number of original trade (or quote) events in this candle.public double getOpen()
public void setOpen(double open)
open
- the first (open) price of this candle.public double getHigh()
public void setHigh(double high)
high
- the maximal (high) price of this candle.public double getLow()
public void setLow(double low)
low
- the minimal (low) price of this candle.public double getClose()
public void setClose(double close)
close
- the last (close) price of this candle.public long getVolume()
public void setVolume(long volume)
volume
- total volume in this candle.public double getVWAP()
public void setVWAP(double vwap)
vwap
- volume-weighted average price (VWAP) in this candle.public long getBidVolume()
public void setBidVolume(long bidVolume)
bidVolume
- bid volume in this candle.public long getAskVolume()
public void setAskVolume(long askVolume)
askVolume
- ask volume in this candle.Copyright © 2014 Devexperts. All Rights Reserved.