Package velox.api.layer1.layers
Class Layer1ApiUpstreamRelay
java.lang.Object
velox.api.layer1.Layer1ApiBasicListenable
velox.api.layer1.layers.Layer1ApiUpstreamRelay
- All Implemented Interfaces:
Layer1ApiAdminListenable,Layer1ApiAdminListener,Layer1ApiDataListenable,Layer1ApiDataListener,Layer1ApiInstrumentListenable,Layer1ApiInstrumentListener,Layer1ApiListener,Layer1ApiMboDataListenable,Layer1ApiMboDataListener,Layer1ApiTradingListenable,Layer1ApiTradingListener,LayerApiListenable
- Direct Known Subclasses:
Layer1ApiRelay
-
Field Summary
FieldsFields inherited from class velox.api.layer1.Layer1ApiBasicListenable
adminListeners, dataListeners, instrumentListeners, mboDataListeners, theOnlyAdminListener, theOnlyDataListener, theOnlyInstrumentListener, theOnlyMboDataListener, theOnlyTradingListener, tradingListeners -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stop relaying data.voidonBalance(BalanceInfo balanceInfo) Called when account balance information changesvoidonConnectionLost(DisconnectionReason reason, String message) Connection to server lost.voidConnection to server restored.voidDepth data update.voidonInstrumentAdded(String alias, InstrumentInfo instrumentInfo) Indicates successful subscription to the instrumentvoidonInstrumentAlreadySubscribed(String symbol, String exchange, String type) Indicates that attempt to subscribe failed because subscription is already activevoidonInstrumentNotFound(String symbol, String exchange, String type) Indicates that attempt to subscribe failed because instrument does not existvoidonInstrumentRemoved(String alias) Unsubscribed from instrument (user-initiated or provider initiated).
Please note that if you use this in strategy that implementsOnlineCalculatable, you should not delete any data about instrument that is expected inOnlineCalculatable.calculateValuesInRange(String, String, long, long, int, velox.api.layer1.layers.strategies.interfaces.CalculatedResultListener)orOnlineCalculatable.createOnlineValueCalculator(String, String, long, java.util.function.Consumer, velox.api.layer1.layers.strategies.interfaces.InvalidateInterface), or should handle absence of that data (in case you delete it) gracefully.voidonLoginFailed(LoginFailedReason reason, String message) Failed to login with specified credentialsvoidSuccessful login.voidonMarketMode(String alias, MarketMode marketMode) Market mode update.voidonMboCancel(String alias, String orderId) voidonMboReplace(String alias, String orderId, int price, int size) voidvoidonOrderExecuted(ExecutionInfo executionInfo) Called when one of our orders gets executedvoidonOrderUpdated(OrderInfoUpdate orderInfoUpdate) Called when order is updated (order creation is also considered an update).voidonStatus(StatusInfo statusInfo) Called when instrument status information changes (PnL, number of open orders, position, etc).voidonSystemTextMessage(String message, SystemTextMessageType messageType) Passes the message into Bookmap and shows it as a popup.voidTradevoidonUserMessage(Object data) Send an upstream event.Methods inherited from class velox.api.layer1.Layer1ApiBasicListenable
addListener, addListener, addListener, addListener, addListener, getAdminListenerBroadcaster, getDataListenerBroadcaster, getInstrumentListenerBroadcaster, getTradingListenerBroadcaster, getUniqueListenersCount, onNoSubscribers, removeListener, removeListener, removeListener, removeListener, removeListener
-
Field Details
-
closed
-
-
Constructor Details
-
Layer1ApiUpstreamRelay
public Layer1ApiUpstreamRelay()
-
-
Method Details
-
onInstrumentAdded
Description copied from interface:Layer1ApiInstrumentListenerIndicates successful subscription to the instrument- Specified by:
onInstrumentAddedin interfaceLayer1ApiInstrumentListener- Parameters:
alias- instrument aliasinstrumentInfo- instrument specifications
-
onInstrumentRemoved
Description copied from interface:Layer1ApiInstrumentListenerUnsubscribed from instrument (user-initiated or provider initiated).
Please note that if you use this in strategy that implementsOnlineCalculatable, you should not delete any data about instrument that is expected inOnlineCalculatable.calculateValuesInRange(String, String, long, long, int, velox.api.layer1.layers.strategies.interfaces.CalculatedResultListener)orOnlineCalculatable.createOnlineValueCalculator(String, String, long, java.util.function.Consumer, velox.api.layer1.layers.strategies.interfaces.InvalidateInterface), or should handle absence of that data (in case you delete it) gracefully. The reason is that you can getLayer1ApiInstrumentListener.onInstrumentRemoved(String)in the middle ofOnlineCalculatablerequest- Specified by:
onInstrumentRemovedin interfaceLayer1ApiInstrumentListener- Parameters:
alias-
-
onInstrumentNotFound
Description copied from interface:Layer1ApiInstrumentListenerIndicates that attempt to subscribe failed because instrument does not exist- Specified by:
onInstrumentNotFoundin interfaceLayer1ApiInstrumentListener- Parameters:
symbol-exchange-type- seeInstrumentCoreInfo.type
-
onInstrumentAlreadySubscribed
Description copied from interface:Layer1ApiInstrumentListenerIndicates that attempt to subscribe failed because subscription is already active- Specified by:
onInstrumentAlreadySubscribedin interfaceLayer1ApiInstrumentListener- Parameters:
symbol-exchange-type- seeInstrumentCoreInfo.type
-
onTrade
Description copied from interface:Layer1ApiDataListenerTrade- Specified by:
onTradein interfaceLayer1ApiDataListener- Parameters:
alias- instrument aliasprice- price in the same units as in depth update (e.g. if pips=25 then price=1000 means 25000)size- trade sizetradeInfo- additional information about the trade
-
onDepth
Description copied from interface:Layer1ApiDataListenerDepth data update.- Specified by:
onDepthin interfaceLayer1ApiDataListener- Parameters:
alias- instrument aliasisBid- true if it is for bids, false for asksprice- price where size changedsize- new size
-
onMboSend
- Specified by:
onMboSendin interfaceLayer1ApiMboDataListener
-
onMboReplace
- Specified by:
onMboReplacein interfaceLayer1ApiMboDataListener
-
onMboCancel
- Specified by:
onMboCancelin interfaceLayer1ApiMboDataListener
-
onMarketMode
Description copied from interface:Layer1ApiDataListenerMarket mode update.- Specified by:
onMarketModein interfaceLayer1ApiDataListener- Parameters:
alias-marketMode-
-
onOrderUpdated
Description copied from interface:Layer1ApiTradingListenerCalled when order is updated (order creation is also considered an update).- Specified by:
onOrderUpdatedin interfaceLayer1ApiTradingListener- Parameters:
orderInfoUpdate- information about update
-
onOrderExecuted
Description copied from interface:Layer1ApiTradingListenerCalled when one of our orders gets executed- Specified by:
onOrderExecutedin interfaceLayer1ApiTradingListener- Parameters:
executionInfo- information about execution
-
onStatus
Description copied from interface:Layer1ApiTradingListenerCalled when instrument status information changes (PnL, number of open orders, position, etc).- Specified by:
onStatusin interfaceLayer1ApiTradingListener- Parameters:
statusInfo- status information
-
onBalance
Description copied from interface:Layer1ApiTradingListenerCalled when account balance information changes- Specified by:
onBalancein interfaceLayer1ApiTradingListener- Parameters:
balanceInfo- account balance information
-
onLoginFailed
Description copied from interface:Layer1ApiAdminListenerFailed to login with specified credentials- Specified by:
onLoginFailedin interfaceLayer1ApiAdminListener- Parameters:
reason- reason codemessage- test message associated with login fail (may be null)
-
onLoginSuccessful
public void onLoginSuccessful()Description copied from interface:Layer1ApiAdminListenerSuccessful login.- Specified by:
onLoginSuccessfulin interfaceLayer1ApiAdminListener
-
onConnectionLost
Description copied from interface:Layer1ApiAdminListenerConnection to server lost. Provider can call this method multiple times in sequence if the reason was changed (i.e. fromDisconnectionReason.NO_INTERNETtoDisconnectionReason.FATAL)- Specified by:
onConnectionLostin interfaceLayer1ApiAdminListener- Parameters:
reason- reason codemessage- text message associated with login disconnection (may be null)
-
onConnectionRestored
public void onConnectionRestored()Description copied from interface:Layer1ApiAdminListenerConnection to server restored. A provider should call it only if it previously invokedLayer1ApiAdminListener.onConnectionLost(DisconnectionReason, String)- Specified by:
onConnectionRestoredin interfaceLayer1ApiAdminListener
-
onSystemTextMessage
Description copied from interface:Layer1ApiAdminListenerPasses the message into Bookmap and shows it as a popup. It is suitable for 1-time notifications, but for the general case take a look at the notifications API -Layer1ApiSoundAlertMessage- Specified by:
onSystemTextMessagein interfaceLayer1ApiAdminListener- Parameters:
message- message itselfmessageType- message type- See Also:
-
onUserMessage
Description copied from interface:Layer1ApiAdminListenerSend an upstream event. Allows incorporating arbitrary functionality into protocol- Specified by:
onUserMessagein interfaceLayer1ApiAdminListener- Parameters:
data- Message content
-
close
public void close()Stop relaying data. Will not let send new events upwards, but is not guaranteed to stop ones already in progress.
-