Package velox.api.layer1.simplified
Interface IntervalAdapter
- All Superinterfaces:
IntervalListener
public interface IntervalAdapter extends IntervalListener
An adapter for
IntervalListener
with empty default method
implementations-
Method Summary
Modifier and Type Method Description default long
getInterval()
Return desired interval width in nanoseconds.default void
onInterval()
Called with frequency set byIntervalListener.getInterval()
.
-
Method Details
-
getInterval
default long getInterval()Description copied from interface:IntervalListener
Return desired interval width in nanoseconds. Should always be larger thanIntervals.MIN_INTERVAL
. You can use other constants inIntervals
class for common intervals, but you are not required to.- Specified by:
getInterval
in interfaceIntervalListener
-
onInterval
default void onInterval()Description copied from interface:IntervalListener
Called with frequency set byIntervalListener.getInterval()
. Useful as replacement forBarDataListener.onBar(velox.api.layer1.layers.utils.OrderBook, Bar)
when you don't really need the bar itself and just want a timer functionality (keep in mind, that indicator time is not bound to computer clock, so using general-purpose timers won't work in many cases)- Specified by:
onInterval
in interfaceIntervalListener
-