Record Class Bar
java.lang.Object
java.lang.Record
com.quantfinlib.core.Bar
public record Bar(long timestamp, double open, double high, double low, double close, double volume)
extends Record
Immutable OHLCV bar. Timestamp is epoch milliseconds.
-
Constructor Summary
ConstructorsConstructorDescriptionBar(long timestamp, double open, double high, double low, double close, double volume) Creates an instance of aBarrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleclose()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.doublehigh()Returns the value of thehighrecord component.booleandoublelow()Returns the value of thelowrecord component.doubleopen()Returns the value of theopenrecord component.doublerange()longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.doubledoublevolume()Returns the value of thevolumerecord component.
-
Constructor Details
-
Bar
public Bar(long timestamp, double open, double high, double low, double close, double volume) Creates an instance of aBarrecord class.- Parameters:
timestamp- the value for thetimestamprecord 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 component
-
-
Method Details
-
typicalPrice
public double typicalPrice() -
range
public double range() -
isBullish
public boolean isBullish() -
toString
-
hashCode
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
open
public double open()Returns the value of theopenrecord component.- Returns:
- the value of the
openrecord component
-
high
public double high()Returns the value of thehighrecord component.- Returns:
- the value of the
highrecord component
-
low
public double low()Returns the value of thelowrecord component.- Returns:
- the value of the
lowrecord component
-
close
public double close()Returns the value of thecloserecord component.- Returns:
- the value of the
closerecord component
-
volume
public double volume()Returns the value of thevolumerecord component.- Returns:
- the value of the
volumerecord component
-