public class Layer1ApiUpstreamRelay extends Layer1ApiBasicListenable implements Layer1ApiListener
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.atomic.AtomicBoolean |
closed |
adminListeners, dataListeners, instrumentListeners, mboDataListeners, tradingListeners| Constructor and Description |
|---|
Layer1ApiUpstreamRelay() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Stop relaying data.
|
void |
onBalance(BalanceInfo balanceInfo)
Called when account balance information changes
|
void |
onConnectionLost(DisconnectionReason reason,
java.lang.String message)
Connection to server lost
|
void |
onConnectionRestored()
Connection to server restored
|
void |
onDepth(java.lang.String alias,
boolean isBid,
int price,
int size)
Depth data update.
|
void |
onInstrumentAdded(java.lang.String alias,
InstrumentInfo instrumentInfo)
Indicates successful subscription to the instrument
|
void |
onInstrumentAlreadySubscribed(java.lang.String symbol,
java.lang.String exchange,
java.lang.String type)
Indicates that attempt to subscribe failed because subscription is
already active
|
void |
onInstrumentNotFound(java.lang.String symbol,
java.lang.String exchange,
java.lang.String type)
Indicates that attempt to subscribe failed because instrument does not
exist
|
void |
onInstrumentRemoved(java.lang.String alias)
Unsubscribed from instrument (user-initiated or provider initiated).
Please note that if you use this in strategy that implements OnlineCalculatable,
you should not delete any data about instrument that is expected in OnlineCalculatable.calculateValuesInRange(String, String, long, long, int, velox.api.layer1.layers.strategies.interfaces.CalculatedResultListener)
or OnlineCalculatable.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. |
void |
onLoginFailed(LoginFailedReason reason,
java.lang.String message)
Failed to login with specified credentials
|
void |
onLoginSuccessful()
Successful login.
|
void |
onMarketMode(java.lang.String alias,
MarketMode marketMode)
Market mode update.
|
void |
onMboCancel(java.lang.String alias,
java.lang.String orderId) |
void |
onMboReplace(java.lang.String alias,
java.lang.String orderId,
int price,
int size) |
void |
onMboSend(java.lang.String alias,
java.lang.String orderId,
boolean isBid,
int price,
int size) |
void |
onOrderExecuted(ExecutionInfo executionInfo)
Called when one of our orders gets executed
|
void |
onOrderUpdated(OrderInfoUpdate orderInfoUpdate)
Called when order is updated (order creation is also considered an
update).
|
void |
onStatus(StatusInfo statusInfo)
Called when instrument status information changes (PnL, number of open
orders, position, etc).
|
void |
onSystemTextMessage(java.lang.String message,
SystemTextMessageType messageType)
Some message from the system.
|
void |
onTrade(java.lang.String alias,
double price,
int size,
TradeInfo tradeInfo)
Trade
|
void |
onUserMessage(java.lang.Object data)
Allows incorporating arbitrary functionality into protocol
|
addListener, addListener, addListener, addListener, addListener, getAdminListenerBroadcaster, getDataListenerBroadcaster, getInstrumentListenerBroadcaster, getTradingListenerBroadcaster, getUniqueListenersCount, onNoSubscribers, removeListener, removeListener, removeListener, removeListener, removeListenerpublic void onInstrumentAdded(java.lang.String alias,
InstrumentInfo instrumentInfo)
Layer1ApiInstrumentListeneronInstrumentAdded in interface Layer1ApiInstrumentListeneralias - instrument aliasinstrumentInfo - instrument specificationspublic void onInstrumentRemoved(java.lang.String alias)
Layer1ApiInstrumentListenerOnlineCalculatable,
you should not delete any data about instrument that is expected in OnlineCalculatable.calculateValuesInRange(String, String, long, long, int, velox.api.layer1.layers.strategies.interfaces.CalculatedResultListener)
or OnlineCalculatable.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 get Layer1ApiInstrumentListener.onInstrumentRemoved(String) in the middle of OnlineCalculatable requestonInstrumentRemoved in interface Layer1ApiInstrumentListenerpublic void onInstrumentNotFound(java.lang.String symbol,
java.lang.String exchange,
java.lang.String type)
Layer1ApiInstrumentListeneronInstrumentNotFound in interface Layer1ApiInstrumentListenertype - see InstrumentCoreInfo.typepublic void onInstrumentAlreadySubscribed(java.lang.String symbol,
java.lang.String exchange,
java.lang.String type)
Layer1ApiInstrumentListeneronInstrumentAlreadySubscribed in interface Layer1ApiInstrumentListenertype - see InstrumentCoreInfo.typepublic void onTrade(java.lang.String alias,
double price,
int size,
TradeInfo tradeInfo)
Layer1ApiDataListeneronTrade in interface Layer1ApiDataListeneralias - 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 tradepublic void onDepth(java.lang.String alias,
boolean isBid,
int price,
int size)
Layer1ApiDataListeneronDepth in interface Layer1ApiDataListeneralias - instrument aliasisBid - true if it is for bids, false for asksprice - price where size changedsize - new sizepublic void onMboSend(java.lang.String alias,
java.lang.String orderId,
boolean isBid,
int price,
int size)
onMboSend in interface Layer1ApiMboDataListenerpublic void onMboReplace(java.lang.String alias,
java.lang.String orderId,
int price,
int size)
onMboReplace in interface Layer1ApiMboDataListenerpublic void onMboCancel(java.lang.String alias,
java.lang.String orderId)
onMboCancel in interface Layer1ApiMboDataListenerpublic void onMarketMode(java.lang.String alias,
MarketMode marketMode)
Layer1ApiDataListeneronMarketMode in interface Layer1ApiDataListenerpublic void onOrderUpdated(OrderInfoUpdate orderInfoUpdate)
Layer1ApiTradingListeneronOrderUpdated in interface Layer1ApiTradingListenerorderInfoUpdate - information about updatepublic void onOrderExecuted(ExecutionInfo executionInfo)
Layer1ApiTradingListeneronOrderExecuted in interface Layer1ApiTradingListenerexecutionInfo - information about executionpublic void onStatus(StatusInfo statusInfo)
Layer1ApiTradingListeneronStatus in interface Layer1ApiTradingListenerstatusInfo - status informationpublic void onBalance(BalanceInfo balanceInfo)
Layer1ApiTradingListeneronBalance in interface Layer1ApiTradingListenerbalanceInfo - account balance informationpublic void onLoginFailed(LoginFailedReason reason, java.lang.String message)
Layer1ApiAdminListeneronLoginFailed in interface Layer1ApiAdminListenerreason - reason codemessage - test message associated with login fail (may be null)public void onLoginSuccessful()
Layer1ApiAdminListeneronLoginSuccessful in interface Layer1ApiAdminListenerpublic void onConnectionLost(DisconnectionReason reason, java.lang.String message)
Layer1ApiAdminListeneronConnectionLost in interface Layer1ApiAdminListenerreason - reason codemessage - test message associated with login disconnection (may be null)public void onConnectionRestored()
Layer1ApiAdminListeneronConnectionRestored in interface Layer1ApiAdminListenerpublic void onSystemTextMessage(java.lang.String message,
SystemTextMessageType messageType)
Layer1ApiAdminListeneronSystemTextMessage in interface Layer1ApiAdminListenermessage - message itselfmessageType - message typepublic void onUserMessage(java.lang.Object data)
Layer1ApiAdminListeneronUserMessage in interface Layer1ApiAdminListenerdata - Message contentpublic void close()