Package velox.api.layer1.providers.data
Class TradeAggregator
java.lang.Object
velox.api.layer1.providers.data.TradeAggregator
- All Implemented Interfaces:
Runnable
Provides logic for trade aggregation boolean flags calculation - one flag for
each new trade with new ticket ID (provided by target system - time stamp,
aggressor order ID or real trade ID) and second flag for completing previous
'execution chain' on new trade or by timer.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidHandles trades aggregation logic and forwards the trade, do not callLayer1ApiDataListener.onTrade(String, double, int, TradeInfo)after you call this method.voidonTrade(double price, String aTicketId, boolean isBidAggressor, boolean isOtc, int size, String aggressorOrderId, String passiveOrderId) Handles trades aggregation logic and forwards the trade, do not callLayer1ApiDataListener.onTrade(String, double, int, TradeInfo)after you call this method.voidrun()
-
Constructor Details
-
TradeAggregator
Creates new instance ofTradeAggregatorobject.- Parameters:
callback- Callback method for reporting trades upstream.
-
-
Method Details
-
onTrade
public void onTrade(double price, String aTicketId, boolean isBidAggressor, boolean isOtc, int size) Handles trades aggregation logic and forwards the trade, do not callLayer1ApiDataListener.onTrade(String, double, int, TradeInfo)after you call this method. -
onTrade
public void onTrade(double price, String aTicketId, boolean isBidAggressor, boolean isOtc, int size, String aggressorOrderId, String passiveOrderId) Handles trades aggregation logic and forwards the trade, do not callLayer1ApiDataListener.onTrade(String, double, int, TradeInfo)after you call this method. -
run
public void run()
-