Package markets.alpaca.client.ws.model
Record Class CryptoBar
java.lang.Object
java.lang.Record
markets.alpaca.client.ws.model.CryptoBar
- Record Components:
symbol- crypto pair symbol (e.g."BTC/USD")open- opening pricehigh- highest pricelow- lowest priceclose- closing pricevolume- volumetimestamp- RFC-3339 bar start timestamptradeCount- number of trades aggregated in the barvwap- volume-weighted average price
public record CryptoBar(String symbol, BigDecimal open, BigDecimal high, BigDecimal low, BigDecimal close, BigDecimal volume, String timestamp, int tradeCount, BigDecimal vwap)
extends Record
An aggregated crypto price bar (minute, daily, or updated).
The listener method that delivers this record already identifies the bar type (
onMinuteBar, onDailyBar, or onUpdatedBar).
-
Constructor Summary
ConstructorsConstructorDescriptionCryptoBar(String symbol, BigDecimal open, BigDecimal high, BigDecimal low, BigDecimal close, BigDecimal volume, String timestamp, int tradeCount, BigDecimal vwap) Creates an instance of aCryptoBarrecord class. -
Method Summary
Modifier and TypeMethodDescriptionclose()Returns the value of thecloserecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.high()Returns the value of thehighrecord component.low()Returns the value of thelowrecord component.open()Returns the value of theopenrecord component.symbol()Returns the value of thesymbolrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetradeCountrecord component.volume()Returns the value of thevolumerecord component.vwap()Returns the value of thevwaprecord component.
-
Constructor Details
-
CryptoBar
public CryptoBar(String symbol, BigDecimal open, BigDecimal high, BigDecimal low, BigDecimal close, BigDecimal volume, String timestamp, int tradeCount, BigDecimal vwap) Creates an instance of aCryptoBarrecord class.- Parameters:
symbol- the value for thesymbolrecord componentopen- the value for theopenrecord componenthigh- the value for thehighrecord componentlow- the value for thelowrecord componentclose- the value for thecloserecord componentvolume- the value for thevolumerecord componenttimestamp- the value for thetimestamprecord componenttradeCount- the value for thetradeCountrecord componentvwap- the value for thevwaprecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
symbol
Returns the value of thesymbolrecord component.- Returns:
- the value of the
symbolrecord component
-
open
Returns the value of theopenrecord component.- Returns:
- the value of the
openrecord component
-
high
Returns the value of thehighrecord component.- Returns:
- the value of the
highrecord component
-
low
Returns the value of thelowrecord component.- Returns:
- the value of the
lowrecord component
-
close
Returns the value of thecloserecord component.- Returns:
- the value of the
closerecord component
-
volume
Returns the value of thevolumerecord component.- Returns:
- the value of the
volumerecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
tradeCount
@SerializedName("n") public int tradeCount()Returns the value of thetradeCountrecord component.- Returns:
- the value of the
tradeCountrecord component
-
vwap
Returns the value of thevwaprecord component.- Returns:
- the value of the
vwaprecord component
-