The Lab

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Synopsis

Trading Venues either stream data (sending updates as they occur) or batch changes into a single update, sent at regular time intervals. A batch update may require one or more messages from the Trading Venue. Several Markets may change in the original batch update but not all Market updates are guaranteed to arrive at the same time if they are split over multiple messages. This can cause the appearance of a false arbitrage opportunity. 

Example

(EUR/USD, USD/JPY, EUR/JPY) price updates for the following markets originate from the Trading Venue
(USD/JPY, EUR/JPY) prices arrive first with no update to (EUR/USD); BUY signal is registered
(EUR/USD) then arrives; Although BUY Signal is no longer valid.


Use Cases

Batched market data updates are only available on Feeds with Trading Venues that provide them, typically time-sliced feeds provided by venues such as EBS. Streaming feeds (such as HotspotFX via ITCH, or CME) don't have any batched messages, so MD messages always consist of a single batch.

Whisperer employs a batch detection mechanism using (onBatchComplete()) which relies on the onMarketData() callbacks. Once Whisperer gets a new market data update, it immediately calls back to the handler for the MFClient to update the books (onMarketData()), and then determines if the marketdata update completes a batch; if so, Whisperer calls on onBatchComplete(). This sequence takes place very quickly 

Note

onBatchComplete() is meant to be used only for strategies which have an interest in multiple currency pairs simultaneously; for example, if you implemented some arbitrage strategy between currencies A and B, you may want to hold off triggering sending orders if you got an AB batched update but you've only received A so far (the strategy would see an updated A book and an outdated B book; -It is known an update for B is coming but it has not been received yet).

When the corresponding MD update for B arrives, if the instance has registered an interest for AB batches, onBatchComplete() should be called after
onMarketData(B) is called.


Sequence Diagram 

To be continued...

  • No labels