Class Bar
java.lang.Object
trade.invision.indicators.series.bar.Bar
Bar represents the price data of an instrument within a span of time. A Bar may also be referred to
as a "candlestick" or "OHLC" (Open, High, Low, Close).- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Bar.BarBuilderbuilder()booleancontainsInstant(Instant instant) booleangetClose()getEnd()getHigh()getLow()getOpen()getStart()inthashCode()booleanChecks ifgetClose()is less thangetOpen().booleanChecks ifgetClose()is greater thangetOpen().booleanChecks if the givenBargetStart()(inclusive) iscontainsInstant(Instant)of thisBaror if the givenBargetEnd()(exclusive) iscontainsInstant(Instant)of thisBar.toString()
-
Constructor Details
-
Bar
Instantiates a newBar. -
Bar
public Bar(Instant start, Duration duration, Num open, Num high, Num low, Num close, Num volume, Num tradeCount) Instantiates a newBar. -
Bar
public Bar(Instant start, Instant end, Num open, Num high, Num low, Num close, Num volume, Num tradeCount) Creates a newBarinstance.
-
-
Method Details
-
getDuration
- Returns:
- the
Duration - See Also:
-
addPrice
-
addTrade
- Parameters:
price- the priceNumvolume- the volumeNum, ornullto not updategetVolume()- Returns:
- the new
Bar
-
aggregate
-
containsInstant
- Parameters:
instant- theInstant- Returns:
trueif contained,falseotherwise
-
overlaps
Checks if the givenBargetStart()(inclusive) iscontainsInstant(Instant)of thisBaror if the givenBargetEnd()(exclusive) iscontainsInstant(Instant)of thisBar.- Parameters:
bar- aBar- Returns:
trueif overlaps,falseotherwise
-
isBullish
public boolean isBullish()Checks ifgetClose()is greater thangetOpen().- Returns:
trueif bullish,falseotherwise
-
isBearish
public boolean isBearish()Checks ifgetClose()is less thangetOpen().- Returns:
trueif bearish,falseotherwise
-
builder
-
toBuilder
-
getStart
-
getEnd
-
getOpen
-
getHigh
-
getLow
-
getClose
-
getVolume
-
getTradeCount
-
equals
-
hashCode
public int hashCode() -
toString
-