flumine icon indicating copy to clipboard operation
flumine copied to clipboard

conflate calls to process_market_book when backtesting

Open jsphon opened this issue 4 years ago • 1 comments

Suppose I am running a backtest using my own recorded data. If I only want to allow it to call process_market_book once a second, how could we refactor Flumine to allow this?

This might not be so straightforward if we need to conflate multiple streaming updates into one.

jsphon avatar Oct 04 '21 21:10 jsphon

I imagine it would work like this:

strategy = LowestLayer(
    market_filter={"markets": markets, "listener_kwargs": {"inplay": True, "conflate": 1000}},
)

We would need to process everything other than the actual strategy.check_market and strategy.process_market_book so that the middleware / order placement can be processed. So maybe add some extra logic to strategy.check_market, would just need to get the conflate value in there and a quick check on last 'processing'.

liampauling avatar Oct 25 '21 08:10 liampauling