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 TypeMethodDescriptionintstatic BarSizeday(int days) booleanCompares this bar size with the given object and returns true if they are equal.static BarSizestatic BarSizegetBarSize(int interval) Gets the linear BarSize with the given interval in minutes.static BarSizegetBarSize(Enums.BarSizeType type, int interval) Gets the BarSize with the given type and interval.static BarSizegetBarSize(Enums.BarSizeType type, int interval, boolean intervalPoints) Gets the BarSize with the given type and interval.static BarSizegetBarSize(Enums.BarSizeType type, int interval, int reverseInterval) Gets the BarSize with the given minutes and interval.static BarSizegetBarSize(Enums.BarSizeType type, int interval, int reverseInterval, boolean intervalPoints) Gets the BarSize with the given minutes and interval.static BarSizegetBarSize(Enums.BarSizeType type, Enums.IntervalType intervalType, int interval) Gets the BarSize with the given minutes and interval.static BarSizegetBarSize(Enums.BarSizeType type, Enums.IntervalType intervalType, int interval, boolean intervalPoints) Gets the BarSize with the given minutes and interval.static BarSizegetBarSize(Enums.BarSizeType type, Enums.IntervalType intervalType, int interval, int reverseInterval) Gets the BarSize with the given interval and reverse interval.static BarSizegetBarSize(Enums.BarSizeType type, Enums.IntervalType intervalType, int interval, int reverseInterval, boolean intervalPoints) Gets the BarSize with the given interval and reverse interval.intGets the interval for this bar.longGets the interval for this bar.intGets the interval for this bar.intGets 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.intGets the reverse bar interval.Gets a shortened form of the display name for this bar size.longGets the size of the bar in milliseconds.getType()Gets the type of bar size.static BarSizehour(int hours) booleanisBidAsk()Determines if this is a bid/ask graph.booleanDetermines if this is a constant volume bar size.booleanDetermines if the bar has a fixed size in terms of time.booleanDetermines if this is a Hybrid Renko bar.booleanDetermines if the interval size is in points vs minimum tick.booleanIndicates if this bar size is intra-day (less than 1 day).booleanisLinear()Determines if this bar is a fixed time interval (in minutes).booleanisOFA()booleanDetermines if this is an OFA Linear bar (OrderFlowAnalytics).booleanDetermines if this is an OFA bar (OrderFlowAnalytics).booleanDetermines if this is a Point & Figure bar size.booleanisRange()Determines if this is a constant range bar size.booleanisRenko()Determines if this is a Renko (Japanese Brick) bar size.booleanDetermines if this is a Reversal bar size.booleanisTick()Determines if this is a Tick Interval bar (each bar is composed of a constant number of ticks).static BarSizemillisecond(int ms) static BarSizeminute(int minutes) static BarSizemonth(int months) static BarSizesecond(int seconds) toString()Returns a printable string representation of this bar size (see getName())static BarSizeweek(int weeks) static BarSizeyear(int years)
-
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
-
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
-
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
-
compareTo
- Specified by:
compareToin 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. -
hour
-
minute
-
second
-
millisecond
-
day
-
week
-
month
-
year
-
fromKey
-