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 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 of Layer1ApiAdminProvider.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 and onTimeSourceProvided(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 and onTimeSourceProvided(LongSupplier) and onIntervalWidth(long) and onIntervalsNumber(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 and onTimeSourceProvided(LongSupplier) and onIntervalWidth(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