Login
Login

Re: Ticks of type TRADE and Depth

Home 21090308 Forums Re: Ticks of type TRADE and Depth

#2195
kenyiu
Participant

Currently, we do not have special handling for TRADE data. For simulation, you may treat both trade and quote in the same way (as they both represent historical prices).

If you want to handle trade and quote separately, you may consider implementing:

  1. a new [tt:3hd0b09w]Subscribable[/tt:3hd0b09w] type, say [tt:3hd0b09w]Trade[/tt:3hd0b09w], and
  2. a new [tt:3hd0b09w]ChannelMessageHandler[/tt:3hd0b09w] in the [tt:3hd0b09w]execution.simulator.handler[/tt:3hd0b09w] package, say [tt:3hd0b09w]TradeMessageHandler[/tt:3hd0b09w], and
  3. a new [tt:3hd0b09w]UpdateHandler[/tt:3hd0b09w] in the [tt:3hd0b09w]execution.strategy.handler[/tt:3hd0b09w] package, say [tt:3hd0b09w]TradeHandler[/tt:3hd0b09w].

After that, your strategy can implement [tt:3hd0b09w]TradeHandler[/tt:3hd0b09w] to receive trade updates.
In the main program, you need to pass a cache of [tt:3hd0b09w]Trade[/tt:3hd0b09w]s to the simulator using [tt:3hd0b09w].withNonDepthUpdates()[/tt:3hd0b09w]