Package com.caplin.charting
Class OhlcvData
java.lang.Object
com.caplin.charting.OhlcvData
OhlcvData represents a datapoint on a chart with Open, High, Low, Close and Volume.
A single OhlcvData object would commonly be plotted as a candlestick.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
OhlcvData
- Parameters:
time
- the time of the datahigh
- the highest price that was reached during this time period. This must be larger than low, open and close.low
- the lowest price that was reached during this time period. This must be smaller than high, open and close.open
- the price that the instrument opened this time period with.close
- the price that the instrument closed this time period with.volume
- the volume of trading during this time period.- Throws:
IllegalArgumentException
- if high or low are not respectively the largest and smallest of the values (high, low, open, close).NullPointerException
- if time is null.
-
-
Method Details
-
getTime
- Returns:
- the time.
-
getOpen
public double getOpen()- Returns:
- the open price for this period.
-
getHigh
public double getHigh()- Returns:
- the high price for this period. Will not be smaller than open, close or low.
-
getClose
public double getClose()- Returns:
- the close price for this period.
-
getLow
public double getLow()- Returns:
- the low price for this period. Will not be larger than open, close or high.
-
getVolume
public double getVolume()- Returns:
- the volume for this period.
-
toString
-