Interface Bar
- All Superinterfaces:
Comparable<Bar>
Represents a historical bar.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(long time) Checks if the given time (in milliseconds since 1970) falls within the start/end time of this bar.Gets the bar size for the bar.float
getClose()
Gets the close price for the bar.long
Gets the end time for the bar (in milliseconds since 1970).float
getHigh()
Gets the high price for the bar.float
getLow()
Gets the low price for the bar.float
getOpen()
Gets the open price for the barint
Gets the open interest for the bar (daily bars only, if available)float
Gets the settlement price for the bar (daily future bars only, if available)long
Gets the duration of the bar in millisecondslong
Gets the start time for the bar (in milliseconds since 1970).int
Gets the number of trades for this bar (if available)int
Gets the trades for the bar that occurred at the bid price (sell trades).int
Gets the trades for the bar that occurred at the offer price (buy trades).long
Gets the volume for the bar (as a long value).float
Gets the volume for the bar as a floating point valuefloat
Gets the volume for the bar that occurred at the bid price (sell volume).float
Gets the volume for the bar that occurred at the offer price (buy volume).float
getVWAP()
Gets the volume weighted average price for the bar (if available).boolean
Checks if the bar is complete (ie historical vs a live bar).Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
getBarSize
-
getSizeMillis
long getSizeMillis()Gets the duration of the bar in milliseconds -
getStartTime
long getStartTime()Gets the start time for the bar (in milliseconds since 1970).- Returns:
- the start time of the bar (in milliseconds since 1970).
-
getEndTime
long getEndTime()Gets the end time for the bar (in milliseconds since 1970).- Returns:
- the end time of the bar (in milliseconds since 1970).
-
contains
boolean contains(long time) Checks if the given time (in milliseconds since 1970) falls within the start/end time of this bar.- Returns:
- true if this bar contains the given time.
-
isComplete
boolean isComplete()Checks if the bar is complete (ie historical vs a live bar).- Returns:
- true if this bar is complete.
-
getOpen
float getOpen()Gets the open price for the bar- Returns:
- open price for the bar
-
getHigh
float getHigh()Gets the high price for the bar.- Returns:
- high price for the bar.
-
getLow
float getLow()Gets the low price for the bar.- Returns:
- low price for the bar.
-
getClose
float getClose()Gets the close price for the bar.- Returns:
- close price for the bar.
-
getVolume
long getVolume()Gets the volume for the bar (as a long value).- Returns:
- trade volume for the bar (as a long value)
-
getVolumeAsFloat
float getVolumeAsFloat()Gets the volume for the bar as a floating point value- Returns:
- trade volume for the bar (as a floating point value)
-
getOpenInterest
int getOpenInterest()Gets the open interest for the bar (daily bars only, if available)- Returns:
- open interest (daily bars only)
-
getSettlement
float getSettlement()Gets the settlement price for the bar (daily future bars only, if available)- Returns:
- settlement price (daily bars only)
-
getTrades
int getTrades()Gets the number of trades for this bar (if available)- Returns:
- number of trades for this bar.
-
getVWAP
float getVWAP()Gets the volume weighted average price for the bar (if available).- Returns:
- volume weighed average price (if available)
-
getVolumeAtOffer
float getVolumeAtOffer()Gets the volume for the bar that occurred at the offer price (buy volume).- Returns:
- volume at offer for the bar (as a floating point value)
-
getVolumeAtBid
float getVolumeAtBid()Gets the volume for the bar that occurred at the bid price (sell volume).- Returns:
- volume at bid for the bar (as a floating point value)
-
getTradesAtOffer
int getTradesAtOffer()Gets the trades for the bar that occurred at the offer price (buy trades).- Returns:
- trades at offer for the bar (as a floating point value)
-
getTradesAtBid
int getTradesAtBid()Gets the trades for the bar that occurred at the bid price (sell trades).- Returns:
- trades at bid for the bar (as a floating point value)
-