Skip to content
Numerical Method , home
Menu

Forum Applications Trading Strategies (Algo Quant)

Ticks of type TRADE and Depth

  1. jersonParticipant 2012-08-20 at 8:01 am

    Hi,

    I am wondering what would be the correct way to expose trades to Strategies in AlgoQuant framework.

    Per the Tutorial strategies implement DepthHandler, but it doesn’t seem like Depth exposes the TRADE data. When receiving Tick Data you receive both Quotes (BID or ASK) which are well modeled by Depth, but you also receive ticks for the trades executed. It seems important to be able to make decisions on those ticks in a Strategy . Am I mistaken ? What would be your suggestion to implement those whilst keeping in the “spirit” of AlgoQuant ?

    Thanks a lot.

  2. Ken YiuParticipant 2012-08-21 at 4:59 am

    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]