StockUnit

public class StockUnit

One open-high-low-close-volume bar of a stock time series, covering whichever span the requested cadence samples at — minutes, a day, a week or a month.

The four prices are quoted in the ticker's listing currency and volume counts shares traded over the span, so a monthly bar's volume is the month's total rather than a daily average.

Three further fields — getAdjustedClose, getDividendAmount and getSplitCoefficient — only carry values when the request went to the adjusted variant of a cadence. They are primitive double fields, so an unadjusted bar reports them as 0.0 rather than as absent, and 0.0 on its own does not distinguish "not requested" from "no dividend paid". The cadence the bar came from is what tells those apart.

Author

Sylvester Sefa-Yeboah

Since

1.0.1

Types

Link copied to clipboard
public class Builder
Assembles a single bar field by field.

Properties

Link copied to clipboard
public final double adjustedClose
Link copied to clipboard
public final double close
Link copied to clipboard
public final double dividendAmount
Link copied to clipboard
public final double high
Link copied to clipboard
public final double low
Link copied to clipboard
public final double open
Link copied to clipboard
public final double splitCoefficient
Link copied to clipboard
public final long volume

Functions

Link copied to clipboard
public double getAdjustedClose()
Gets the closing price restated in today's share terms, so that a series of adjusted closes is comparable across splits and dividends where a series of raw closes is not.
Link copied to clipboard
public double getClose()
Gets the price at the end of this bar's span, as it was quoted at the time.
Link copied to clipboard
public String getDate()
Gets the timestamp identifying this bar, in the timezone the API reports as US Eastern.
Link copied to clipboard
public double getDividendAmount()
Gets the dividend paid per share within this bar's span.
Link copied to clipboard
public double getHigh()
Gets the highest price reached within this bar's span.
Link copied to clipboard
public double getLow()
Gets the lowest price reached within this bar's span.
Link copied to clipboard
public double getOpen()
Gets the price at the start of this bar's span.
Link copied to clipboard
public double getSplitCoefficient()
Gets the ratio of a share split taking effect within this bar's span — 2 for a two-for-one split, for instance.
Link copied to clipboard
public long getVolume()
Gets how many shares changed hands within this bar's span.
Link copied to clipboard
public String toString()