Interface OnlineValueCalculatorAdapter
- All Superinterfaces:
Layer1ApiDataAdapter
,Layer1ApiDataListener
,Layer1ApiMboDataAdapter
,Layer1ApiMboDataListener
,Layer1ApiTradingAdapter
,Layer1ApiTradingListener
public interface OnlineValueCalculatorAdapter extends Layer1ApiMboDataAdapter, Layer1ApiDataAdapter, Layer1ApiTradingAdapter
Receives updates, can generate new value for given strategy in response
-
Method Summary
Modifier and Type Method Description default void
onIntervalsNumber(int intervalsNumber)
Guaranteed to be called once after adapter is created and andonTimeSourceProvided(LongSupplier)
andonIntervalWidth(long)
method is called, before any other methods are calleddefault void
onIntervalWidth(long intervalWidth)
Guaranteed to be called once after adapter is created andonTimeSourceProvided(LongSupplier)
and before any other methods are calleddefault void
onLeftTimeChanged(long leftTime)
Guaranteed to be called once after adapter is created and andonTimeSourceProvided(LongSupplier)
andonIntervalWidth(long)
andonIntervalsNumber(int)
methods are called, before any other methods are called
Subsequent calls indicate that chart's left pixel was changeddefault void
onRealTimeDataStart()
Any data that came before this method call was historical data from last pixel
There is no need to treat this data differently, but if this data triggers any invalidates, in some case this could result in continuous invalidations
(if time is paused in replay and chart range is not changing, data received will always be the samedefault void
onTimeSourceProvided(java.util.function.LongSupplier timeSource)
Guaranteed to be called once after adapter is created and before any other methods are called
You should use this method instead of the old way ofLayer1ApiAdminProvider.getCurrentTime()
to get current time from adapter for new indicators, as returned time may differ in some casesdefault void
onUserMessage(java.lang.Object data)
Methods inherited from interface velox.api.layer1.Layer1ApiDataAdapter
onDepth, onMarketMode, onTrade
Methods inherited from interface velox.api.layer1.Layer1ApiMboDataAdapter
onMboCancel, onMboReplace, onMboSend
Methods inherited from interface velox.api.layer1.Layer1ApiTradingAdapter
onBalance, onOrderExecuted, onOrderUpdated, onStatus
-
Method Details
-
onUserMessage
default void onUserMessage(java.lang.Object data) -
onTimeSourceProvided
default void onTimeSourceProvided(java.util.function.LongSupplier timeSource)Guaranteed to be called once after adapter is created and before any other methods are called
You should use this method instead of the old way ofLayer1ApiAdminProvider.getCurrentTime()
to get current time from adapter for new indicators, as returned time may differ in some cases- Parameters:
timeSource
- provider of current time for adapter
-
onIntervalWidth
default void onIntervalWidth(long intervalWidth)Guaranteed to be called once after adapter is created andonTimeSourceProvided(LongSupplier)
and before any other methods are called- Parameters:
intervalWidth
- nanoseconds in 1 pixel of chart
-
onLeftTimeChanged
default void onLeftTimeChanged(long leftTime)Guaranteed to be called once after adapter is created and andonTimeSourceProvided(LongSupplier)
andonIntervalWidth(long)
andonIntervalsNumber(int)
methods are called, before any other methods are called
Subsequent calls indicate that chart's left pixel was changed- Parameters:
leftTime
- time of beginning of left-most chart pixel
-
onIntervalsNumber
default void onIntervalsNumber(int intervalsNumber)Guaranteed to be called once after adapter is created and andonTimeSourceProvided(LongSupplier)
andonIntervalWidth(long)
method is called, before any other methods are called- Parameters:
intervalsNumber
- number of pixel on screen for lifetime of this adapter (if that number changes, adapter will be recreated)
-
onRealTimeDataStart
default void onRealTimeDataStart()Any data that came before this method call was historical data from last pixel
There is no need to treat this data differently, but if this data triggers any invalidates, in some case this could result in continuous invalidations
(if time is paused in replay and chart range is not changing, data received will always be the same
-