Class BarSize
java.lang.Object
com.motivewave.platform.sdk.common.BarSize
- All Implemented Interfaces:
Comparable<BarSize>
Describes the bar size for the historical data.
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
Compares this bar size with the given object and returns true if they are equal.static BarSize
static BarSize
getBarSize
(int interval) Gets the linear BarSize with the given interval in minutes.static BarSize
getBarSize
(Enums.BarSizeType type, int interval) Gets the BarSize with the given type and interval.static BarSize
getBarSize
(Enums.BarSizeType type, int interval, boolean intervalPoints) Gets the BarSize with the given type and interval.static BarSize
getBarSize
(Enums.BarSizeType type, int interval, int reverseInterval) Gets the BarSize with the given minutes and interval.static BarSize
getBarSize
(Enums.BarSizeType type, int interval, int reverseInterval, boolean intervalPoints) Gets the BarSize with the given minutes and interval.static BarSize
getBarSize
(Enums.BarSizeType type, Enums.IntervalType intervalType, int interval) Gets the BarSize with the given minutes and interval.static BarSize
getBarSize
(Enums.BarSizeType type, Enums.IntervalType intervalType, int interval, boolean intervalPoints) Gets the BarSize with the given minutes and interval.static BarSize
getBarSize
(Enums.BarSizeType type, Enums.IntervalType intervalType, int interval, int reverseInterval) Gets the BarSize with the given interval and reverse interval.static BarSize
getBarSize
(Enums.BarSizeType type, Enums.IntervalType intervalType, int interval, int reverseInterval, boolean intervalPoints) Gets the BarSize with the given interval and reverse interval.int
Gets the interval for this bar.long
Gets the interval for this bar.int
Gets the interval for this bar.int
Gets the interval for this bar.Indicates the measurement type of the interval parameter (ie minutes, days, seconds, pips)getKey()
getName()
Gets the display name for this bar size.int
Gets the reverse bar interval.Gets a shortened form of the display name for this bar size.long
Gets the size of the bar in milliseconds.getType()
Gets the type of bar size.boolean
isBidAsk()
Determines if this is a bid/ask graph.boolean
Determines if this is a constant volume bar size.boolean
Determines if the bar has a fixed size in terms of time.boolean
Determines if this is a Hybrid Renko bar.boolean
Determines if the interval size is in points vs minimum tick.boolean
Indicates if this bar size is intra-day (less than 1 day).boolean
isLinear()
Determines if this bar is a fixed time interval (in minutes).boolean
isOFA()
boolean
Determines if this is an OFA Linear bar (OrderFlowAnalytics).boolean
Determines if this is an OFA bar (OrderFlowAnalytics).boolean
Determines if this is a Point & Figure bar size.boolean
isRange()
Determines if this is a constant range bar size.boolean
isRenko()
Determines if this is a Renko (Japanese Brick) bar size.boolean
Determines if this is a Reversal bar size.boolean
isTick()
Determines if this is a Tick Interval bar (each bar is composed of a constant number of ticks).toString()
Returns a printable string representation of this bar size (see getName())
-
Method Details
-
getIntervalMinutes
public int getIntervalMinutes()Gets the interval for this bar. For linear bars, this is the number of minutes in this bar.- Returns:
- the bar interval.
-
getIntervalSeconds
public int getIntervalSeconds()Gets the interval for this bar. For linear bars, this is the number of seconds in this bar.- Returns:
- the bar interval in seconds.
-
getIntervalMillis
public long getIntervalMillis()Gets the interval for this bar. For linear bars, this is the number of seconds in this bar.- Returns:
- the bar interval in seconds.
-
getInterval
public int getInterval()Gets the interval for this bar. For the meaning of this value see interval type.- Returns:
- the bar interval.
-
getReverseInterval
public int getReverseInterval()Gets the reverse bar interval. Currently this only applies to Hybrid Renko and Point & Figure bars.- Returns:
- the bar reverse interval (Hybrid Renko, Point & Figure bars only).
-
getSizeMillis
public long getSizeMillis()Gets the size of the bar in milliseconds. This is only applicable to linear bars. Non-linear bars will return -1- Returns:
- size in milliseconds
-
isLinear
public boolean isLinear()Determines if this bar is a fixed time interval (in minutes).- Returns:
- true if this is a linear bar size (ie minutes > 0)
-
isFixedSize
public boolean isFixedSize()Determines if the bar has a fixed size in terms of time.- Returns:
- true if this bar has a fixed size in terms of time
-
isIntraday
public boolean isIntraday()Indicates if this bar size is intra-day (less than 1 day).- Returns:
- true if this bar is intra-day (less than 1 day)
-
getIntervalType
Indicates the measurement type of the interval parameter (ie minutes, days, seconds, pips)- Returns:
- type of interval measurement
-
getType
Gets the type of bar size.- Returns:
- type of the bar size
-
isRenko
public boolean isRenko()Determines if this is a Renko (Japanese Brick) bar size.- Returns:
- true if this is a Renko (Japanese Brick) bar.
-
isPointAndFigure
public boolean isPointAndFigure()Determines if this is a Point & Figure bar size.- Returns:
- true if this is a Point & Figure bar.
-
isReversal
public boolean isReversal()Determines if this is a Reversal bar size.- Returns:
- true if this is a Reversal bar.
-
isRange
public boolean isRange()Determines if this is a constant range bar size.- Returns:
- true if this is a Range interval bar.
-
isConstantVolume
public boolean isConstantVolume()Determines if this is a constant volume bar size.- Returns:
- true if this is a Constant Volume interval bar.
-
isTick
public boolean isTick()Determines if this is a Tick Interval bar (each bar is composed of a constant number of ticks).- Returns:
- true if this is a Tick Interval bar.
-
isIntervalPoints
public boolean isIntervalPoints()Determines if the interval size is in points vs minimum tick. This is only relevant for bar sizes that are based on price movements (such as Range or Renko)- Returns:
- true if the interval is expressed in points
-
isBidAsk
public boolean isBidAsk()Determines if this is a bid/ask graph.- Returns:
- true if this is a bid/ask graph.
-
isHybridRenko
public boolean isHybridRenko()Determines if this is a Hybrid Renko bar. Hybrid Renko is based on Renko bars with a different 'reverse' interval for changing the direction of the bars.- Returns:
- true if this is a Hybrid Renko bar.
-
isOFAProbe
public boolean isOFAProbe()Determines if this is an OFA bar (OrderFlowAnalytics).- Returns:
- true if this is an OFA bar.
-
isOFALinear
public boolean isOFALinear()Determines if this is an OFA Linear bar (OrderFlowAnalytics).- Returns:
- true if this is an OFA Linear bar.
-
isOFA
public boolean isOFA()- Returns:
- true if this is an OFA Probe or OFA Linear Bar
-
getKey
-
equals
Compares this bar size with the given object and returns true if they are equal. -
getName
Gets the display name for this bar size.- Returns:
- the name for this bar size
-
getShortName
Gets a shortened form of the display name for this bar size.- Returns:
- short name of this bar size
-
toString
Returns a printable string representation of this bar size (see getName()) -
compareTo
- Specified by:
compareTo
in interfaceComparable<BarSize>
-
getBarSize
Gets the linear BarSize with the given interval in minutes.- Parameters:
interval
- in minutes
-
getBarSize
Gets the BarSize with the given type and interval.- Parameters:
type
- bar size typeinterval
- dependent on bar size type (minutes for linear bar, ticks for Renko etc)
-
getBarSize
Gets the BarSize with the given type and interval.- Parameters:
type
- bar size typeinterval
- dependent on bar size type (minutes for linear bar, ticks for Renko etc)intervalPoints
- true if inteval is points (pips) instead of min tick
-
getBarSize
public static BarSize getBarSize(Enums.BarSizeType type, Enums.IntervalType intervalType, int interval) Gets the BarSize with the given minutes and interval. -
getBarSize
public static BarSize getBarSize(Enums.BarSizeType type, Enums.IntervalType intervalType, int interval, boolean intervalPoints) Gets the BarSize with the given minutes and interval. -
getBarSize
Gets the BarSize with the given minutes and interval. -
getBarSize
public static BarSize getBarSize(Enums.BarSizeType type, int interval, int reverseInterval, boolean intervalPoints) Gets the BarSize with the given minutes and interval. -
getBarSize
public static BarSize getBarSize(Enums.BarSizeType type, Enums.IntervalType intervalType, int interval, int reverseInterval) Gets the BarSize with the given interval and reverse interval. -
getBarSize
public static BarSize getBarSize(Enums.BarSizeType type, Enums.IntervalType intervalType, int interval, int reverseInterval, boolean intervalPoints) Gets the BarSize with the given interval and reverse interval. -
fromKey
-