Package markets.alpaca.client.ws.model
Record Class StockBar
java.lang.Object
java.lang.Record
markets.alpaca.client.ws.model.StockBar
- Record Components:
symbol- ticker symbolopen- opening pricehigh- highest pricelow- lowest priceclose- closing pricevolume- volume in sharestimestamp- RFC-3339 bar start timestamp
public record StockBar(String symbol, BigDecimal open, BigDecimal high, BigDecimal low, BigDecimal close, long volume, String timestamp)
extends Record
An aggregated stock price bar (minute, daily, or updated).
All three bar types share the same wire format; the listener method that receives this record
already indicates which type it is (onMinuteBar, onDailyBar, or
onUpdatedBar).
-
Constructor Summary
ConstructorsConstructorDescriptionStockBar(String symbol, BigDecimal open, BigDecimal high, BigDecimal low, BigDecimal close, long volume, String timestamp) Creates an instance of aStockBarrecord 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.longvolume()Returns the value of thevolumerecord component.
-
Constructor Details
-
StockBar
public StockBar(String symbol, BigDecimal open, BigDecimal high, BigDecimal low, BigDecimal close, long volume, String timestamp) Creates an instance of aStockBarrecord 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 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
@SerializedName("v") public long 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
-