Interface Api


public interface Api
Allows communicating back to Bookmap.
  • Method Details

    • registerIndicator

      default Indicator registerIndicator​(java.lang.String name, velox.api.layer1.messages.indicators.Layer1ApiUserMessageModifyIndicator.GraphType graphType)
      Similar to registerIndicator(String, GraphType, double), assumes initialValue = NaN (no line until first update)
      Parameters:
      name - user-friendly name for an indicator. Must be unique within alias.
      graphType - where to draw the indicator (bottom panel or main chart)
      Returns:
      indicator object that can be used to manipulate the line
    • registerIndicatorModifiable

      default IndicatorModifiable registerIndicatorModifiable​(java.lang.String name, velox.api.layer1.messages.indicators.Layer1ApiUserMessageModifyIndicator.GraphType graphType)
    • registerIndicator

      default Indicator registerIndicator​(java.lang.String name, velox.api.layer1.messages.indicators.Layer1ApiUserMessageModifyIndicator.GraphType graphType, double initialValue)
      Register an indicator (line).
      Parameters:
      name - user-friendly name for an indicator. Must be unique within alias.
      graphType - where to draw the indicator (bottom panel or main chart)
      initialValue - initial value of the indicator. NaN means "no visible line".
      Returns:
      indicator object that can be used to manipulate the line
    • registerIndicator

      Indicator registerIndicator​(java.lang.String name, velox.api.layer1.messages.indicators.Layer1ApiUserMessageModifyIndicator.GraphType graphType, double initialValue, boolean showLineByDefault, boolean showWidgetByDefault)
      Register an indicator (line).
      Parameters:
      name - user-friendly name for an indicator. Must be unique within alias.
      graphType - where to draw the indicator (bottom panel or main chart)
      initialValue - initial value of the indicator. NaN means "no visible line".
      showLineByDefault - show indicator line by default. If false user has to manually enable the line before it's visible
      showWidgetByDefault - show indicator widget by default. If false user has to manually enable the widget before it's visible
      Returns:
      indicator object that can be used to manipulate the line
    • registerIndicatorModifiable

      default IndicatorModifiable registerIndicatorModifiable​(java.lang.String name, velox.api.layer1.messages.indicators.Layer1ApiUserMessageModifyIndicator.GraphType graphType, double initialValue)
    • registerIndicatorModifiable

      IndicatorModifiable registerIndicatorModifiable​(java.lang.String name, velox.api.layer1.messages.indicators.Layer1ApiUserMessageModifyIndicator.GraphType graphType, double initialValue, boolean showLineByDefault, boolean showWidgetByDefault)
    • sendOrder

      void sendOrder​(velox.api.layer1.data.OrderSendParameters orderSendParameters)
      Submit order with specified parameters
      Parameters:
      orderSendParameters - parameters
    • updateOrder

      void updateOrder​(velox.api.layer1.data.OrderUpdateParameters orderUpdateParameters)
      Update order according to parameters
      Parameters:
      orderUpdateParameters - parameters
    • setSettings

      <T> void setSettings​(T settingsObject)
      Store settings.
      Parameters:
      settingsObject - your settings object. Class must be annotated with StrategySettingsVersion
    • getSettings

      <T> T getSettings​(java.lang.Class<? extends T> settingsClass)
      Retrieve earlier stored settings
      Parameters:
      settingsClass - class of your settings object. Must be annotated with StrategySettingsVersion
      Returns:
      settings object. If there is no compatible saved object for this request, new object will be created with default constructor
      Changing returned object will not change settings. You need to call setSettings(Object) for this
    • unload

      void unload()
      Request unloading the module. This will lead to your module being unloaded for current alias. You could use it when error is detected and running module further makes no sense. You might still get few events before your requests gets processed. Note, that module will keep running for other aliases.
    • reload

      void reload()
      Request reloading the module. This will lead to your module being unloaded for current alias, then loaded back. Typical use case would be to apply settings changes.
    • addTimeListeners

      void addTimeListeners​(TimeListener timeListener)
      Manually add time listener when using NoAutosubscription
    • addDepthDataListeners

      void addDepthDataListeners​(DepthDataListener depthDataListener)
      Manually add depth data listener when using NoAutosubscription
    • addMarketByOrderDepthDataListeners

      void addMarketByOrderDepthDataListeners​(MarketByOrderDepthDataListener marketByOrderDepthDataListener)
      Manually add depth data listener when using NoAutosubscription
    • addSnapshotEndListeners

      void addSnapshotEndListeners​(SnapshotEndListener snapshotEndListener)
      Manually add snapshot end listener when using NoAutosubscription
    • addTradeDataListeners

      void addTradeDataListeners​(TradeDataListener tradeDataListener)
      Manually add trade data listener when using NoAutosubscription
    • addIntervalListeners

      void addIntervalListeners​(IntervalListener intervalListener)
      Manually add interval listener when using NoAutosubscription
    • addBarDataListeners

      void addBarDataListeners​(BarDataListener barDataListener)
      Manually add bar data listener when using NoAutosubscription
    • addBboDataListeners

      void addBboDataListeners​(BboListener bboListener)
      Manually add bbo listener when using NoAutosubscription
    • addOrdersListeners

      void addOrdersListeners​(OrdersListener ordersListener)
      Manually add order listener when using NoAutosubscription
    • addStatusListeners

      void addStatusListeners​(PositionListener positionListener)
      Manually add position listener when using NoAutosubscription
    • addBalanceListeners

      void addBalanceListeners​(BalanceListener balanceListener)
      Manually add balance data listener when using NoAutosubscription
    • addHistoricalModeListeners

      void addHistoricalModeListeners​(HistoricalModeListener historicalModeListener)
      Manually add historicaL mode listener when using NoAutosubscription
    • addMultiInstrumentListeners

      void addMultiInstrumentListeners​(MultiInstrumentListener multiInstrumentListener)
      Manually add multi-instrument data listener when using NoAutosubscription
    • sendUserMessage

      void sendUserMessage​(java.lang.Object data)
      Allows communicating with other modules
    • getProvider

      velox.api.layer1.Layer1ApiProvider getProvider()
      Allows advanced actions that require direct access to L1 stack. Most indicators do not need it.