Market Event Generators

A MarketEventGenerator has a MarketClock data model and a list of listeners to process any time changes from the clock model.

The Generators and MarketClock should be instantiated dynamically rather than as a @Component, because there’re multiple markets running under the application context. For convenience, we will maintain a Map of generators, each for a market.

MarketClock MarketClock has a set of properties, including: heartbeat, localdate, localtime and etc. It will fire property change events when any of the property is changing. A typical scenario is where a user decides to update MarketClock for HKSE with heartbeat timestamps, he builds a HeartBeatListener, obtains a reference to HKSE’s MarketClock and update the heartbeat of that instance. As soon as the heartbeat timestamp is changed, the MarketClock will calculate localtime and localdate based on HKSE timezone, and generate PropertyChangeEvents accordingly.

MarketEventGenerator A MarketEventGenerator listens to PropertyChangeEvents from MarketClock, and generate correspondingly market events such as MarketOpenEvent, MarketCloseEvent and etc. Such MarketEvents will be published to EBS so that simulation engine and strategy will handle such events properly.

Published by

wofong

三千娑婆世界,三千难忘遗憾;回头乃是岸,此岸在何方;堪忍不能忍,万般看不穿;何时放得下,始得自在心。 I'm a programmer, a quantitative analyst, a photography hobbyist, a traveler, a runner, and a nature lover.

One thought on “Market Event Generators”

Leave a comment