Usim consists of 4 basic funcion units: Universe, Metronome, Dataloader, and Portfolio managers, as well as several assistant components: securitymanager, log, and messagepool.
Each of the function unit is higly modulized and well designed to use the same interface and carry out predictable habevior, hence they are easily replaceable.
Universe is the security universe that all dataloaders and alphas will look to.
Universe comprises all relevant contracts and securities that will be used by the Usim, as well as a time axis. Essentially, universe defines a data vault and time axis for later use.
Usim is quasi-eventdriven; She still has a time axis, with each tick ( "ti" in ubiquant's jargon) settled in xml configuration, and constructed in the Usim booting process.
Metronome acts as the heart of Usim.
Metronome takes control right after Usim finishes booting process. The dataloader and portfolio managers are all activated, regulated , driven, and controlled by metronome, no matter in simulation mode or realtime trading one.
In simulation mode, metronome will call dataloaders and alphas according to each tick of the time axis: she goes through all ticks on the time axis in the Universe.
In realtime trading mode, metronome is bundled with vanguard, which is a module responsible to beat every impulse according to different policies.
The vanguard basically answers one question: what time tick is it now?
How she get the answer depends on her policy: she might query the timestamp of the latest Exchange quote, or she make some complex combination of timestamps from different Exchanges.
Portfolio managers assembles a real PM, controlling multiple alphas and stat and trade modules.
A single usim instance can have multiple PMs, and each PM, independent with each other, could inhabit various Alphas, and accompanied stat and trade modules.
All the three components are ubiquant's basic infrastructure: they are to help usim to corporate with other working softwares in ubiquant.
Usim uses Securitymanager client here to retrieve trading day info, today's trading securities meta data: such as symbol, last close price, presettlement price, and etc.
Usim uses ubiquant log component, which provides a centralized loging utility. Please use LOG_INFO("xxx"), LOG_DEBUG("xxx"), LOG_ERROR("xxx") to make your log; Deprecate cout, cerr, printf, and etc.
Messagepool is used here to connect trade module in usim with ubiquant's trading gateway. That said, usim sends trading commands to messagepool, which will transfer the commands to trading gateway in a predefined way.